aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus')
-rw-r--r--src/Java/gtPlusPlus/COPYRIGHT.MD18
-rw-r--r--src/Java/gtPlusPlus/GTplusplus.java8
-rw-r--r--src/Java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java197
-rw-r--r--src/Java/gtPlusPlus/api/helpers/MaterialHelper.java17
-rw-r--r--src/Java/gtPlusPlus/api/objects/data/AutoMap.java21
-rw-r--r--src/Java/gtPlusPlus/api/objects/data/ConcurrentHashSet.java18
-rw-r--r--src/Java/gtPlusPlus/api/objects/data/ConcurrentSet.java53
-rw-r--r--src/Java/gtPlusPlus/api/objects/data/FlexiblePair.java39
-rw-r--r--src/Java/gtPlusPlus/api/objects/data/WeightedCollection.java102
-rw-r--r--src/Java/gtPlusPlus/api/objects/minecraft/BlockPos.java2
-rw-r--r--src/Java/gtPlusPlus/api/objects/minecraft/CubicObject.java62
-rw-r--r--src/Java/gtPlusPlus/api/objects/minecraft/FakeBlockPos.java2
-rw-r--r--src/Java/gtPlusPlus/api/objects/minecraft/SafeTexture.java64
-rw-r--r--src/Java/gtPlusPlus/api/objects/minecraft/ThreadFakeWorldGenerator.java2
-rw-r--r--src/Java/gtPlusPlus/api/objects/minecraft/ThreadPooCollector.java2
-rw-r--r--src/Java/gtPlusPlus/api/objects/minecraft/multi/NoOutputBonusMultiBehaviour.java27
-rw-r--r--src/Java/gtPlusPlus/api/objects/minecraft/multi/SpecialMultiBehaviour.java44
-rw-r--r--src/Java/gtPlusPlus/api/objects/random/XSTR.java9
-rw-r--r--src/Java/gtPlusPlus/australia/GTplusplus_Australia.java8
-rw-r--r--src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianPlains.java1
-rw-r--r--src/Java/gtPlusPlus/australia/chunk/ChunkProviderAustralia.java27
-rw-r--r--src/Java/gtPlusPlus/australia/gen/map/component/ComponentHut.java4
-rw-r--r--src/Java/gtPlusPlus/core/block/ModBlocks.java4
-rw-r--r--src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java315
-rw-r--r--src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java2
-rw-r--r--src/Java/gtPlusPlus/core/block/general/MiningExplosives.java6
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/CircuitProgrammer.java111
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java131
-rw-r--r--src/Java/gtPlusPlus/core/common/BasePlayer.java183
-rw-r--r--src/Java/gtPlusPlus/core/common/CommonProxy.java11
-rw-r--r--src/Java/gtPlusPlus/core/container/Container_RoundRobinator.java246
-rw-r--r--src/Java/gtPlusPlus/core/container/Container_SuperJukebox.java4
-rw-r--r--src/Java/gtPlusPlus/core/fluids/FactoryFluid.java2
-rw-r--r--src/Java/gtPlusPlus/core/gui/machine/GUI_PestKiller.java4
-rw-r--r--src/Java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java120
-rw-r--r--src/Java/gtPlusPlus/core/handler/AchievementHandler.java5
-rw-r--r--src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java97
-rw-r--r--src/Java/gtPlusPlus/core/handler/GuiHandler.java53
-rw-r--r--src/Java/gtPlusPlus/core/handler/StopAnnoyingFuckingAchievements.java13
-rw-r--r--src/Java/gtPlusPlus/core/handler/events/SneakManager.java33
-rw-r--r--src/Java/gtPlusPlus/core/inventories/InventoryCircuitProgrammer.java4
-rw-r--r--src/Java/gtPlusPlus/core/inventories/Inventory_RoundRobinator.java172
-rw-r--r--src/Java/gtPlusPlus/core/item/ModItems.java8
-rw-r--r--src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java10
-rw-r--r--src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java124
-rw-r--r--src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java2
-rw-r--r--src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java32
-rw-r--r--src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTooltip.java34
-rw-r--r--src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java110
-rw-r--r--src/Java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java2
-rw-r--r--src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java209
-rw-r--r--src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java123
-rw-r--r--src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java547
-rw-r--r--src/Java/gtPlusPlus/core/item/chemistry/OilChem.java163
-rw-r--r--src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java37
-rw-r--r--src/Java/gtPlusPlus/core/item/chemistry/StandardBaseParticles.java2
-rw-r--r--src/Java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java162
-rw-r--r--src/Java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java4
-rw-r--r--src/Java/gtPlusPlus/core/item/general/ItemControlCore.java3
-rw-r--r--src/Java/gtPlusPlus/core/item/general/ItemGenericToken.java15
-rw-r--r--src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java29
-rw-r--r--src/Java/gtPlusPlus/core/item/general/ItemSlowBuildingRing.java43
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/misc/DebugScanner.java22
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/misc/GregtechPump.java2
-rw-r--r--src/Java/gtPlusPlus/core/lib/CORE.java23
-rw-r--r--src/Java/gtPlusPlus/core/material/ELEMENT.java27
-rw-r--r--src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java55
-rw-r--r--src/Java/gtPlusPlus/core/material/Material.java146
-rw-r--r--src/Java/gtPlusPlus/core/material/MaterialGenerator.java40
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java309
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_General.java22
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java132
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_SeleniumProcessing.java18
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_Tools.java11
-rw-r--r--src/Java/gtPlusPlus/core/recipe/common/CI.java27
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java45
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotIntegratedCircuit.java49
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotNoInputLogging.java36
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java2
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java35
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java739
-rw-r--r--src/Java/gtPlusPlus/core/util/Utils.java3
-rw-r--r--src/Java/gtPlusPlus/core/util/data/ArrayUtils.java17
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/ClientUtils.java18
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java12
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java9
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java15
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/LangUtils.java56
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java5
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/OreDictUtils.java25
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java27
-rw-r--r--src/Java/gtPlusPlus/core/util/reflect/OreDictUtils.java7
-rw-r--r--src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java113
-rw-r--r--src/Java/gtPlusPlus/everglades/biome/BiomeGenerator_Custom.java4
-rw-r--r--src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java28
-rw-r--r--src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java458
-rw-r--r--src/Java/gtPlusPlus/nei/GT_NEI_MultiBlockHandler.java2
-rw-r--r--src/Java/gtPlusPlus/nei/NEI_GT_Config.java7
-rw-r--r--src/Java/gtPlusPlus/plugin/agrichem/AlgaeDefinition.java60
-rw-r--r--src/Java/gtPlusPlus/plugin/agrichem/AlgaeUtils.java11
-rw-r--r--src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java1428
-rw-r--r--src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java19
-rw-r--r--src/Java/gtPlusPlus/plugin/agrichem/IAlgalItem.java12
-rw-r--r--src/Java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java88
-rw-r--r--src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemAgrichemBase.java247
-rw-r--r--src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java235
-rw-r--r--src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemBioChip.java138
-rw-r--r--src/Java/gtPlusPlus/plugin/agrichem/logic/AlgaeGeneticData.java130
-rw-r--r--src/Java/gtPlusPlus/plugin/agrichem/logic/AlgaeGrowthRequirement.java5
-rw-r--r--src/Java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java2
-rw-r--r--src/Java/gtPlusPlus/plugin/villagers/entity/EntityBaseVillager.java5
-rw-r--r--src/Java/gtPlusPlus/plugin/villagers/entity/EntityNativeAustralian.java7
-rw-r--r--src/Java/gtPlusPlus/preloader/DevHelper.java2
-rw-r--r--src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_CharcoalPit.java142
-rw-r--r--src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TC_ItemWispEssence.java61
-rw-r--r--src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer2.java2
-rw-r--r--src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java6
-rw-r--r--src/Java/gtPlusPlus/xmod/bop/blocks/BOP_Block_Registrator.java50
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java14
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java40
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java23
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java16
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java184
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java122
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java21
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java65
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java3
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java212
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java555
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java35
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Boulder.java3
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore_Normal.java3
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java457
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java20
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java1
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java9
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/helpers/GT_MethodHelper.java80
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java37
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java10
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java18
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java74
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java13
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java688
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java26
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java9
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java14
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java8
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java502
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java13
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java823
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java200
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java25
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java10
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java202
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java170
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java28
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java28
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java24
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPollutionDevices.java7
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java6
-rw-r--r--src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java276
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java68
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/reliquary/util/ReliquaryRecipeHandler.java3
-rw-r--r--src/Java/gtPlusPlus/xmod/thaumcraft/util/ThaumcraftUtils.java29
-rw-r--r--src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java35
185 files changed, 12509 insertions, 1861 deletions
diff --git a/src/Java/gtPlusPlus/COPYRIGHT.MD b/src/Java/gtPlusPlus/COPYRIGHT.MD
new file mode 100644
index 0000000000..6c199fa5fe
--- /dev/null
+++ b/src/Java/gtPlusPlus/COPYRIGHT.MD
@@ -0,0 +1,18 @@
+COPYRIGHT TEMPLATE
+
+Copyright (c) ${date} AlkCorp.
+
+All rights reserved.
+Distribution of the software in any form is only allowed with explicit,
+prior permission from the owner.
+
+This class is provided freely and may be decompiled and modified for private use,
+either with a decompiler or a bytecode editor. Public use of modified or derivative versions
+is prohibited unless you are given specific written permission.
+
+Distribution of the source code, modified (including custom compilation) or otherwise,
+is prohibited by anyone except the author, except in the case of a derivative mod that has
+been given prior approval. Creating derivative works for commercial use is expressly forbidden
+and the owner reserves full right to seek damages.
+
+Contributors: https://github.com/alkcorp/GTplusplus/graphs/contributors \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java
index 0a43e16519..9cf395a9bf 100644
--- a/src/Java/gtPlusPlus/GTplusplus.java
+++ b/src/Java/gtPlusPlus/GTplusplus.java
@@ -105,7 +105,6 @@ public class GTplusplus implements ActionListener {
//Mod Instance
@Mod.Instance(CORE.MODID)
public static GTplusplus instance;
- public static Meta_GT_Proxy instanceGtProxy;
//Material Loader
public static GT_Material_Loader mGregMatLoader;
@@ -181,8 +180,7 @@ public class GTplusplus implements ActionListener {
mChunkLoading.preInit(event);
proxy.preInit(event);
Logger.INFO("Setting up our own GT_Proxy.");
- instanceGtProxy = Meta_GT_Proxy.instance;
- instanceGtProxy.preInit();
+ Meta_GT_Proxy.preInit();
Core_Manager.preInit();
}
@@ -194,7 +192,7 @@ public class GTplusplus implements ActionListener {
proxy.init(event);
HazmatUtils.init();
proxy.registerNetworkStuff();
- instanceGtProxy.init();
+ Meta_GT_Proxy.init();
Core_Manager.init();
//Used by foreign players to generate .lang files for translation.
@@ -211,7 +209,7 @@ public class GTplusplus implements ActionListener {
mChunkLoading.postInit(event);
proxy.postInit(event);
BookHandler.runLater();
- instanceGtProxy.postInit();
+ Meta_GT_Proxy.postInit();
Core_Manager.postInit();
//SprinklerHandler.registerModFerts();
diff --git a/src/Java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java b/src/Java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java
new file mode 100644
index 0000000000..3acca269d7
--- /dev/null
+++ b/src/Java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java
@@ -0,0 +1,197 @@
+package gtPlusPlus.api.helpers;
+
+import java.util.HashMap;
+
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.data.WeightedCollection;
+import gtPlusPlus.api.objects.minecraft.multi.SpecialMultiBehaviour;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.xmod.gregtech.api.util.SpecialBehaviourTooltipHandler;
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
+
+public class GregtechPlusPlus_API {
+
+ public static class Multiblock_API {
+
+ private static final HashMap<String, SpecialMultiBehaviour> mSpecialBehaviourItemMap;
+
+ static {
+ mSpecialBehaviourItemMap = new HashMap<String, SpecialMultiBehaviour>();
+ }
+
+ /**
+ * Register a special behaviour for GT++ Multis to listen use.
+ * @param aBehaviour - An Object which has extended {@link SpecialMultiBehaviour}'s base implementation.
+ * @return - Did this behaviour register properly?
+ */
+ public static boolean registerSpecialMultiBehaviour(SpecialMultiBehaviour aBehaviour) {
+ if (aBehaviour.getTriggerItem() == null || aBehaviour.getTriggerItemTooltip() == null || aBehaviour.getTriggerItemTooltip().length() <= 0) {
+ Logger.INFO("Failed to attach custom multiblock logic to "+ItemUtils.getItemName(aBehaviour.getTriggerItem()));
+ return false;
+ }
+ mSpecialBehaviourItemMap.put("UniqueKey_"+aBehaviour.hashCode(), aBehaviour);
+ SpecialBehaviourTooltipHandler.addTooltipForItem(aBehaviour.getTriggerItem(), aBehaviour.getTriggerItemTooltip());
+ Logger.INFO("Attached custom multiblock logic to "+ItemUtils.getItemName(aBehaviour.getTriggerItem()));
+ return true;
+ }
+
+ public static final HashMap<String, SpecialMultiBehaviour> getSpecialBehaviourItemMap() {
+ return mSpecialBehaviourItemMap;
+ }
+
+
+ }
+
+ public static class VoidMiner_API {
+
+ private static final HashMap<Integer, HashMap<String, WeightedCollection<Block>>> mMinerLootCache;
+
+ static {
+ mMinerLootCache = new HashMap<Integer, HashMap<String, WeightedCollection<Block>>>();
+ }
+
+
+ /**
+ *
+ * Registers an ore block for a dimension. Uses a default weight of 100.
+ * @param aDim - The Dimension ID
+ * @param aOredictName - The OreDict name of the Ore to be mined.
+ * @return - If there was a valid Block found in the OreDict for the provided name.
+ */
+ public static boolean registerOreForVoidMiner(int aDim, String aOredictName) {
+ return registerOreForVoidMiner(aDim, aOredictName, 100);
+ }
+
+ /**
+ *
+ * Registers an ore block for a dimension. Uses a default weight of 100.
+ * @param aDim - The Dimension ID
+ * @param aOredictName - The OreDict name of the Ore to be mined.
+ * @param aWeight - The weight of this ore Block.
+ * @return - If there was a valid Block found in the OreDict for the provided name.
+ */
+ public static boolean registerOreForVoidMiner(int aDim, String aOredictName, int aWeight) {
+ Block b = null;
+ ItemStack[] aValidItems = ItemUtils.validItemsForOreDict(aOredictName);
+ for (ItemStack g : aValidItems) {
+ if (g != null) {
+ b = Block.getBlockFromItem(g.getItem());
+ if (b != null) {
+ break;
+ }
+ }
+ }
+ if (b != null) {
+ registerOreForVoidMiner(aDim, b, aWeight);
+ return true;
+ }
+ return false;
+ }
+
+
+ /**
+ * Registers an ore block for a dimension. Uses a default weight of 100.
+ * @param aDim - The Dimension ID
+ * @param aOreBlock - The Ore Block to be mined.
+ */
+ public static void registerOreForVoidMiner(int aDim, Block aOreBlock) {
+ registerOreForVoidMiner(aDim, aOreBlock, 100);
+ }
+
+ /**
+ * Registers an ore block for a dimension.
+ * @param aDim - The Dimension ID
+ * @param aOreBlock - The Ore Block to be mined.
+ * @param aWeight - The weight of this ore Block.
+ */
+ public static void registerOreForVoidMiner(int aDim, Block aOreBlock, int aWeight) {
+ GregtechPlusPlus_API_Internal.writeBlockToDimensionInCache(aDim, 0, aOreBlock, aWeight);
+ }
+
+ /**
+ * Registers a surface block for a dimension. Uses a default weight of 100.
+ * @param aDim - The Dimension ID
+ * @param aDirtBlock - The Dirt/Grass Block to be mined.
+ */
+ public static void registerEarthSurfaceForVoidMiner(int aDim, Block aDirtBlock) {
+ registerEarthSurfaceForVoidMiner(aDim, aDirtBlock, 100);
+ }
+
+ /**
+ * Registers a surface block for a dimension.
+ * @param aDim - The Dimension ID
+ * @param aDirtBlock - The Dirt/Grass Block to be mined.
+ * @param aWeight - The weight of this Dirt/Grass Block.
+ */
+ public static void registerEarthSurfaceForVoidMiner(int aDim, Block aDirtBlock, int aWeight) {
+ GregtechPlusPlus_API_Internal.writeBlockToDimensionInCache(aDim, 0, aDirtBlock, aWeight);
+ }
+
+ /**
+ * Registers a stone block for a dimension. Uses a default weight of 100.
+ * @param aDim - The Dimension ID
+ * @param aStoneBlock - The Stone Block to be mined.
+ */
+ public static void registerEarthStoneForVoidMiner(int aDim, Block aStoneBlock) {
+ registerEarthStoneForVoidMiner(aDim, aStoneBlock, 100);
+ }
+
+ /**
+ * Registers a stone block for a dimension.
+ * @param aDim - The Dimension ID
+ * @param aStoneBlock - The Stone Block to be mined.
+ * @param aWeight - The weight of this Stone Block.
+ */
+ public static void registerEarthStoneForVoidMiner(int aDim, Block aStoneBlock, int aWeight) {
+ GregtechPlusPlus_API_Internal.writeBlockToDimensionInCache(aDim, 0, aStoneBlock, aWeight);
+ }
+
+
+
+
+ public static WeightedCollection<Block> getAllRegisteredOresForDimension(int aDim) {
+ return mMinerLootCache.get(aDim).get("ore");
+ }
+
+ public static WeightedCollection<Block> getAllRegisteredDirtTypesForDimension(int aDim) {
+ return mMinerLootCache.get(aDim).get("dirt");
+ }
+
+ public static WeightedCollection<Block> getAllRegisteredStoneTypesForDimension(int aDim) {
+ return mMinerLootCache.get(aDim).get("stone");
+ }
+
+ public static final HashMap<Integer, HashMap<String, WeightedCollection<Block>>> getVoidMinerLootCache() {
+ return mMinerLootCache;
+ }
+
+ }
+
+
+ private static class GregtechPlusPlus_API_Internal {
+
+ private static void writeBlockToDimensionInCache(int aDim, int aType, Block aBlock, int aWeight) {
+ HashMap<String, WeightedCollection<Block>> aDimMap = VoidMiner_API.mMinerLootCache.get(aDim);
+ if (aDimMap == null) {
+ aDimMap = new HashMap<String, WeightedCollection<Block>>();
+ }
+ WeightedCollection<Block> aMappedBlocks = getBlockMap(aType, aDimMap);
+ aMappedBlocks.put(aWeight, aBlock);
+
+ }
+
+ private static WeightedCollection<Block> getBlockMap(int aType, HashMap<String, WeightedCollection<Block>> aDimMap){
+ WeightedCollection<Block> aMappedBlocks;
+ String aTypeName = ((aType == 0) ? "ore" : (aType == 1) ? "dirt" : (aType == 2) ? "stone" : "error");
+ aMappedBlocks = aDimMap.get(aTypeName);
+ if (aMappedBlocks == null) {
+ aMappedBlocks = new WeightedCollection<Block>();
+ }
+ return aMappedBlocks;
+ }
+
+ }
+
+
+}
diff --git a/src/Java/gtPlusPlus/api/helpers/MaterialHelper.java b/src/Java/gtPlusPlus/api/helpers/MaterialHelper.java
index 43f8ddeb19..9d2e894d99 100644
--- a/src/Java/gtPlusPlus/api/helpers/MaterialHelper.java
+++ b/src/Java/gtPlusPlus/api/helpers/MaterialHelper.java
@@ -10,6 +10,7 @@ import gregtech.api.enums.OrePrefixes;
import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.core.material.Material;
+import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
@@ -56,4 +57,20 @@ public class MaterialHelper {
}
return false;
}
+
+ public static ItemStack getCells(Materials aMaterial, int i) {
+ return ItemUtils.getOrePrefixStack(OrePrefixes.cell, aMaterial, i);
+ }
+ public static ItemStack getDust(Materials aMaterial, int i) {
+ return ItemUtils.getOrePrefixStack(OrePrefixes.dust, aMaterial, i);
+ }
+ public static ItemStack getDustSmall(Materials aMaterial, int i) {
+ return ItemUtils.getOrePrefixStack(OrePrefixes.dustSmall, aMaterial, i);
+ }
+ public static ItemStack getDustTiny(Materials aMaterial, int i) {
+ return ItemUtils.getOrePrefixStack(OrePrefixes.dustTiny, aMaterial, i);
+ }
+ public static ItemStack getGems(Materials aMaterial, int i) {
+ return ItemUtils.getOrePrefixStack(OrePrefixes.gem, aMaterial, i);
+ }
}
diff --git a/src/Java/gtPlusPlus/api/objects/data/AutoMap.java b/src/Java/gtPlusPlus/api/objects/data/AutoMap.java
index 3583a04a74..02517097cf 100644
--- a/src/Java/gtPlusPlus/api/objects/data/AutoMap.java
+++ b/src/Java/gtPlusPlus/api/objects/data/AutoMap.java
@@ -70,6 +70,20 @@ public class AutoMap<V> implements Iterable<V>, Cloneable, Serializable, Collect
}
}
}
+
+ /**
+ * Generates an AutoMap from a Array.
+ * @param aArray - Data to be inserted into the AutoMap.
+ */
+ public AutoMap(V[] aArray) {
+ mInternalMap = new LinkedHashMap<Integer, V>();
+ mInternalNameMap = new LinkedHashMap<String, Integer>();
+ if (aArray != null && aArray.length > 0) {
+ for (V obj : aArray) {
+ add(obj);
+ }
+ }
+ }
@Override
public Iterator<V> iterator() {
@@ -212,11 +226,12 @@ public class AutoMap<V> implements Iterable<V>, Cloneable, Serializable, Collect
@Override
public boolean retainAll(Collection<?> c) {
- AutoMap<?> aTempAllocation = new AutoMap();
+ AutoMap<?> aTempAllocation = new AutoMap<Object>();
boolean aTrue = false;
aTempAllocation = this;
- aTempAllocation.removeAll(c);
- aTrue = this.removeAll(aTempAllocation);
+ aTempAllocation.removeAll(c);
+ aTempAllocation.clear();
+ aTrue = aTempAllocation.isEmpty();
aTempAllocation.clear();
return aTrue;
}
diff --git a/src/Java/gtPlusPlus/api/objects/data/ConcurrentHashSet.java b/src/Java/gtPlusPlus/api/objects/data/ConcurrentHashSet.java
new file mode 100644
index 0000000000..991908e402
--- /dev/null
+++ b/src/Java/gtPlusPlus/api/objects/data/ConcurrentHashSet.java
@@ -0,0 +1,18 @@
+package gtPlusPlus.api.objects.data;
+
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
+public class ConcurrentHashSet<V> extends ConcurrentSet<V> {
+
+ private static final long serialVersionUID = -1293478938482781728L;
+
+ public ConcurrentHashSet() {
+ this(new ConcurrentHashMap<Integer, V>());
+ }
+
+ public ConcurrentHashSet(ConcurrentMap<Integer, V> defaultMapType) {
+ super(defaultMapType);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/api/objects/data/ConcurrentSet.java b/src/Java/gtPlusPlus/api/objects/data/ConcurrentSet.java
new file mode 100644
index 0000000000..1d3ffc1c01
--- /dev/null
+++ b/src/Java/gtPlusPlus/api/objects/data/ConcurrentSet.java
@@ -0,0 +1,53 @@
+package gtPlusPlus.api.objects.data;
+
+import java.io.Serializable;
+import java.util.AbstractSet;
+import java.util.Iterator;
+import java.util.concurrent.ConcurrentMap;
+
+public abstract class ConcurrentSet<E> extends AbstractSet<E> implements Serializable {
+
+ private static final long serialVersionUID = -6761513279741915432L;
+
+ private final ConcurrentMap<Integer, E> mInternalMap;
+
+ private int mInternalID = 0;
+
+ /**
+ * Creates a new instance which wraps the specified {@code map}.
+ */
+ public ConcurrentSet(ConcurrentMap<Integer, E> aMap) {
+ mInternalMap = aMap;
+ }
+
+ @Override
+ public int size() {
+ return mInternalMap.size();
+ }
+
+ @Override
+ public boolean contains(Object o) {
+ return mInternalMap.containsKey(o);
+ }
+
+ @Override
+ public boolean add(E o) {
+ return mInternalMap.putIfAbsent(mInternalID++, o) == null;
+ }
+
+ @Override
+ public boolean remove(Object o) {
+ return mInternalMap.remove(o) != null;
+ }
+
+ @Override
+ public void clear() {
+ this.mInternalID = 0;
+ mInternalMap.clear();
+ }
+
+ @Override
+ public Iterator<E> iterator() {
+ return mInternalMap.values().iterator();
+ }
+}
diff --git a/src/Java/gtPlusPlus/api/objects/data/FlexiblePair.java b/src/Java/gtPlusPlus/api/objects/data/FlexiblePair.java
new file mode 100644
index 0000000000..64f57b4e5a
--- /dev/null
+++ b/src/Java/gtPlusPlus/api/objects/data/FlexiblePair.java
@@ -0,0 +1,39 @@
+package gtPlusPlus.api.objects.data;
+
+import java.io.Serializable;
+
+import com.google.common.base.Objects;
+
+public class FlexiblePair<K,V> implements Serializable {
+
+ /**
+ * SVUID
+ */
+ private static final long serialVersionUID = 1250550491092812443L;
+ private final K key;
+ private V value;
+
+ public FlexiblePair(final K key, final V value){
+ this.key = key;
+ this.value = value;
+ }
+
+ final public K getKey(){
+ return this.key;
+ }
+
+ final public V getValue(){
+ return this.value;
+ }
+
+ final public void setValue(V aObj) {
+ value = aObj;
+ }
+
+ @Override
+ public int hashCode() {
+ Integer aCode = Objects.hashCode(getKey(), getValue());
+ return aCode != null ? aCode : super.hashCode();
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/api/objects/data/WeightedCollection.java b/src/Java/gtPlusPlus/api/objects/data/WeightedCollection.java
new file mode 100644
index 0000000000..f9966474b0
--- /dev/null
+++ b/src/Java/gtPlusPlus/api/objects/data/WeightedCollection.java
@@ -0,0 +1,102 @@
+package gtPlusPlus.api.objects.data;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.NavigableMap;
+import java.util.Random;
+import java.util.Set;
+import java.util.TreeMap;
+
+import gtPlusPlus.api.objects.random.XSTR;
+
+public class WeightedCollection<E> implements Map<Integer, E> {
+
+ private NavigableMap<Integer, E> map = new TreeMap<Integer, E>();
+ private Random random;
+ private int total = 0;
+
+ public WeightedCollection() {
+ this(new XSTR());
+ }
+
+ public WeightedCollection(Random random) {
+ this.random = random;
+ }
+
+ public E add(int weight, E object) {
+ if (weight <= 0) return null;
+ total += weight;
+ return map.put(total, object);
+ }
+
+ private E next() {
+ int value = random.nextInt(total) + 1; // Can also use floating-point weights
+ return map.ceilingEntry(value).getValue();
+ }
+
+ @Override
+ public int size() {
+ return map.size();
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return map.isEmpty();
+ }
+
+ @Override
+ public boolean containsKey(Object key) {
+ return map.containsKey(key);
+ }
+
+ @Override
+ public boolean containsValue(Object value) {
+ return map.containsValue(value);
+ }
+
+ public E get() {
+ return next();
+ }
+
+ @Override
+ public E get(Object key) {
+ return next();
+ }
+
+ @Override
+ public void putAll(Map m) {
+ map.putAll(m);
+ }
+
+ @Override
+ public void clear() {
+ map.clear();
+ this.total = 0;
+ }
+
+ @Override
+ public Set keySet() {
+ return map.keySet();
+ }
+
+ @Override
+ public Collection values() {
+ return map.values();
+ }
+
+ @Override
+ public Set entrySet() {
+ return map.entrySet();
+ }
+
+ @Override
+ public E put(Integer key, E value) {
+ return add(key, value);
+ }
+
+ @Override
+ public E remove(Object key) {
+ return map.remove(key);
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/BlockPos.java b/src/Java/gtPlusPlus/api/objects/minecraft/BlockPos.java
index 7c11e7232b..ab359c3853 100644
--- a/src/Java/gtPlusPlus/api/objects/minecraft/BlockPos.java
+++ b/src/Java/gtPlusPlus/api/objects/minecraft/BlockPos.java
@@ -19,7 +19,7 @@ public class BlockPos implements Serializable{
public final int yPos;
public final int zPos;
public final int dim;
- public final World world;
+ public final transient World world;
public static BlockPos generateBlockPos(String sUUID) {
String[] s2 = sUUID.split("@");
diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/CubicObject.java b/src/Java/gtPlusPlus/api/objects/minecraft/CubicObject.java
new file mode 100644
index 0000000000..8c76513d09
--- /dev/null
+++ b/src/Java/gtPlusPlus/api/objects/minecraft/CubicObject.java
@@ -0,0 +1,62 @@
+package gtPlusPlus.api.objects.minecraft;
+
+import gtPlusPlus.api.objects.data.AutoMap;
+import net.minecraftforge.common.util.ForgeDirection;
+
+public class CubicObject<T> {
+
+ public final T NORTH;
+ public final T SOUTH;
+
+ public final T WEST;
+ public final T EAST;
+
+ public final T UP;
+ public final T DOWN;
+
+ public CubicObject(AutoMap<T> aDataSet) {
+ this(aDataSet.get(0), aDataSet.get(1), aDataSet.get(2), aDataSet.get(3), aDataSet.get(4), aDataSet.get(5));
+ }
+
+ public CubicObject(T[] aDataSet) {
+ this(aDataSet[0], aDataSet[1], aDataSet[2], aDataSet[3], aDataSet[4], aDataSet[5]);
+ }
+
+ public CubicObject(T aDOWN, T aUP, T aNORTH, T aSOUTH, T aWEST, T aEAST) {
+ DOWN = aDOWN;
+ UP = aUP;
+ NORTH = aNORTH;
+ SOUTH = aSOUTH;
+ WEST = aWEST;
+ EAST = aEAST;
+ }
+
+ public T get(int aSide) {
+ return get(ForgeDirection.getOrientation(aSide));
+ }
+
+ public T get(ForgeDirection aSide) {
+ if (aSide == ForgeDirection.DOWN) {
+ return DOWN;
+ }
+ else if (aSide == ForgeDirection.UP) {
+ return UP;
+ }
+ else if (aSide == ForgeDirection.NORTH) {
+ return NORTH;
+ }
+ else if (aSide == ForgeDirection.SOUTH) {
+ return SOUTH;
+ }
+ else if (aSide == ForgeDirection.WEST) {
+ return WEST;
+ }
+ else if (aSide == ForgeDirection.EAST) {
+ return EAST;
+ }
+ else {
+ return null;
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/FakeBlockPos.java b/src/Java/gtPlusPlus/api/objects/minecraft/FakeBlockPos.java
index d0c1f3f040..d5db8081dc 100644
--- a/src/Java/gtPlusPlus/api/objects/minecraft/FakeBlockPos.java
+++ b/src/Java/gtPlusPlus/api/objects/minecraft/FakeBlockPos.java
@@ -12,7 +12,7 @@ import net.minecraftforge.common.DimensionManager;
public class FakeBlockPos extends BlockPos {
private static final long serialVersionUID = -6442245826092414593L;
- private Block aBlockAtPos;
+ private transient Block aBlockAtPos;
private int aBlockMetaAtPos = 0;
public static FakeBlockPos generateBlockPos(String sUUID) {
diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/SafeTexture.java b/src/Java/gtPlusPlus/api/objects/minecraft/SafeTexture.java
new file mode 100644
index 0000000000..7c418b5a77
--- /dev/null
+++ b/src/Java/gtPlusPlus/api/objects/minecraft/SafeTexture.java
@@ -0,0 +1,64 @@
+package gtPlusPlus.api.objects.minecraft;
+
+import java.util.HashMap;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.GregTech_API;
+import gtPlusPlus.core.util.Utils;
+import net.minecraft.util.IIcon;
+
+/**
+ * A Server Side safe object that can hold {@link IIcon}s.
+ * @author Alkalus
+ *
+ */
+public class SafeTexture implements Runnable {
+
+ @SideOnly(Side.CLIENT)
+ private static final HashMap<Integer, IIcon> mHashToIconCache = new HashMap<Integer, IIcon>();
+
+ @SideOnly(Side.CLIENT)
+ private static final HashMap<String, Integer> mPathToHashCash = new HashMap<String, Integer>();
+
+ private static final HashMap<String, SafeTexture> mTextureObjectCache = new HashMap<String, SafeTexture>();
+
+ private final int mHash;
+
+ private final String mTextureName;
+
+ private final static String getKey(String aTexPath) {
+ String aNameKey = Utils.sanitizeString(aTexPath);
+ aNameKey = aNameKey.replace('/', ' ');
+ aNameKey = aNameKey.toLowerCase();
+ return aNameKey;
+ }
+
+ public static SafeTexture register(String aTexturePath) {
+ String aNameKey = getKey(aTexturePath);
+ SafeTexture g = mTextureObjectCache.get(aNameKey);
+ if (g == null) {
+ g = new SafeTexture(aTexturePath);
+ mTextureObjectCache.put(aNameKey, g);
+ mPathToHashCash.put(aTexturePath, aTexturePath.hashCode());
+ }
+ return g;
+ }
+
+ private SafeTexture(String aTexturePath) {
+ mTextureName = aTexturePath;
+ mHash = getKey(aTexturePath).hashCode();
+ GregTech_API.sGTBlockIconload.add(this);
+ }
+
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon() {
+ return mHashToIconCache.get(mHash);
+ }
+
+ @Override
+ public void run() {
+ mHashToIconCache.put(getKey(mTextureName).hashCode(), GregTech_API.sBlockIcons.registerIcon(mTextureName));
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/ThreadFakeWorldGenerator.java b/src/Java/gtPlusPlus/api/objects/minecraft/ThreadFakeWorldGenerator.java
index 393d3260b5..b7462250b1 100644
--- a/src/Java/gtPlusPlus/api/objects/minecraft/ThreadFakeWorldGenerator.java
+++ b/src/Java/gtPlusPlus/api/objects/minecraft/ThreadFakeWorldGenerator.java
@@ -21,7 +21,7 @@ public class ThreadFakeWorldGenerator extends Thread {
public ThreadFakeWorldGenerator() {
setName("gtpp.handler.fakeworldtrees");
- run();
+ start();
}
public static ThreadFakeWorldGenerator getInstance() {
diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/ThreadPooCollector.java b/src/Java/gtPlusPlus/api/objects/minecraft/ThreadPooCollector.java
index a5f466b19f..0ff6e112ac 100644
--- a/src/Java/gtPlusPlus/api/objects/minecraft/ThreadPooCollector.java
+++ b/src/Java/gtPlusPlus/api/objects/minecraft/ThreadPooCollector.java
@@ -33,7 +33,7 @@ public class ThreadPooCollector extends Thread {
public ThreadPooCollector() {
setName("gtpp.handler.poop");
- run();
+ start();
}
public static ThreadPooCollector getInstance() {
diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/multi/NoOutputBonusMultiBehaviour.java b/src/Java/gtPlusPlus/api/objects/minecraft/multi/NoOutputBonusMultiBehaviour.java
new file mode 100644
index 0000000000..4dc032d01f
--- /dev/null
+++ b/src/Java/gtPlusPlus/api/objects/minecraft/multi/NoOutputBonusMultiBehaviour.java
@@ -0,0 +1,27 @@
+package gtPlusPlus.api.objects.minecraft.multi;
+
+import gtPlusPlus.core.recipe.common.CI;
+import net.minecraft.item.ItemStack;
+
+public class NoOutputBonusMultiBehaviour extends SpecialMultiBehaviour {
+
+ public NoOutputBonusMultiBehaviour() {
+ // Used by other mods which may wish to not obtain bonus outputs on their Sifting or Maceration recipes.
+ }
+
+ @Override
+ public ItemStack getTriggerItem() {
+ return CI.getNumberedBioCircuit(22);
+ }
+
+ @Override
+ public String getTriggerItemTooltip() {
+ return "Prevents bonus output % on GT++ multiblocks when used";
+ }
+
+ @Override
+ public int getOutputChanceRoll() {
+ return 10000;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/multi/SpecialMultiBehaviour.java b/src/Java/gtPlusPlus/api/objects/minecraft/multi/SpecialMultiBehaviour.java
new file mode 100644
index 0000000000..e562ccc40b
--- /dev/null
+++ b/src/Java/gtPlusPlus/api/objects/minecraft/multi/SpecialMultiBehaviour.java
@@ -0,0 +1,44 @@
+package gtPlusPlus.api.objects.minecraft.multi;
+
+import gregtech.api.util.GT_Utility;
+import net.minecraft.item.ItemStack;
+
+/**
+ * Extend this class to implement custom behaviour for multiblocks.
+ * The Trigger item when in a special slot or input bus, will cause the multiblock to behave as specified.
+ * Not overriding a method here will cause the default values to be used.
+ * @author Alkalus
+ *
+ */
+public abstract class SpecialMultiBehaviour {
+
+ private final int mMaxParallelRecipes = Short.MIN_VALUE;
+ private final int mEUPercent = Short.MIN_VALUE;
+ private final int mSpeedBonusPercent = Short.MIN_VALUE;
+ private final int mOutputChanceRoll = Short.MIN_VALUE;
+
+ public abstract ItemStack getTriggerItem();
+
+ public abstract String getTriggerItemTooltip();
+
+ public int getMaxParallelRecipes() {
+ return this.mMaxParallelRecipes;
+ }
+
+ public int getEUPercent() {
+ return this.mEUPercent;
+ }
+
+ public int getSpeedBonusPercent() {
+ return this.mSpeedBonusPercent;
+ }
+
+ public int getOutputChanceRoll() {
+ return this.mOutputChanceRoll;
+ }
+
+ public final boolean isTriggerItem(ItemStack aToMatch) {
+ return GT_Utility.areStacksEqual(getTriggerItem(), aToMatch, false);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/api/objects/random/XSTR.java b/src/Java/gtPlusPlus/api/objects/random/XSTR.java
index 4b5b1298b6..6ce1cbeb6c 100644
--- a/src/Java/gtPlusPlus/api/objects/random/XSTR.java
+++ b/src/Java/gtPlusPlus/api/objects/random/XSTR.java
@@ -33,7 +33,7 @@ import java.util.concurrent.atomic.AtomicLong;
* 03.06.2016
* version 0.0.4
*/
-public class XSTR extends Random {
+public class XSTR extends Random implements Cloneable {
private static final long serialVersionUID = 6208727693524452904L;
private long seed;
@@ -115,6 +115,13 @@ public class XSTR extends Random {
*/
@Override
public XSTR clone() {
+ try {
+ super.clone();
+ }
+ catch (CloneNotSupportedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
return new XSTR(this.getSeed());
}
diff --git a/src/Java/gtPlusPlus/australia/GTplusplus_Australia.java b/src/Java/gtPlusPlus/australia/GTplusplus_Australia.java
index 562f6acd15..77562f5691 100644
--- a/src/Java/gtPlusPlus/australia/GTplusplus_Australia.java
+++ b/src/Java/gtPlusPlus/australia/GTplusplus_Australia.java
@@ -6,13 +6,13 @@ import java.io.File;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
-import cpw.mods.fml.common.event.*;
+import cpw.mods.fml.common.event.FMLInitializationEvent;
+import cpw.mods.fml.common.event.FMLPostInitializationEvent;
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin.MCVersion;
-
import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.australia.biome.type.Biome_AustralianDesert;
-import gtPlusPlus.australia.biome.type.Biome_AustralianDesert2;
import gtPlusPlus.australia.biome.type.Biome_AustralianDesert_Ex;
import gtPlusPlus.australia.biome.type.Biome_AustralianForest;
import gtPlusPlus.australia.biome.type.Biome_AustralianOcean;
diff --git a/src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianPlains.java b/src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianPlains.java
index 4ee24aaca5..c04f211fd3 100644
--- a/src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianPlains.java
+++ b/src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianPlains.java
@@ -16,7 +16,6 @@ import net.minecraftforge.common.BiomeManager;
public class Biome_AustralianPlains extends BiomeGenPlains
{
- protected boolean field_150628_aC;
public Biome_AustralianPlains(int p_i1986_1_)
{
diff --git a/src/Java/gtPlusPlus/australia/chunk/ChunkProviderAustralia.java b/src/Java/gtPlusPlus/australia/chunk/ChunkProviderAustralia.java
index 82da02db45..07f5f969e2 100644
--- a/src/Java/gtPlusPlus/australia/chunk/ChunkProviderAustralia.java
+++ b/src/Java/gtPlusPlus/australia/chunk/ChunkProviderAustralia.java
@@ -9,26 +9,29 @@ import java.util.Map;
import java.util.Random;
import cpw.mods.fml.common.eventhandler.Event.Result;
-import cpw.mods.fml.common.registry.VillagerRegistry;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.australia.gen.map.MapGenLargeRavine;
import net.minecraft.block.Block;
-import net.minecraft.block.BlockFalling;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.init.Blocks;
import net.minecraft.util.IProgressUpdate;
import net.minecraft.util.MathHelper;
-import net.minecraft.world.*;
+import net.minecraft.world.ChunkPosition;
+import net.minecraft.world.SpawnerAnimals;
+import net.minecraft.world.World;
+import net.minecraft.world.WorldType;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.IChunkProvider;
-import net.minecraft.world.gen.*;
+import net.minecraft.world.gen.ChunkProviderGenerate;
+import net.minecraft.world.gen.MapGenBase;
+import net.minecraft.world.gen.MapGenCaves;
+import net.minecraft.world.gen.NoiseGenerator;
+import net.minecraft.world.gen.NoiseGeneratorOctaves;
+import net.minecraft.world.gen.NoiseGeneratorPerlin;
import net.minecraft.world.gen.feature.WorldGenDungeons;
-import net.minecraft.world.gen.feature.WorldGenLakes;
import net.minecraft.world.gen.structure.MapGenMineshaft;
import net.minecraft.world.gen.structure.MapGenScatteredFeature;
-import net.minecraft.world.gen.structure.MapGenVillage;
-
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.terraingen.ChunkProviderEvent;
import net.minecraftforge.event.terraingen.PopulateChunkEvent;
@@ -40,16 +43,6 @@ public class ChunkProviderAustralia extends ChunkProviderGenerate implements ICh
private NoiseGeneratorOctaves noiseGen2;
private NoiseGeneratorOctaves noiseGen3;
private NoiseGeneratorPerlin noiseGen4;
-
- /**
- * A NoiseGeneratorOctaves used in generating terrain
- */
- public NoiseGeneratorOctaves noiseGen5;
- /**
- * A NoiseGeneratorOctaves used in generating terrain
- */
- public NoiseGeneratorOctaves noiseGen6;
- public NoiseGeneratorOctaves mobSpawnerNoise;
/**
* Reference to the World object.
*/
diff --git a/src/Java/gtPlusPlus/australia/gen/map/component/ComponentHut.java b/src/Java/gtPlusPlus/australia/gen/map/component/ComponentHut.java
index 4af5aa09ab..1f5dd59667 100644
--- a/src/Java/gtPlusPlus/australia/gen/map/component/ComponentHut.java
+++ b/src/Java/gtPlusPlus/australia/gen/map/component/ComponentHut.java
@@ -79,11 +79,11 @@ public class ComponentHut extends AustraliaComponent {
placeDoorAtCurrentPosition(
world, this.boundingBox, random, 0, 1, 3, getMetadataWithOffset(Blocks.wooden_door, 1));
}
- else if (dir == 0) {
+ else if (dir == 1) {
placeDoorAtCurrentPosition(
world, this.boundingBox, random, 3, 1, 6, getMetadataWithOffset(Blocks.wooden_door, 1));
}
- else if (dir == 0) {
+ else if (dir == 2) {
placeDoorAtCurrentPosition(
world, this.boundingBox, random, 6, 1, 3, getMetadataWithOffset(Blocks.wooden_door, 1));
}
diff --git a/src/Java/gtPlusPlus/core/block/ModBlocks.java b/src/Java/gtPlusPlus/core/block/ModBlocks.java
index b59facf9e2..a448e313ac 100644
--- a/src/Java/gtPlusPlus/core/block/ModBlocks.java
+++ b/src/Java/gtPlusPlus/core/block/ModBlocks.java
@@ -21,6 +21,7 @@ import gtPlusPlus.core.block.machine.Machine_ModularityTable;
import gtPlusPlus.core.block.machine.Machine_PestKiller;
import gtPlusPlus.core.block.machine.Machine_PooCollector;
import gtPlusPlus.core.block.machine.Machine_ProjectTable;
+import gtPlusPlus.core.block.machine.Machine_RoundRobinator;
import gtPlusPlus.core.block.machine.Machine_SuperJukebox;
import gtPlusPlus.core.block.machine.Machine_TradeTable;
import gtPlusPlus.core.block.machine.Machine_Workbench;
@@ -34,6 +35,7 @@ import net.minecraftforge.fluids.Fluid;
public final class ModBlocks {
+ public static Block blockRoundRobinator;
public static Block blockCircuitProgrammer;
public static Block blockFakeMiningPipe;
public static Block blockFakeMiningHead;
@@ -147,6 +149,8 @@ public final class ModBlocks {
blockPooCollector = new Machine_PooCollector();
blockPestKiller = new Machine_PestKiller();
+
+ blockRoundRobinator = new Machine_RoundRobinator();
new BlockGenericRedstoneDetector();
new BlockGenericRedstoneTest();
diff --git a/src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java b/src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java
new file mode 100644
index 0000000000..6166835f31
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java
@@ -0,0 +1,315 @@
+package gtPlusPlus.core.block.base;
+
+import java.util.List;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gtPlusPlus.api.interfaces.ITileTooltip;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.api.objects.minecraft.CubicObject;
+import gtPlusPlus.api.objects.minecraft.SafeTexture;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.minecraft.InventoryUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockContainer;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.EnumCreatureType;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemBlock;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+
+public abstract class BasicTileBlockWithTooltip extends BlockContainer implements ITileTooltip {
+
+ /**
+ * Each mapped object holds the data for the six sides.
+ */
+ @SideOnly(Side.CLIENT)
+ private AutoMap<CubicObject<SafeTexture>> mSidedTextureArray;
+
+ /**
+ * Holds the data for the six sides, each side holds an array of data for each respective meta.
+ */
+ @SideOnly(Side.CLIENT)
+ private AutoMap<CubicObject<String>> mSidedTexturePathArray;
+
+ /**
+ * Does this block have any meta at all?
+ * @return
+ */
+ public final boolean hasMeta() {
+ return getMetaCount() > 0;
+ }
+
+ /**
+ * The amount of meta this block has.
+ * @return
+ */
+ public abstract int getMetaCount();
+
+ /**
+ * Does this {@link Block} require special {@link ItemBlock} handling?
+ * @return The {@link Class} that will be used for this {@link Block}.
+ */
+ public Class<? extends ItemBlock> getItemBlockClass() {
+ return ItemBlock.class;
+ }
+
+ /**
+ * A lazy way to declare the unlocal name for the block, makes boilerplating easy.
+ * @return The internal name for this block.
+ */
+ public abstract String getUnlocalBlockName();
+
+ /**
+ * Does this Block have {@link ITileTooltip} support?
+ * @return {@link boolean} that represents if this block supports {@link ITileTooltip} or not.
+ */
+ public final boolean hasTooltip() {
+ return getTooltipID() >= -1;
+ }
+
+ /**
+ * Lazy Boilerplating.
+ * @return Block Hardness.
+ */
+ protected abstract float initBlockHardness();
+
+ /**
+ * Lazy Boilerplating.
+ * @return Block Resistance.
+ */
+ protected abstract float initBlockResistance();
+
+ /**
+ * Lazy Boilerplating.
+ * @return The {@link CreativeTab} this Block is shown on.
+ */
+ protected abstract CreativeTabs initCreativeTab();
+
+ /**
+ * The ID used by the {@link ITileTooltip} handler. Return -1 if you are not providing a custom {@link ItemBlock} in {@link #getItemBlockClass}().
+ * @return
+ */
+ @Override
+ public abstract int getTooltipID();
+
+ public BasicTileBlockWithTooltip(Material aBlockMat){
+ super(aBlockMat);
+ //Use Abstract method values
+ this.setHardness(initBlockHardness());
+ this.setResistance(initBlockResistance());
+ this.setBlockName(getUnlocalBlockName());
+ this.setCreativeTab(initCreativeTab());
+ // Register the block last.
+ GameRegistry.registerBlock(this, getItemBlockClass(), getUnlocalBlockName());
+ Logger.INFO("Registered "+getTileEntityName()+".");
+ if (Utils.isClient()) {
+ // Handle Textures
+ handleTextures();
+ }
+ }
+
+ /**
+ * The name of the Tile Entity.
+ * @return
+ */
+ protected abstract String getTileEntityName();
+
+ /**
+ * The String used for texture pathing.
+ * @return Sanitized {@link String}, containing no spaces or illegal characters.
+ */
+ private final String getTileEntityNameForTexturePathing() {
+ return Utils.sanitizeString(getTileEntityName().replace(" ", ""));
+ }
+
+ /**
+ * An array of CubicObjects, one for each meta, else just a single cell array.
+ * Expected to be null regularly, as the default texture handling should suffice.
+ * Handy if re-using textures or using a non-standard structure for them. FULL texture path must be used,
+ * inclusive of the MODID and a colon.
+ * @return
+ */
+ public CubicObject<String>[] getCustomTextureDirectoryObject(){
+ return null;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public final IIcon getIcon(final int aSide, final int aMeta) {
+ return mSidedTextureArray.get(aMeta).get(aSide).getIcon();
+ }
+
+ @Override
+ public IIcon getIcon(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) {
+ return super.getIcon(aWorld, aX, aY, aZ, aSide);
+ }
+
+ @SideOnly(Side.CLIENT)
+ private final void handleTextures() {
+
+ Logger.INFO("[TeTexture] Building Texture Maps for "+getTileEntityName()+".");
+
+ // Init on the Client side only, to prevent Field initialisers existing in the Server side bytecode.
+ mSidedTextureArray = new AutoMap<CubicObject<SafeTexture>>();
+ mSidedTexturePathArray = new AutoMap<CubicObject<String>>();
+
+
+ //Store them in forge order
+ //DOWN, UP, NORTH, SOUTH, WEST, EAST
+
+ // Default Path Name, this will make us look inside 'miscutils\textures\blocks'
+ final String aPrefixTexPath = CORE.MODID + ":";
+ // Default Path Name, this will make us look in the sub-directory for this Tile Entity.
+ final String aTexPathMid = "TileEntities"+CORE.SEPERATOR+getTileEntityNameForTexturePathing()+CORE.SEPERATOR;
+ // Construct a full path
+ String aTexPathBuilt = aPrefixTexPath + aTexPathMid;
+ // File Name Suffixes, without meta tags
+ String aStringBot;
+ String aStringTop;
+ String aStringBack;
+ String aStringFront;
+ String aStringLeft;
+ String aStringRight;
+ // Do we provide a matrix of custom data to be used for texture processing instead?
+ if (getCustomTextureDirectoryObject() != null) {
+ // Get custom provided texture data.
+ CubicObject<String>[] aDataMap = getCustomTextureDirectoryObject();
+ Logger.INFO("[TeTexture] Found custom texture data, using this instead. Size: "+aDataMap.length);
+ // Map each meta string data to the main map.
+ for (int i=0;i<aDataMap.length;i++) {
+ mSidedTexturePathArray.put(aDataMap[i]);
+ Logger.INFO("Mapped value for meta "+i+".");
+ }
+ }
+ else {
+ Logger.INFO("[TeTexture] Processing "+(1+getMetaCount())+" sets.");
+ // Iterate once for each meta
+ for (int i=0;i<(1+getMetaCount());i++) {
+
+ // File Name Suffixes, without meta tags
+ aStringBot = "Bottom";
+ aStringTop = "Top";
+ aStringBack = "Back";
+ aStringFront = "Front";
+ aStringLeft = "Left";
+ aStringRight = "Right";
+
+ // Add tails if we have meta
+ if (hasMeta()) {
+ aStringBot = aStringBot + "_"+i;
+ aStringTop = aStringTop + "_"+i;
+ aStringBack = aStringBack + "_"+i;
+ aStringFront = aStringFront + "_"+i;
+ aStringLeft = aStringLeft + "_"+i;
+ aStringRight = aStringRight + "_"+i;
+ }
+ // Append the full path
+ aStringBot = aTexPathBuilt + aStringBot;
+ aStringTop = aTexPathBuilt + aStringTop;
+ aStringBack = aTexPathBuilt + aStringBack;
+ aStringFront = aTexPathBuilt + aStringFront;
+ aStringLeft = aTexPathBuilt + aStringLeft;
+ aStringRight = aTexPathBuilt + aStringRight;
+ // Convenience Blob
+ CubicObject<String> aMetaBlob = new CubicObject<String>(aStringBot, aStringTop, aStringBack, aStringFront, aStringLeft, aStringRight);
+ mSidedTexturePathArray.put(aMetaBlob);
+ Logger.INFO("[TeTexture] Added Texture Path data to map for meta "+i);
+ }
+ }
+ Logger.INFO("[TeTexture] Map size for pathing: "+mSidedTexturePathArray.size());
+
+ // Iteration Index
+ int aIndex = 0;
+
+ // Iterate each CubicObject, holding the six texture paths for each meta.
+ for (CubicObject<String> aMetaBlob : mSidedTexturePathArray) {
+ // Make a Safe Texture for each side
+ SafeTexture aBottom = SafeTexture.register(aMetaBlob.DOWN);
+ SafeTexture aTop = SafeTexture.register(aMetaBlob.UP);
+ SafeTexture aBack = SafeTexture.register(aMetaBlob.NORTH);
+ SafeTexture aFont = SafeTexture.register(aMetaBlob.SOUTH);
+ SafeTexture aWest = SafeTexture.register(aMetaBlob.WEST);
+ SafeTexture aEast = SafeTexture.register(aMetaBlob.EAST);
+ // Store them in an Array
+ SafeTexture[] aInjectBlob = new SafeTexture[] {
+ aBottom,
+ aTop,
+ aBack,
+ aFont,
+ aWest,
+ aEast
+ };
+ // Convenience Blob
+ CubicObject<SafeTexture> aMetaBlob2 = new CubicObject<SafeTexture>(aInjectBlob);
+ // Store this Blob into
+ mSidedTextureArray.put(aMetaBlob2);
+ Logger.INFO("[TeTexture] Added SafeTexture data to map for meta "+(aIndex++));
+ }
+ Logger.INFO("[TeTexture] Map size for registration: "+mSidedTextureArray.size());
+
+
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public final void registerBlockIcons(final IIconRegister aRegisterer){
+ this.blockIcon = aRegisterer.registerIcon(CORE.MODID + ":" + "net");
+ }
+
+ @Override
+ public abstract TileEntity createNewTileEntity(final World world, final int p_149915_2_);
+
+ /**
+ * Called when {@link #breakBlock}() is called, but before {@link InventoryUtils#dropInventoryItems} and the super call.
+ */
+ public void onBlockBreak() {
+
+ }
+
+ @Override
+ public final void breakBlock(final World world, final int x, final int y, final int z, final Block block, final int number) {
+ onBlockBreak();
+ InventoryUtils.dropInventoryItems(world, x, y, z, block);
+ super.breakBlock(world, x, y, z, block, number);
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ @Override
+ public final void getSubBlocks(Item aItem, CreativeTabs p_149666_2_, List aList) {
+ if (hasMeta()) {
+ for (int i=0;i<getMetaCount();i++) {
+ aList.add(ItemUtils.simpleMetaStack(aItem, i, 1));
+ }
+ }
+ else {
+ aList.add(ItemUtils.getSimpleStack(aItem));
+ }
+ }
+
+ @Override
+ public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
+ return false;
+ }
+
+
+
+ /**
+ * Get the block's damage value (for use with pick block).
+ */
+ @Override
+ public int getDamageValue(World aWorld, int aX, int aY, int aZ) {
+ int l = aWorld.getBlockMetadata(aX, aY, aZ);
+ return l;
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java b/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java
index 8310fa3c23..c0113e869b 100644
--- a/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java
+++ b/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java
@@ -175,7 +175,7 @@ public class BlockBaseModular extends BasicBlock {
}
}
metType = (metType.equals("9j4852jyo3rjmh3owlhw9oe") ? "METALLIC" : metType);
- int tier = this.blockMaterial.vTier;
+ int tier = blockMaterial != null ? this.blockMaterial.vTier : 0;
String aType = (this.thisBlock == BlockTypes.FRAME) ? "frameGt" : (tier <= 4 ? "block1" : "block5");
this.blockIcon = iIcon.registerIcon("gregtech" + ":" + "materialicons/"+ metType +"/" + aType);
}
diff --git a/src/Java/gtPlusPlus/core/block/general/MiningExplosives.java b/src/Java/gtPlusPlus/core/block/general/MiningExplosives.java
index 45345ef176..8925962e4e 100644
--- a/src/Java/gtPlusPlus/core/block/general/MiningExplosives.java
+++ b/src/Java/gtPlusPlus/core/block/general/MiningExplosives.java
@@ -165,8 +165,8 @@ public class MiningExplosives extends BlockTNT {
/*this.blockIcon = iconRegister.registerIcon(this.getTextureName() + "_side");
this.textureTop = iconRegister.registerIcon(this.getTextureName() + "_top");
this.textureBottom = iconRegister.registerIcon(this.getTextureName() + "_bottom");*/
- this.blockIcon = iconRegister.registerIcon(CORE.MODID + ":" + "Chrono/" + "MetalSheet2");
- this.textureTop = iconRegister.registerIcon(CORE.MODID + ":" + "Chrono/" + "MetalFunnel");
- this.textureBottom = iconRegister.registerIcon(CORE.MODID + ":" + "Chrono/" + "MetalPanel");
+ this.blockIcon = iconRegister.registerIcon(CORE.MODID + ":" + "chrono/" + "MetalSheet2");
+ this.textureTop = iconRegister.registerIcon(CORE.MODID + ":" + "chrono/" + "MetalFunnel");
+ this.textureBottom = iconRegister.registerIcon(CORE.MODID + ":" + "chrono/" + "MetalPanel");
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/machine/CircuitProgrammer.java b/src/Java/gtPlusPlus/core/block/machine/CircuitProgrammer.java
index 6ae1a52aba..7d8b3eb708 100644
--- a/src/Java/gtPlusPlus/core/block/machine/CircuitProgrammer.java
+++ b/src/Java/gtPlusPlus/core/block/machine/CircuitProgrammer.java
@@ -1,42 +1,27 @@
package gtPlusPlus.core.block.machine;
-import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockContainer;
+import gtPlusPlus.GTplusplus;
+import gtPlusPlus.api.objects.minecraft.CubicObject;
+import gtPlusPlus.core.block.base.BasicTileBlockWithTooltip;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.handler.GuiHandler;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.tileentities.general.TileEntityCircuitProgrammer;
+import gtPlusPlus.core.util.minecraft.PlayerUtils;
import net.minecraft.block.material.Material;
-import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-import gtPlusPlus.GTplusplus;
-import gtPlusPlus.api.interfaces.ITileTooltip;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.handler.GuiHandler;
-import gtPlusPlus.core.item.base.itemblock.ItemBlockBasicTile;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.tileentities.general.TileEntityCircuitProgrammer;
-import gtPlusPlus.core.util.minecraft.InventoryUtils;
-import gtPlusPlus.core.util.minecraft.PlayerUtils;
-
-public class CircuitProgrammer extends BlockContainer implements ITileTooltip
-{
- @SideOnly(Side.CLIENT)
- private IIcon textureTop;
- @SideOnly(Side.CLIENT)
- private IIcon textureBottom;
- @SideOnly(Side.CLIENT)
- private IIcon textureFront;
+public class CircuitProgrammer extends BasicTileBlockWithTooltip {
/**
* Determines which tooltip is displayed within the itemblock.
@@ -51,33 +36,7 @@ public class CircuitProgrammer extends BlockContainer implements ITileTooltip
@SuppressWarnings("deprecation")
public CircuitProgrammer(){
super(Material.iron);
- this.setHardness(5f);
- this.setResistance(1f);
- this.setBlockName("blockCircuitProgrammer");
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockCircuitProgrammer");
LanguageRegistry.addName(this, "Circuit Programmer");
-
- }
-
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int p_149691_1_, final int p_149691_2_)
- {
- return p_149691_1_ == 1 ? this.textureTop : (p_149691_1_ == 0 ? this.textureBottom : (this.textureFront));
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister p_149651_1_)
- {
- this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "metro/" + "TEXTURE_TECH_PANEL_B");
- this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "metro/" + "TEXTURE_TECH_PANEL_B");
- this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_G");
- this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I");
}
/**
@@ -142,12 +101,6 @@ public class CircuitProgrammer extends BlockContainer implements ITileTooltip
}
@Override
- public void breakBlock(final World world, final int x, final int y, final int z, final Block block, final int number) {
- InventoryUtils.dropInventoryItems(world, x, y, z, block);
- super.breakBlock(world, x, y, z, block, number);
- }
-
- @Override
public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, final ItemStack stack) {
if (stack.hasDisplayName()) {
((TileEntityCircuitProgrammer) world.getTileEntity(x,y,z)).setCustomName(stack.getDisplayName());
@@ -159,4 +112,48 @@ public class CircuitProgrammer extends BlockContainer implements ITileTooltip
return false;
}
+ @Override
+ public int getMetaCount() {
+ return 0;
+ }
+
+ @Override
+ public String getUnlocalBlockName() {
+ return "blockCircuitProgrammer";
+ }
+
+ @Override
+ protected float initBlockHardness() {
+ return 5f;
+ }
+
+ @Override
+ protected float initBlockResistance() {
+ return 1f;
+ }
+
+ @Override
+ protected CreativeTabs initCreativeTab() {
+ return AddToCreativeTab.tabMachines;
+ }
+
+ @Override
+ protected String getTileEntityName() {
+ return "Circuit Programmer";
+ }
+
+ @Override
+ public CubicObject<String>[] getCustomTextureDirectoryObject() {
+ String[] aTexData = new String[] {
+ CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_G",
+ CORE.MODID + ":" + "metro/" + "TEXTURE_TECH_PANEL_B",
+ CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I",
+ CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I",
+ CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I",
+ CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I"
+ };
+ CubicObject<String>[] aTextureData = new CubicObject[] {new CubicObject<String>(aTexData)};
+ return aTextureData;
+ }
+
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java b/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java
new file mode 100644
index 0000000000..dc87b885b9
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java
@@ -0,0 +1,131 @@
+package gtPlusPlus.core.block.machine;
+
+import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.api.objects.minecraft.CubicObject;
+import gtPlusPlus.core.block.base.BasicTileBlockWithTooltip;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.item.base.itemblock.ItemBlockRoundRobinator;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import net.minecraft.block.material.Material;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemBlock;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
+
+public class Machine_RoundRobinator extends BasicTileBlockWithTooltip {
+
+
+ public Machine_RoundRobinator(){
+ super(Material.iron);
+ }
+
+ /**
+ * Called upon block activation (right click on the block.)
+ */
+ @Override
+ public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float lx, final float ly, final float lz)
+ {
+ if (world.isRemote) {
+ return true;
+ }
+ else {
+
+ boolean mDidScrewDriver = false;
+ // Check For Screwdriver
+ try {
+ final ItemStack mHandStack = PlayerUtils.getItemStackInPlayersHand(world, player.getDisplayName());
+ if (ItemUtils.isToolScrewdriver(mHandStack)) {
+ final TileEntityRoundRobinator tile = (TileEntityRoundRobinator) world.getTileEntity(x, y, z);
+ if (tile != null) {
+ mDidScrewDriver = tile.onScrewdriverRightClick((byte) side, player, x, y, z);
+ }
+ }
+ }
+ catch (final Throwable t) {}
+
+ if (!mDidScrewDriver) {
+ final TileEntity te = world.getTileEntity(x, y, z);
+ if ((te != null) && (te instanceof TileEntityRoundRobinator)){
+ return ((TileEntityRoundRobinator) te).onRightClick((byte) side, player, x, y, z);
+ }
+ return false;
+ }
+ else {
+ return true;
+ }
+ }
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
+ return new TileEntityRoundRobinator();
+ }
+
+ @Override
+ public int getMetaCount() {
+ return 5;
+ }
+
+ @Override
+ public String getUnlocalBlockName() {
+ return "blockRoundRobinator";
+ }
+
+ @Override
+ protected float initBlockHardness() {
+ return 1;
+ }
+
+ @Override
+ protected float initBlockResistance() {
+ return 1;
+ }
+
+ @Override
+ protected CreativeTabs initCreativeTab() {
+ return AddToCreativeTab.tabMachines;
+ }
+
+ @Override
+ public int getTooltipID() {
+ return -1;
+ }
+
+ @Override
+ protected String getTileEntityName() {
+ return "Round Robinator";
+ }
+
+ @Override
+ public Class<? extends ItemBlock> getItemBlockClass() {
+ return ItemBlockRoundRobinator.class;
+ }
+
+ @Override
+ public CubicObject<String>[] getCustomTextureDirectoryObject() {
+ AutoMap<String[]> aTemp = new AutoMap<String[]>();
+ for (int i=0;i<5;i++) {
+ String[] aTexData = new String[] {
+ CORE.MODID + ":" + "TileEntities/RoundRobinator/Top_"+i,
+ CORE.MODID + ":" + "TileEntities/RoundRobinator/Top_"+i,
+ CORE.MODID + ":" + "TileEntities/RoundRobinator/Side_"+i,
+ CORE.MODID + ":" + "TileEntities/RoundRobinator/Side_"+i,
+ CORE.MODID + ":" + "TileEntities/RoundRobinator/Side_"+i,
+ CORE.MODID + ":" + "TileEntities/RoundRobinator/Side_"+i,
+ };
+ aTemp.put(aTexData);
+ }
+ AutoMap<CubicObject<String>> aTemp2 = new AutoMap<CubicObject<String>>();
+ for (String[] y : aTemp) {
+ aTemp2.put(new CubicObject<String>(y));
+ }
+ CubicObject<String>[] aTextureData = new CubicObject[] {aTemp2.get(0), aTemp2.get(1), aTemp2.get(2), aTemp2.get(3), aTemp2.get(4)};
+ return aTextureData;
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/common/BasePlayer.java b/src/Java/gtPlusPlus/core/common/BasePlayer.java
index d60925102a..4686f34207 100644
--- a/src/Java/gtPlusPlus/core/common/BasePlayer.java
+++ b/src/Java/gtPlusPlus/core/common/BasePlayer.java
@@ -1,19 +1,14 @@
package gtPlusPlus.core.common;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.audio.PositionedSoundRecord;
-import net.minecraft.client.entity.EntityClientPlayerMP;
-import net.minecraft.client.gui.GuiScreen;
-import net.minecraft.client.settings.GameSettings;
-import net.minecraft.network.play.client.C0BPacketEntityAction;
-import net.minecraft.potion.Potion;
-import net.minecraft.util.MovementInputFromOptions;
-import net.minecraft.util.ResourceLocation;
-
import api.player.client.ClientPlayerAPI;
import api.player.client.ClientPlayerBase;
import gtPlusPlus.core.handler.events.CustomMovementHandler;
import gtPlusPlus.core.handler.events.SneakManager;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.settings.GameSettings;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.potion.Potion;
+import net.minecraft.util.MovementInputFromOptions;
public class BasePlayer extends ClientPlayerBase
{
@@ -30,8 +25,17 @@ public class BasePlayer extends ClientPlayerBase
* EntityPlayerSP.onLivingUpdate() - Adapted to PlayerAPI
*/
@Override
- public void onLivingUpdate()
- {
+ public void onLivingUpdate() {
+
+ super.onLivingUpdate();
+ EntityPlayer aPlayer = this.player;
+ if (aPlayer != null) {
+ SneakManager aSneak = SneakManager.get(aPlayer);
+ if (!aSneak.isWearingRing()) {
+ return;
+ }
+ }
+
if(this.player.sprintingTicksLeft > 0)
{
--this.player.sprintingTicksLeft;
@@ -57,54 +61,9 @@ public class BasePlayer extends ClientPlayerBase
}
else
{
- this.player.prevTimeInPortal = this.player.timeInPortal;
- if(this.playerAPI.getInPortalField())
- {
- if(this.mc.currentScreen != null)
- {
- this.mc.displayGuiScreen((GuiScreen)null);
- }
-
- if(this.player.timeInPortal == 0.0F)
- {
- this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("portal.trigger"), (this.player.getRNG().nextFloat() * 0.4F) + 0.8F));
- }
-
- this.player.timeInPortal += 0.0125F;
-
- if(this.player.timeInPortal >= 1.0F)
- {
- this.player.timeInPortal = 1.0F;
- }
-
- this.playerAPI.setInPortalField(false);
- }
- else if(this.player.isPotionActive(Potion.confusion) && (this.player.getActivePotionEffect(Potion.confusion).getDuration() > 60))
- {
- this.player.timeInPortal += 0.006666667F;
- if(this.player.timeInPortal > 1.0F)
- {
- this.player.timeInPortal = 1.0F;
- }
- }
- else
- {
- if(this.player.timeInPortal > 0.0F)
- {
- this.player.timeInPortal -= 0.05F;
- }
-
- if(this.player.timeInPortal < 0.0F)
- {
- this.player.timeInPortal = 0.0F;
- }
- }
- if(this.player.timeUntilPortal > 0)
- {
- --this.player.timeUntilPortal;
- }
+
final boolean isJumping = this.player.movementInput.jump;
@@ -112,23 +71,6 @@ public class BasePlayer extends ClientPlayerBase
final boolean isMovingForward = this.player.movementInput.moveForward >= minSpeed;
this.customMovementInput.update(this.mc, (MovementInputFromOptions)this.player.movementInput, this.player);
- if(this.player.isUsingItem() && !this.player.isRiding())
- {
- this.player.movementInput.moveStrafe *= 0.2F;
- this.player.movementInput.moveForward *= 0.2F;
- this.playerAPI.setSprintToggleTimerField(0);
- }
-
- if(this.player.movementInput.sneak && (this.player.ySize < 0.2F))
- {
- this.player.ySize = 0.2F;
- }
-
- this.playerAPI.localPushOutOfBlocks(this.player.posX - (this.player.width * 0.35D), this.player.boundingBox.minY + 0.5D, this.player.posZ + (this.player.width * 0.35D));
- this.playerAPI.localPushOutOfBlocks(this.player.posX - (this.player.width * 0.35D), this.player.boundingBox.minY + 0.5D, this.player.posZ - (this.player.width * 0.35D));
- this.playerAPI.localPushOutOfBlocks(this.player.posX + (this.player.width * 0.35D), this.player.boundingBox.minY + 0.5D, this.player.posZ - (this.player.width * 0.35D));
- this.playerAPI.localPushOutOfBlocks(this.player.posX + (this.player.width * 0.35D), this.player.boundingBox.minY + 0.5D, this.player.posZ + (this.player.width * 0.35D));
- final boolean enoughHunger = (this.player.getFoodStats().getFoodLevel() > 6.0F) || this.player.capabilities.isFlying;
/*
* Begin ToggleSneak Changes - ToggleSprint
@@ -151,7 +93,7 @@ public class BasePlayer extends ClientPlayerBase
if(isSprintDisabled)
{
//Utils.LOG_INFO("Sprint pressed");
- if(aSneak.optionDoubleTap && this.player.onGround && !isMovingForward && (this.player.movementInput.moveForward >= minSpeed) && !this.player.isSprinting() && enoughHunger && !this.player.isUsingItem() && !this.player.isPotionActive(Potion.blindness))
+ if(aSneak.optionDoubleTap && this.player.onGround && !isMovingForward && (this.player.movementInput.moveForward >= minSpeed) && !this.player.isSprinting() && !this.player.isUsingItem() && !this.player.isPotionActive(Potion.blindness))
{
if((this.playerAPI.getSprintToggleTimerField() <= 0) && !this.settings.keyBindSprint.getIsKeyPressed())
{
@@ -170,7 +112,7 @@ public class BasePlayer extends ClientPlayerBase
}
}
- if(!this.player.isSprinting() && (this.player.movementInput.moveForward >= minSpeed) && enoughHunger && !this.player.isUsingItem() && !this.player.isPotionActive(Potion.blindness) && this.settings.keyBindSprint.getIsKeyPressed())
+ if(!this.player.isSprinting() && (this.player.movementInput.moveForward >= minSpeed) && !this.player.isUsingItem() && !this.player.isPotionActive(Potion.blindness) && this.settings.keyBindSprint.getIsKeyPressed())
{
if (aSneak.Sprinting()){
this.player.setSprinting(true);
@@ -192,7 +134,7 @@ public class BasePlayer extends ClientPlayerBase
// 5/6/14 - onGround check removed to match vanilla's 'start sprint while jumping' behavior.
//if(this.player.onGround && enoughHunger && !this.player.isUsingItem() && !this.player.isPotionActive(Potion.blindness) && !this.customMovementInput.sprintHeldAndReleased)
- if(enoughHunger && !this.player.isUsingItem() && !this.player.isPotionActive(Potion.blindness) && !this.customMovementInput.sprintHeldAndReleased)
+ if(!this.player.isUsingItem() && !this.player.isPotionActive(Potion.blindness) && !this.customMovementInput.sprintHeldAndReleased)
{
if((canDoubleTap && !this.player.isSprinting()) || !canDoubleTap)
{
@@ -204,7 +146,7 @@ public class BasePlayer extends ClientPlayerBase
}
}
- if(canDoubleTap && !state && this.player.onGround && !isMovingForward && (this.player.movementInput.moveForward >= minSpeed) && !this.player.isSprinting() && enoughHunger && !this.player.isUsingItem() && !this.player.isPotionActive(Potion.blindness))
+ if(canDoubleTap && !state && this.player.onGround && !isMovingForward && (this.player.movementInput.moveForward >= minSpeed) && !this.player.isSprinting() && !this.player.isUsingItem() && !this.player.isPotionActive(Potion.blindness))
{
if(this.playerAPI.getSprintToggleTimerField() == 0)
{
@@ -223,7 +165,7 @@ public class BasePlayer extends ClientPlayerBase
// If sprinting, break the sprint in appropriate circumstances:
// Player stops moving forward, runs into something, or gets too hungry
- if(this.player.isSprinting() && ((this.player.movementInput.moveForward < minSpeed) || this.player.isCollidedHorizontally || !enoughHunger))
+ if(this.player.isSprinting() && ((this.player.movementInput.moveForward < minSpeed) || this.player.isCollidedHorizontally))
{
this.player.setSprinting(false);
@@ -265,87 +207,6 @@ public class BasePlayer extends ClientPlayerBase
// this.handledDebugPress = false;
// }
- //
- // Fly Speed Boosting - Added 5/7/2014
- //
- if(this.player.capabilities.getFlySpeed() != 0.05F)
- {
- this.player.capabilities.setFlySpeed(0.05F);
- }
-
-
- if(this.player.capabilities.allowFlying && !isJumping && this.player.movementInput.jump)
- {
- if(this.playerAPI.getFlyToggleTimerField() == 0)
- {
- this.playerAPI.setFlyToggleTimerField(7);
- }
- else
- {
- this.player.capabilities.isFlying = !this.player.capabilities.isFlying;
- this.player.sendPlayerAbilities();
- this.playerAPI.setFlyToggleTimerField(0);
- }
- }
-
- if(this.player.capabilities.isFlying)
- {
- if(this.player.movementInput.sneak)
- {
- this.player.motionY -= 0.15D;
- }
- if(this.player.movementInput.jump)
- {
- this.player.motionY += 0.15D;
- }
- }
-
- if(this.player.isRidingHorse())
- {
- if(this.playerAPI.getHorseJumpPowerCounterField() < 0)
- {
- this.playerAPI.setHorseJumpPowerCounterField(this.playerAPI.getHorseJumpPowerCounterField() + 1);
- if(this.playerAPI.getHorseJumpPowerCounterField() == 0)
- {
- this.playerAPI.setHorseJumpPowerField(0.0F);
- }
- }
-
- if(isJumping && !this.player.movementInput.jump)
- {
- this.playerAPI.setHorseJumpPowerCounterField(this.playerAPI.getHorseJumpPowerCounterField() - 10);
- this.playerAPI.setHorseJumpPowerCounterField(-10);
- ((EntityClientPlayerMP)this.player).sendQueue.addToSendQueue(new C0BPacketEntityAction(this.player, 6, (int)(this.player.getHorseJumpPower() * 100.0F)));
- }
- else if(!isJumping && this.player.movementInput.jump)
- {
- this.playerAPI.setHorseJumpPowerCounterField(0);
- this.playerAPI.setHorseJumpPowerField(0.0F);
- }
- else if(isJumping)
- {
- this.playerAPI.setHorseJumpPowerCounterField(this.playerAPI.getHorseJumpPowerCounterField() + 1);
- if(this.playerAPI.getHorseJumpPowerCounterField() < 10)
- {
- this.playerAPI.setHorseJumpPowerField(this.playerAPI.getHorseJumpPowerCounterField() * 0.1F);
- }
- else
- {
- this.playerAPI.setHorseJumpPowerField(0.8F + ((2.0F / (this.playerAPI.getHorseJumpPowerCounterField() - 9)) * 0.1F));
- }
- }
- }
- else
- {
- this.playerAPI.setHorseJumpPowerField(0.0F);
- }
-
- this.playerAPI.superOnLivingUpdate();
- if(this.player.onGround && this.player.capabilities.isFlying)
- {
- this.player.capabilities.isFlying = false;
- this.player.sendPlayerAbilities();
- }
}
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/common/CommonProxy.java b/src/Java/gtPlusPlus/core/common/CommonProxy.java
index 1920d9c903..1ce16bf4de 100644
--- a/src/Java/gtPlusPlus/core/common/CommonProxy.java
+++ b/src/Java/gtPlusPlus/core/common/CommonProxy.java
@@ -53,6 +53,7 @@ import gtPlusPlus.plugin.villagers.block.BlockGenericSpawner;
import gtPlusPlus.xmod.eio.handler.HandlerTooltip_EIO;
import gtPlusPlus.xmod.galacticraft.handler.HandlerTooltip_GC;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.api.util.SpecialBehaviourTooltipHandler;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.EntityBlaze;
@@ -147,6 +148,8 @@ public class CommonProxy {
// Block Handler for all events.
Utils.registerEvent(new BlockEventHandler());
Utils.registerEvent(new GeneralTooltipEventHandler());
+ // Handles Tooltips for items giving custom multiblock behaviour
+ Utils.registerEvent(new SpecialBehaviourTooltipHandler());
// Handles Custom tooltips for EIO.
Utils.registerEvent(new HandlerTooltip_EIO());
// Handles Custom Tooltips for GC
@@ -194,14 +197,18 @@ public class CommonProxy {
COMPAT_HANDLER.RemoveRecipesFromOtherMods();
Logger.INFO("Initialising Handler, Then Adding Recipes");
COMPAT_HANDLER.InitialiseHandlerThenAddRecipes();
- Logger.INFO("Loading Gregtech API recipes.");
- COMPAT_HANDLER.startLoadingGregAPIBasedRecipes();
Logger.INFO("Loading Intermod staging.");
COMPAT_IntermodStaging.postInit(e);
Logger.INFO("Loading queued recipes.");
COMPAT_HANDLER.runQueuedRecipes();
Logger.INFO("Registering custom mob drops.");
registerCustomMobDrops();
+
+ // Moved last in postInit().
+ // 12/12/19 - Alkalus
+ // Moved last, to prevent recipes being generated post initialisation.
+ Logger.INFO("Loading Gregtech API recipes.");
+ COMPAT_HANDLER.startLoadingGregAPIBasedRecipes();
}
public void serverStarting(final FMLServerStartingEvent e) {
diff --git a/src/Java/gtPlusPlus/core/container/Container_RoundRobinator.java b/src/Java/gtPlusPlus/core/container/Container_RoundRobinator.java
new file mode 100644
index 0000000000..cbd08c2cca
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/container/Container_RoundRobinator.java
@@ -0,0 +1,246 @@
+package gtPlusPlus.core.container;
+
+import java.util.Iterator;
+
+import org.apache.commons.lang3.ArrayUtils;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.enums.GT_Values;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.block.ModBlocks;
+import gtPlusPlus.core.inventories.Inventory_RoundRobinator;
+import gtPlusPlus.core.slots.SlotNoInput;
+import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.ICrafting;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+
+public class Container_RoundRobinator extends Container {
+
+ public TileEntityRoundRobinator tile_entity;
+ public final Inventory_RoundRobinator inventoryChest;
+
+ private final World worldObj;
+ private final int posX;
+ private final int posY;
+ private final int posZ;
+
+ private final boolean[] mActiveData = new boolean[] {false, false, false, false};
+
+ public static int mStorageSlotNumber = 4; // Number of slots in storage area
+ public static int mInventorySlotNumber = 36; // Inventory Slots (Inventory
+ // and Hotbar)
+ public static int mFullSlotNumber = mInventorySlotNumber + mStorageSlotNumber; // All
+ // slots
+
+ public Container_RoundRobinator(final InventoryPlayer inventory, final TileEntityRoundRobinator te) {
+ this.tile_entity = te;
+ this.inventoryChest = te.getInventory();
+ boolean [] aTemp = te.getActiveSides();
+ if (aTemp != null && aTemp.length == 4) {
+ for (int i=0;i<4;i++) {
+ mActiveData[i] = aTemp[i];
+ }
+ }
+
+ int var6;
+ int var7;
+ this.worldObj = te.getWorldObj();
+ this.posX = te.xCoord;
+ this.posY = te.yCoord;
+ this.posZ = te.zCoord;
+
+ int o = 0;
+ int xStart = 134;
+ int yStart = 32;
+
+ try {
+ //0
+ this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, xStart, yStart));
+ this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, xStart+18, yStart));
+ this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, xStart, yStart+17));
+ this.addSlotToContainer(new SlotNoInput(this.inventoryChest, o++, xStart+18, yStart+17));
+
+ // Player Inventory
+ for (var6 = 0; var6 < 3; ++var6) {
+ for (var7 = 0; var7 < 9; ++var7) {
+ this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18)));
+ }
+ }
+ // Player Hotbar
+ for (var6 = 0; var6 < 9; ++var6) {
+ this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
+ }
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ }
+ this.detectAndSendChanges();
+
+ }
+
+ @Override
+ public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold,
+ final EntityPlayer aPlayer) {
+
+ if (!aPlayer.worldObj.isRemote) {
+ if (aSlotIndex < 4) {
+ this.tile_entity.toggleSide(aSlotIndex+2);
+ //Logger.INFO("Toggling side: "+(aSlotIndex+2)+" | Active: "+this.tile_entity.getSideActive(aSlotIndex+2)+" | Data:"+this.tile_entity.getDataString());
+ }
+ }
+ return GT_Values.NI;
+ //return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+
+ @Override
+ public void onContainerClosed(final EntityPlayer par1EntityPlayer) {
+ super.onContainerClosed(par1EntityPlayer);
+ }
+
+ @Override
+ public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
+ if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockRoundRobinator) {
+ return false;
+ }
+
+ return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
+ }
+
+
+
+ public final void addCraftingToCrafters(ICrafting par1ICrafting) {
+ try {
+ super.addCraftingToCrafters(par1ICrafting);
+ } catch (Throwable var3) {
+ var3.printStackTrace();
+ }
+ }
+
+ public final void removeCraftingFromCrafters(ICrafting par1ICrafting) {
+ try {
+ super.removeCraftingFromCrafters(par1ICrafting);
+ } catch (Throwable var3) {
+ var3.printStackTrace();
+ }
+ }
+
+ public final void detectAndSendChanges() {
+ try {
+ super.detectAndSendChanges();
+ detectAndSendChangesEx();
+ } catch (Throwable var2) {
+ var2.printStackTrace();
+ }
+ }
+
+ public final void updateProgressBar(int par1, int par2) {
+ try {
+ super.updateProgressBar(par1, par2);
+ updateProgressBarEx(par1, par2);
+ } catch (Throwable var4) {
+ var4.printStackTrace();
+ }
+ }
+
+
+ public int mSide_1 = 0;
+ public int mSide_2 = 0;
+ public int mSide_3 = 0;
+ public int mSide_4 = 0;
+ public int mTier = 1;
+ public int mTickRate = 50;
+
+ private int oSide_1 = 0;
+ private int oSide_2 = 0;
+ private int oSide_3 = 0;
+ private int oSide_4 = 0;
+ private int oTier = 1;
+ private int oTickRate = 50;
+
+ private int mTimer = 0;
+
+
+
+ public void detectAndSendChangesEx() {
+ super.detectAndSendChanges();
+ if (!this.tile_entity.getWorldObj().isRemote) {
+ boolean [] aTemp = tile_entity.getActiveSides();
+ for (int i=0;i<4;i++) {
+ mActiveData[i] = aTemp[i];
+ }
+ this.mSide_1 = aTemp[0] ? 1 : 0;
+ this.mSide_2 = aTemp[1] ? 1 : 0;
+ this.mSide_3 = aTemp[2] ? 1 : 0;
+ this.mSide_4 = aTemp[3] ? 1 : 0;
+ this.mTier = this.tile_entity.getTier();
+ this.mTickRate = this.tile_entity.getTickRate();
+ ++this.mTimer;
+ Iterator var2 = this.crafters.iterator();
+
+ while (true) {
+ ICrafting var1;
+ do {
+ if (!var2.hasNext()) {
+ this.oSide_1 = this.mSide_1;
+ this.oSide_2 = this.mSide_2;
+ this.oSide_3 = this.mSide_3;
+ this.oSide_4 = this.mSide_4;
+ this.oTier = this.mTier;
+ this.oTickRate = this.mTickRate;
+ return;
+ }
+ var1 = (ICrafting) var2.next();
+ if (this.mTimer % 500 == 10 || this.oSide_1 != this.mSide_1) {
+ var1.sendProgressBarUpdate(this, 2, this.mSide_1);
+ }
+ if (this.mTimer % 500 == 10 || this.oSide_2 != this.mSide_2) {
+ var1.sendProgressBarUpdate(this, 4, this.mSide_2);
+ }
+ if (this.mTimer % 500 == 10 || this.oSide_3 != this.mSide_3) {
+ var1.sendProgressBarUpdate(this, 6, this.mSide_3);
+ }
+ if (this.mTimer % 500 == 10 || this.oSide_4 != this.mSide_4) {
+ var1.sendProgressBarUpdate(this, 8, this.mSide_4);
+ }
+ if (this.mTimer % 500 == 10 || this.oTier != this.mTier) {
+ var1.sendProgressBarUpdate(this, 10, this.mTier);
+ }
+ if (this.mTimer % 500 == 10 || this.oTickRate != this.mTickRate) {
+ var1.sendProgressBarUpdate(this, 12, this.mTickRate);
+ }
+ } while (this.mTimer % 500 != 10);
+
+ }
+ }
+ }
+
+ @SideOnly(Side.CLIENT)
+ public void updateProgressBarEx(int par1, int par2) {
+ super.updateProgressBar(par1, par2);
+ switch (par1) {
+ case 2 :
+ this.mSide_1 = par2;
+ break;
+ case 4 :
+ this.mSide_2 = par2;
+ break;
+ case 6 :
+ this.mSide_3 = par2;
+ case 8 :
+ this.mSide_4 = par2;
+ case 10 :
+ this.mTier = par2;
+ case 12 :
+ this.mTickRate = par2;
+ break;
+ }
+
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/container/Container_SuperJukebox.java b/src/Java/gtPlusPlus/core/container/Container_SuperJukebox.java
index 34a4e9fa97..f9bf617e1b 100644
--- a/src/Java/gtPlusPlus/core/container/Container_SuperJukebox.java
+++ b/src/Java/gtPlusPlus/core/container/Container_SuperJukebox.java
@@ -191,7 +191,7 @@ public class Container_SuperJukebox extends Container {
@Override
public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
- if (tile_entity.getWorldObj().isRemote || tile_entity == null) return null;
+ if (tile_entity == null || tile_entity.getWorldObj().isRemote) return null;
switch (aSlotIndex) {
case SLOT_HOLO_PLAY:
if (tile_entity == null) return null;
@@ -217,7 +217,7 @@ public class Container_SuperJukebox extends Container {
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
- if (tile_entity.getWorldObj().isRemote || tile_entity == null) return;
+ if (tile_entity == null || tile_entity.getWorldObj().isRemote) return;
isPlaying = tile_entity.mIsPlaying;
isLooping = tile_entity.mIsLooping;
diff --git a/src/Java/gtPlusPlus/core/fluids/FactoryFluid.java b/src/Java/gtPlusPlus/core/fluids/FactoryFluid.java
index 3359f18f7d..e3383aee91 100644
--- a/src/Java/gtPlusPlus/core/fluids/FactoryFluid.java
+++ b/src/Java/gtPlusPlus/core/fluids/FactoryFluid.java
@@ -43,7 +43,7 @@ public class FactoryFluid extends Fluid implements Runnable {
@Override
public void run() {
- this.setIcons(GregTech_API.sBlockIcons.registerIcon(CORE.MODID+ ":" + "fluids/fluid." + this.mTextureName));
+ this.setIcons(GregTech_API.sBlockIcons.registerIcon(this.mTextureName));
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/gui/machine/GUI_PestKiller.java b/src/Java/gtPlusPlus/core/gui/machine/GUI_PestKiller.java
index 889b19443e..881c6c82a1 100644
--- a/src/Java/gtPlusPlus/core/gui/machine/GUI_PestKiller.java
+++ b/src/Java/gtPlusPlus/core/gui/machine/GUI_PestKiller.java
@@ -57,12 +57,10 @@ public class GUI_PestKiller extends GuiContainer {
Color startGrad = new Color(50, 50, 50);
Color endGrad = new Color(20, 20, 20);
Container_PestKiller aCont = (Container_PestKiller) this.inventorySlots;
- TileEntityPestKiller aTileKiller = aCont.tile_entity;
double aPercentage = 0;
double aDivisor = (100/16);
- int aFrameHeight = 16;
-
+ int aFrameHeight = 16;
boolean didRender = false;
if (aCont != null) {
diff --git a/src/Java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java b/src/Java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java
new file mode 100644
index 0000000000..edb53e8ec0
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/gui/machine/GUI_RoundRobinator.java
@@ -0,0 +1,120 @@
+package gtPlusPlus.core.gui.machine;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+import org.lwjgl.opengl.GL11;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gtPlusPlus.core.container.Container_RoundRobinator;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.ResourceLocation;
+
+@SideOnly(Side.CLIENT)
+public class GUI_RoundRobinator extends GuiContainer {
+
+ private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID, "textures/gui/RoundRobinator.png");
+ private TileEntityRoundRobinator mTile;
+ private Container_RoundRobinator mContainer;
+ private static final Method mDrawItemStack;
+
+ static {
+ mDrawItemStack = ReflectionUtils.getMethod(GuiContainer.class, "drawItemStack", new Class[] {ItemStack.class, int.class, int.class, String.class});
+ }
+
+ public GUI_RoundRobinator(final InventoryPlayer player_inventory, final TileEntityRoundRobinator te){
+ this(new Container_RoundRobinator(player_inventory, te));
+ mTile = te;
+ }
+
+ private GUI_RoundRobinator(final Container_RoundRobinator aContainer){
+ super(aContainer);
+ mContainer = aContainer;
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int i, final int j){
+ super.drawGuiContainerForegroundLayer(i, j);
+
+ int xStart = 134;
+ int yStart = 31;
+ mTile = this.mContainer.tile_entity;
+
+ int tier = mContainer.mTier;
+ int aTickRate = mContainer.mTickRate;
+
+ fontRendererObj.drawString("Round Robinator", 85, 4, Utils.rgbtoHexValue(50, 150, 50));
+ fontRendererObj.drawString("Tier: "+tier, 85, 12, Utils.rgbtoHexValue(50, 150, 50));
+ fontRendererObj.drawString("Rate: 1 Item/"+aTickRate+"t", 85, 20, Utils.rgbtoHexValue(50, 150, 50));
+
+ boolean[] aStates = new boolean[] {mContainer.mSide_1 == 0 ? false : true, mContainer.mSide_2 == 0 ? false : true, mContainer.mSide_3 == 0 ? false : true,mContainer.mSide_4 == 0 ? false : true};
+
+ fontRendererObj.drawString("West: "+(aStates[0] ? "Active" : "Disabled"), 5, 5, Utils.rgbtoHexValue(50, 50, 50));
+ fontRendererObj.drawString("North: "+(aStates[1] ? "Active" : "Disabled"), 5, 15, Utils.rgbtoHexValue(50, 50, 50));
+ fontRendererObj.drawString("South: "+(aStates[2] ? "Active" : "Disabled"), 5, 25, Utils.rgbtoHexValue(50, 50, 50));
+ fontRendererObj.drawString("East: "+(aStates[3] ? "Active" : "Disabled"), 5, 35, Utils.rgbtoHexValue(50, 50, 50));
+ fontRendererObj.drawString("Toggling South will visually", 5, 65, Utils.rgbtoHexValue(150, 50, 50));
+ fontRendererObj.drawString("toggle East, This is a visual bug.", 5, 74, Utils.rgbtoHexValue(150, 50, 50));
+ drawStatus(aStates[0], xStart, yStart);
+ drawStatus(aStates[1], xStart+18, yStart);
+ drawStatus(aStates[2], xStart, yStart+18);
+ drawStatus(aStates[3], xStart+18, yStart+18);
+
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j){
+ GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+ this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+
+
+
+ }
+
+ private static ItemStack aGreenGlass;
+ private static ItemStack aRedGlass;
+
+ private void drawStatus(boolean aStateActive, int x, int y) {
+ if (aGreenGlass == null) {
+ Item pane = ItemUtils.getSimpleStack(Blocks.stained_glass_pane).getItem();
+ aGreenGlass = ItemUtils.simpleMetaStack(pane, 5, 1);
+ }
+ if (aRedGlass == null) {
+ Item pane = ItemUtils.getSimpleStack(Blocks.stained_glass_pane).getItem();
+ aRedGlass = ItemUtils.simpleMetaStack(pane, 14, 1);
+ }
+ if (mDrawItemStack != null) {
+ try {
+ if (aStateActive) {
+ mDrawItemStack.invoke(this, new Object[]{aGreenGlass, x, y, ""});
+ }
+ else {
+ mDrawItemStack.invoke(this, new Object[]{aRedGlass, x, y, ""});
+ }
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+ }
+
+ //This method is called when the Gui is first called!
+ @Override
+ public void initGui(){
+ super.initGui();
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/handler/AchievementHandler.java b/src/Java/gtPlusPlus/core/handler/AchievementHandler.java
index 9053875058..fa10f4def3 100644
--- a/src/Java/gtPlusPlus/core/handler/AchievementHandler.java
+++ b/src/Java/gtPlusPlus/core/handler/AchievementHandler.java
@@ -17,6 +17,7 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.ALLOY;
import gtPlusPlus.core.material.ELEMENT;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
@@ -74,7 +75,9 @@ public class AchievementHandler {
this.registerAchievement("semifluid", -14, -10, GregtechItemList.Generator_SemiFluid_HV.get(1), aBaseAchievementName, false);
this.registerAchievement("earlywasher", -13, -10, GregtechItemList.SimpleDustWasher_ULV.get(1), aBaseAchievementName, false);
this.registerAchievement("advancedsteam", -12, -10, GregtechItemList.Boiler_Advanced_MV.get(1), aBaseAchievementName, false);
- this.registerAchievement("pollutionremoval", -11, -10, GregtechItemList.Pollution_Cleaner_IV.get(1), aBaseAchievementName, false);
+ if (PollutionUtils.isPollutionEnabled()) {
+ this.registerAchievement("pollutionremoval", -11, -10, GregtechItemList.Pollution_Cleaner_IV.get(1), aBaseAchievementName, false);
+ }
this.registerAchievement("hiampxform", -10, -10, GregtechItemList.Transformer_HA_HV_MV.get(1), aBaseAchievementName, false);
diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
index fd30457b46..be02e352c7 100644
--- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
+++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
@@ -2,7 +2,9 @@ package gtPlusPlus.core.handler;
import static gtPlusPlus.core.lib.LoadedMods.Gregtech;
-import java.util.*;
+import java.util.LinkedList;
+import java.util.Queue;
+import java.util.Set;
import cpw.mods.fml.common.event.FMLLoadCompleteEvent;
import gregtech.api.enums.GT_Values;
@@ -11,22 +13,99 @@ import gtPlusPlus.api.interfaces.RunnableWithInfo;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.minecraft.ItemPackage;
-import gtPlusPlus.core.common.compat.*;
+import gtPlusPlus.core.common.compat.COMPAT_BigReactors;
+import gtPlusPlus.core.common.compat.COMPAT_CompactWindmills;
+import gtPlusPlus.core.common.compat.COMPAT_EnderIO;
+import gtPlusPlus.core.common.compat.COMPAT_ExtraUtils;
+import gtPlusPlus.core.common.compat.COMPAT_HarvestCraft;
+import gtPlusPlus.core.common.compat.COMPAT_IC2;
+import gtPlusPlus.core.common.compat.COMPAT_MorePlanets;
+import gtPlusPlus.core.common.compat.COMPAT_OpenBlocks;
+import gtPlusPlus.core.common.compat.COMPAT_PneumaticCraft;
+import gtPlusPlus.core.common.compat.COMPAT_RFTools;
+import gtPlusPlus.core.common.compat.COMPAT_Railcraft;
+import gtPlusPlus.core.common.compat.COMPAT_SimplyJetpacks;
+import gtPlusPlus.core.common.compat.COMPAT_Thaumcraft;
+import gtPlusPlus.core.common.compat.COMPAT_Witchery;
import gtPlusPlus.core.handler.Recipes.LateRegistrationHandler;
import gtPlusPlus.core.handler.Recipes.RegistrationHandler;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.MaterialGenerator;
-import gtPlusPlus.core.recipe.*;
+import gtPlusPlus.core.recipe.RECIPES_Extruder;
+import gtPlusPlus.core.recipe.RECIPES_GREGTECH;
+import gtPlusPlus.core.recipe.RECIPES_LaserEngraver;
+import gtPlusPlus.core.recipe.ShapedRecipeObject;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
-import gtPlusPlus.xmod.gregtech.HANDLER_GT;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaGarbageCollector;
-import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaPollutionCreator;
+import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_FluidCanning;
import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Recycling;
-import gtPlusPlus.xmod.gregtech.registration.gregtech.*;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.Gregtech4Content;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechAdvancedBoilers;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechAdvancedMixer;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechAlgaeContent;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechAmazonWarehouse;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechBedrockPlatforms;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechBufferDynamos;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechComponentAssembler;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechCustomHatches;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechCyclotron;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechDehydrator;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechEnergyBuffer;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechFactoryGradeReplacementMultis;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechFluidReactor;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechGeneratorsULV;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechGeothermalThermalGenerator;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechHiAmpTransformer;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialArcFurnace;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialBlastSmelter;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialCentrifuge;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialCokeOven;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialCuttingFactory;
+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.GregtechIndustrialFuelRefinery;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialGeneratorArray;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialMacerator;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialMassFabricator;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialMixer;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialMultiMachine;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialMultiTank;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialPlatePress;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialSifter;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialThermalCentrifuge;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialTreeFarm;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialWashPlant;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialWiremill;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIronBlastFurnace;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechLFTR;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechLargeTurbinesAndHeatExchanger;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechMiniRaFusion;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechNaqReactor;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechPollutionDevices;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechPowerBreakers;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechPowerSubStation;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechRTG;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechRocketFuelGenerator;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSafeBlock;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSemiFluidgenerators;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSimpleWasher;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSolarGenerators;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSolarTower;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSteamCondenser;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSuperChests;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechTeslaTower;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechThaumcraftDevices;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechThreadedBuffers;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechTieredChunkloaders;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechTieredFluidTanks;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechTreeFarmerTE;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechWirelessChargers;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.NewHorizonsAccelerator;
import net.minecraft.item.ItemStack;
public class COMPAT_HANDLER {
@@ -135,6 +214,8 @@ public class COMPAT_HANDLER {
GregtechSolarTower.run();
GregtechLargeTurbinesAndHeatExchanger.run();
GregtechPowerBreakers.run();
+ GregtechFluidReactor.run();
+ GregtechAlgaeContent.run();
//New Horizons Content
NewHorizonsAccelerator.run();
@@ -211,6 +292,7 @@ public class COMPAT_HANDLER {
for (RunnableWithInfo<Material> r : m) {
try {
r.run();
+ Logger.INFO("[FIND] "+r.getInfoData().getLocalizedName()+" recipes generated.");
}
catch (Throwable t) {
t.printStackTrace();
@@ -220,6 +302,9 @@ public class COMPAT_HANDLER {
}
RecipeGen_Recycling.executeGenerators();
runQueuedMisc();
+
+ // Do Fluid Canning Last, because they're not executed on demand, but rather queued.
+ RecipeGen_FluidCanning.init();
}
diff --git a/src/Java/gtPlusPlus/core/handler/GuiHandler.java b/src/Java/gtPlusPlus/core/handler/GuiHandler.java
index 67493d7964..e44c9a8f20 100644
--- a/src/Java/gtPlusPlus/core/handler/GuiHandler.java
+++ b/src/Java/gtPlusPlus/core/handler/GuiHandler.java
@@ -2,16 +2,22 @@ package gtPlusPlus.core.handler;
import cpw.mods.fml.common.network.IGuiHandler;
import cpw.mods.fml.common.network.NetworkRegistry;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.ChunkCoordinates;
-import net.minecraft.world.World;
-
import gtPlusPlus.GTplusplus;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.machine.Machine_SuperJukebox.TileEntitySuperJukebox;
-import gtPlusPlus.core.container.*;
+import gtPlusPlus.core.container.Container_BackpackBase;
+import gtPlusPlus.core.container.Container_CircuitProgrammer;
+import gtPlusPlus.core.container.Container_DecayablesChest;
+import gtPlusPlus.core.container.Container_FishTrap;
+import gtPlusPlus.core.container.Container_Grindle;
+import gtPlusPlus.core.container.Container_ModularityTable;
+import gtPlusPlus.core.container.Container_PestKiller;
+import gtPlusPlus.core.container.Container_ProjectTable;
+import gtPlusPlus.core.container.Container_RoundRobinator;
+import gtPlusPlus.core.container.Container_SuperJukebox;
+import gtPlusPlus.core.container.Container_TradeTable;
+import gtPlusPlus.core.container.Container_Workbench;
+import gtPlusPlus.core.container.Container_WorkbenchAdvanced;
import gtPlusPlus.core.container.box.LunchBoxContainer;
import gtPlusPlus.core.container.box.MagicBagContainer;
import gtPlusPlus.core.container.box.ToolBoxContainer;
@@ -22,20 +28,38 @@ import gtPlusPlus.core.gui.item.GuiBaseGrindle;
import gtPlusPlus.core.gui.item.box.LunchBoxGui;
import gtPlusPlus.core.gui.item.box.MagicBagGui;
import gtPlusPlus.core.gui.item.box.ToolBoxGui;
-import gtPlusPlus.core.gui.machine.*;
+import gtPlusPlus.core.gui.machine.GUI_CircuitProgrammer;
+import gtPlusPlus.core.gui.machine.GUI_DecayablesChest;
+import gtPlusPlus.core.gui.machine.GUI_FishTrap;
+import gtPlusPlus.core.gui.machine.GUI_ModularityTable;
+import gtPlusPlus.core.gui.machine.GUI_PestKiller;
+import gtPlusPlus.core.gui.machine.GUI_ProjectTable;
+import gtPlusPlus.core.gui.machine.GUI_RoundRobinator;
+import gtPlusPlus.core.gui.machine.GUI_SuperJukebox;
+import gtPlusPlus.core.gui.machine.GUI_TradeTable;
+import gtPlusPlus.core.gui.machine.GUI_Workbench;
+import gtPlusPlus.core.gui.machine.GUI_WorkbenchAdvanced;
import gtPlusPlus.core.interfaces.IGuiManager;
import gtPlusPlus.core.inventories.BaseInventoryBackpack;
import gtPlusPlus.core.inventories.BaseInventoryGrindle;
import gtPlusPlus.core.inventories.box.LunchBoxInventory;
import gtPlusPlus.core.inventories.box.MagicBagInventory;
import gtPlusPlus.core.inventories.box.ToolBoxInventory;
-import gtPlusPlus.core.item.tool.misc.box.ContainerBoxBase;
-import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory;
import gtPlusPlus.core.tileentities.base.TileEntityBase;
import gtPlusPlus.core.tileentities.general.TileEntityCircuitProgrammer;
import gtPlusPlus.core.tileentities.general.TileEntityDecayablesChest;
import gtPlusPlus.core.tileentities.general.TileEntityFishTrap;
-import gtPlusPlus.core.tileentities.machines.*;
+import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable;
+import gtPlusPlus.core.tileentities.machines.TileEntityPestKiller;
+import gtPlusPlus.core.tileentities.machines.TileEntityProjectTable;
+import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator;
+import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable;
+import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench;
+import gtPlusPlus.core.tileentities.machines.TileEntityWorkbenchAdvanced;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ChunkCoordinates;
+import net.minecraft.world.World;
public class GuiHandler implements IGuiHandler {
@@ -54,6 +78,7 @@ public class GuiHandler implements IGuiHandler {
public static final int GUI13 = 12; // Decayables Chest
public static final int GUI14 = 13; // Super Jukebox
public static final int GUI15 = 14; // Pest Killer
+ public static final int GUI16 = 15; // Round-Robinator
public static void init() {
@@ -102,6 +127,8 @@ public class GuiHandler implements IGuiHandler {
return new Container_SuperJukebox(player.inventory, (TileEntitySuperJukebox) te);
} else if (ID == GUI15) {
return new Container_PestKiller(player.inventory, (TileEntityPestKiller) te);
+ } else if (ID == GUI16) {
+ return new Container_RoundRobinator(player.inventory, (TileEntityRoundRobinator) te);
}
}
@@ -162,7 +189,9 @@ public class GuiHandler implements IGuiHandler {
return new GUI_SuperJukebox(player.inventory, (TileEntitySuperJukebox) te);
} else if (ID == GUI15) {
return new GUI_PestKiller(player.inventory, (TileEntityPestKiller) te);
- }
+ } else if (ID == GUI16) {
+ return new GUI_RoundRobinator(player.inventory, (TileEntityRoundRobinator) te);
+ }
}
if (ID == GUI9) {
diff --git a/src/Java/gtPlusPlus/core/handler/StopAnnoyingFuckingAchievements.java b/src/Java/gtPlusPlus/core/handler/StopAnnoyingFuckingAchievements.java
index b10e67aeaf..8853acd4b7 100644
--- a/src/Java/gtPlusPlus/core/handler/StopAnnoyingFuckingAchievements.java
+++ b/src/Java/gtPlusPlus/core/handler/StopAnnoyingFuckingAchievements.java
@@ -1,8 +1,8 @@
package gtPlusPlus.core.handler;
+import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import net.minecraft.client.Minecraft;
import net.minecraft.stats.AchievementList;
import net.minecraftforge.event.entity.player.AchievementEvent;
@@ -12,12 +12,15 @@ public class StopAnnoyingFuckingAchievements {
* Stops me getting fireworks every fucking time I open my inventory upon first loading a dev client.
* @param event
*/
- @SubscribeEvent
+ @SubscribeEvent(priority=EventPriority.HIGHEST)
public void FUCK_OFF(AchievementEvent event) {
if (event.achievement.equals(AchievementList.openInventory)) {
- if (MathUtils.randInt(0, 10) >= 9)
- PlayerUtils.messagePlayer(event.entityPlayer, "Bang! Nah, Just joking, there's no fireworks. :)");
event.setCanceled(true);
+ if (Minecraft.getMinecraft() != null) {
+ if (Minecraft.getMinecraft().gameSettings != null) {
+ Minecraft.getMinecraft().gameSettings.showInventoryAchievementHint = false;
+ }
+ }
}
}
diff --git a/src/Java/gtPlusPlus/core/handler/events/SneakManager.java b/src/Java/gtPlusPlus/core/handler/events/SneakManager.java
index 2b067be477..3e51c6488a 100644
--- a/src/Java/gtPlusPlus/core/handler/events/SneakManager.java
+++ b/src/Java/gtPlusPlus/core/handler/events/SneakManager.java
@@ -37,10 +37,11 @@ public class SneakManager {
public boolean canSprint = true;
public boolean isSneaking = true;
public boolean optionDoubleTap = true;
- public boolean wasSprintDisabled = false;
+ public boolean wasSprintDisabled = false;
+ public boolean mIsWearingRing = false;
- private static State Sprinting = State.ON;
- private static State Crouching = State.OFF;
+ private State Sprinting = State.ON;
+ private State Crouching = State.OFF;
public SneakManager(EntityPlayer aPlayer) {
owner = aPlayer;
@@ -78,22 +79,38 @@ public class SneakManager {
return State.ON;
}
- public State setCrouchingStateON(){
+ private State setCrouchingStateON(){
return Crouching = State.ON;
}
- public State setCrouchingStateOFF(){
+ private State setCrouchingStateOFF(){
return Crouching = State.OFF;
}
- public State setSprintingStateON(){
+ private State setSprintingStateON(){
return Sprinting = State.ON;
}
- public State setSprintingStateOFF(){
+ private State setSprintingStateOFF(){
return Sprinting = State.OFF;
}
-
+
+ public void putRingOn() {
+ mIsWearingRing = true;
+ setSprintingStateOFF();
+ setCrouchingStateON();
+ }
+
+ public void takeRingOff() {
+ mIsWearingRing = false;
+ setSprintingStateON();
+ setCrouchingStateOFF();
+ }
+
+ public boolean isWearingRing() {
+ return mIsWearingRing;
+ }
+
public static enum State {
ON(true),
OFF(false);
diff --git a/src/Java/gtPlusPlus/core/inventories/InventoryCircuitProgrammer.java b/src/Java/gtPlusPlus/core/inventories/InventoryCircuitProgrammer.java
index 4cdbb72c6e..da45b5a988 100644
--- a/src/Java/gtPlusPlus/core/inventories/InventoryCircuitProgrammer.java
+++ b/src/Java/gtPlusPlus/core/inventories/InventoryCircuitProgrammer.java
@@ -1,6 +1,6 @@
package gtPlusPlus.core.inventories;
-import gtPlusPlus.core.recipe.common.CI;
+import gtPlusPlus.core.slots.SlotIntegratedCircuit;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
@@ -167,7 +167,7 @@ public class InventoryCircuitProgrammer implements IInventory{
*/
@Override
public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
- return (itemstack.getItem() == CI.getNumberedCircuit(0).getItem());
+ return SlotIntegratedCircuit.isItemValidForSlot(itemstack);
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/inventories/Inventory_RoundRobinator.java b/src/Java/gtPlusPlus/core/inventories/Inventory_RoundRobinator.java
new file mode 100644
index 0000000000..a47f250c39
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/inventories/Inventory_RoundRobinator.java
@@ -0,0 +1,172 @@
+package gtPlusPlus.core.inventories;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagList;
+
+public class Inventory_RoundRobinator implements IInventory{
+
+ private final String name = "Round Robinator";
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 4;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ public void readFromNBT(final NBTTagCompound nbt){
+ final NBTTagList list = nbt.getTagList("Items", 10);
+ this.inventory = new ItemStack[INV_SIZE];
+ for(int i = 0;i<list.tagCount();i++){
+ final NBTTagCompound data = list.getCompoundTagAt(i);
+ final int slot = data.getInteger("Slot");
+ if((slot >= 0) && (slot < INV_SIZE)){
+ //Utils.LOG_INFO("Trying to read NBT data from inventory.");
+ this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(final NBTTagCompound nbt){
+ final NBTTagList list = new NBTTagList();
+ for(int i = 0;i<INV_SIZE;i++){
+ final ItemStack stack = this.inventory[i];
+ if(stack != null){
+ //Utils.LOG_INFO("Trying to write NBT data to inventory.");
+ final NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getSizeInventory()
+ {
+ return this.inventory.length;
+ }
+
+ public ItemStack[] getInventory(){
+ return this.inventory;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(final int slot)
+ {
+ return this.inventory[slot];
+ }
+
+ @Override
+ public ItemStack decrStackSize(final int slot, final int amount)
+ {
+ ItemStack stack = this.getStackInSlot(slot);
+ if(stack != null)
+ {
+ if(stack.stackSize > amount)
+ {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ }
+ else
+ {
+ // this method also calls markDirty, so we don't need to call it again
+ this.setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(final int slot)
+ {
+ final ItemStack stack = this.getStackInSlot(slot);
+ this.setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(final int slot, final ItemStack stack)
+ {
+ this.inventory[slot] = stack;
+
+ if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit()))
+ {
+ stack.stackSize = this.getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ this.markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName()
+ {
+ return this.name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName()
+ {
+ return this.name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit()
+ {
+ return 64;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty()
+ {
+ for (int i = 0; i < this.getSizeInventory(); ++i)
+ {
+ final ItemStack temp = this.getStackInSlot(i);
+ if (temp != null){
+ //Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
+ }
+
+ if ((temp != null) && (temp.stackSize == 0)) {
+ this.inventory[i] = null;
+ }
+ }
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer)
+ {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ return true;
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java
index 007079b9c8..8bfcfe2d70 100644
--- a/src/Java/gtPlusPlus/core/item/ModItems.java
+++ b/src/Java/gtPlusPlus/core/item/ModItems.java
@@ -1055,10 +1055,10 @@ public final class ModItems {
GT_OreDictUnificator.registerOre("platePhasedIron", ItemUtils.getSimpleStack(itemPlatePulsatingIron));
GT_OreDictUnificator.registerOre("blockVibrantAlloy", ItemUtils.getItemStackOfAmountFromOreDict("blockPhasedGold", 1));
- CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getPlate(1), null, MaterialEIO.REDSTONE_ALLOY.getFluid(144), 10000, 16, 4*9);
- CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getIngot(1), null, MaterialEIO.REDSTONE_ALLOY.getFluid(144), 10000, 16, 4*9);
- CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getNugget(1), null, MaterialEIO.REDSTONE_ALLOY.getFluid(16), 10000, 16, 4);
- CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getBlock(1), null, MaterialEIO.REDSTONE_ALLOY.getFluid(1294), 10000, 16, 4*9*9);
+ CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getPlate(1), MaterialEIO.REDSTONE_ALLOY.getFluid(144), 16, 4*9);
+ CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getIngot(1), MaterialEIO.REDSTONE_ALLOY.getFluid(144), 16, 4*9);
+ CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getNugget(1), MaterialEIO.REDSTONE_ALLOY.getFluid(16), 16, 4);
+ CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getBlock(1), MaterialEIO.REDSTONE_ALLOY.getFluid(1294), 16, 4*9*9);
}
else {
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java
index dc2c0232a6..9b732e38e1 100644
--- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java
+++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java
@@ -96,7 +96,7 @@ public class BaseItemComponent extends Item{
this.extraData = RGBA;
this.setTextureName(CORE.MODID + ":" + "item"+ComponentTypes.CELL.COMPONENT_NAME);
GameRegistry.registerItem(this, aFormattedNameForFluids);
- GT_OreDictUnificator.registerOre(ComponentTypes.CELL.getOreDictName()+aFormattedNameForFluids, ItemUtils.getSimpleStack(this));
+ GT_OreDictUnificator.registerOre(ComponentTypes.CELL.getOreDictName()+Utils.sanitizeStringKeepBrackets(localName), ItemUtils.getSimpleStack(this));
registerComponent();
}
@@ -165,6 +165,14 @@ public class BaseItemComponent extends Item{
public final void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
try {
+
+
+ if (this.componentMaterial == null){
+ if (this.materialName != null){
+ //list.add(Utils.sanitizeStringKeepBrackets(materialName));
+ }
+ }
+
if ((this.materialName != null) && (this.materialName != "") && !this.materialName.equals("") && (this.componentMaterial != null)){
diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
index afc4b17354..9022f864cb 100644
--- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
+++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
@@ -1,14 +1,10 @@
package gtPlusPlus.core.item.base.dusts;
import gtPlusPlus.core.item.base.BaseItemComponent;
-import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
public class BaseItemDust extends BaseItemComponent {
-
-
- private Material dustInfo;
private BaseItemComponent[] mSizedDusts = new BaseItemComponent[2];
public BaseItemDust(Material aMat) {
@@ -33,127 +29,10 @@ public class BaseItemDust extends BaseItemComponent {
}
}
- private BaseItemDust(final String unlocalizedName, final String materialName, final Material matInfo, final int colour, final String pileSize, final int tier){
- this(unlocalizedName, materialName, matInfo, colour, pileSize, tier, true);
- }
-
private BaseItemDust(String unlocalizedName, String materialName, Material matInfo, int colour, String pileSize, int tier, boolean addRecipes) {
super(matInfo, ComponentTypes.DUST);
-
- try {/*
- this.setUnlocalizedName(unlocalizedName);
- this.setMaxStackSize(64);
-
- this.setCreativeTab(tabMisc);
- this.colour = colour;
- this.mTier = tier;
- this.materialName = materialName;
- this.dustInfo = matInfo;
- this.setTextureName(this.getCorrectTexture(pileSize));
- GameRegistry.registerItem(this, unlocalizedName);
-
- String temp = "";
- Logger.WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName());
- if (this.getUnlocalizedName().contains("item.")){
- temp = this.getUnlocalizedName().replace("item.", "");
- Logger.WARNING("Generating OreDict Name: "+temp);
- }
- else {
- temp = this.getUnlocalizedName();
- }
- if (temp.contains("DustTiny")){
- temp = temp.replace("itemD", "d");
- Logger.WARNING("Generating OreDict Name: "+temp);
- }
- else if (temp.contains("DustSmall")){
- temp = temp.replace("itemD", "d");
- Logger.WARNING("Generating OreDict Name: "+temp);
- }
- else {
- temp = temp.replace("itemD", "d");
- Logger.WARNING("Generating OreDict Name: "+temp);
- }
- if ((temp != null) && !temp.equals("")){
- GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this));
- }
- if (addRecipes){
- this.addFurnaceRecipe();
- this.addMacerationRecipe();
- }
- */}
- catch (Throwable t) {
- t.printStackTrace();
- }
}
- private String getCorrectTexture(final String pileSize){
-
- if (!CORE.ConfigSwitches.useGregtechTextures || this.dustInfo.getTextureSet() == null){
- if ((pileSize == "dust") || (pileSize == "Dust")){
- this.setTextureName(CORE.MODID + ":" + "dust");}
- else{
- this.setTextureName(CORE.MODID + ":" + "dust"+pileSize);
- }
- }
-
-
- if (pileSize.toLowerCase().contains("small")){
- return "gregtech" + ":" + "materialicons/"+this.dustInfo.getTextureSet().mSetName+"/dustSmall";
- }
- else if (pileSize.toLowerCase().contains("tiny")){
- return "gregtech" + ":" + "materialicons/"+this.dustInfo.getTextureSet().mSetName+"/dustTiny";
- }
- return "gregtech" + ":" + "materialicons/"+this.dustInfo.getTextureSet().mSetName+"/dust";
- }
-
- /* @Override
- public String getItemStackDisplayName(final ItemStack iStack) {
-
- String unlocal = super.getItemStackDisplayName(iStack);
- if (!unlocal.toLowerCase().contains(".name")) {
- return unlocal;
- }
- else {
- return unlocal;
- }
-
- }*/
-
- /* @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) {
- try {
- if (this.dustInfo != null){
- if (entityHolding instanceof EntityPlayer){
- if (!((EntityPlayer) entityHolding).capabilities.isCreativeMode){
- EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.dustInfo.vRadiationLevel, world, entityHolding);
- }
- }
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- }*/
-
- /*@SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
-
- if (stack.getDisplayName().toLowerCase().contains("fluorite")){
- list.add("Mined from Sandstone and Limestone.");
- }
- if (this.dustInfo != null){
- list.add(this.dustInfo.vChemicalFormula);
- }
- if (this.dustInfo.vRadiationLevel > 0){
- list.add(CORE.GT_Tooltip_Radioactive);
- }
-
-
- //}
- super.addInformation(stack, aPlayer, list, bool);
- }*/
-
public static class DustState {
static final int NORMAL = (1);
static final int SMALL = (10);
@@ -208,8 +87,7 @@ public class BaseItemDust extends BaseItemComponent {
else if (amount == 10) {
doesThings[0] = false;
doesThings[1] = true;
- doesThings[2] = false;
-
+ doesThings[2] = false;
}
else if (amount == 100) {
doesThings[0] = false;
diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java
index e1c3e179ee..e4fa06c58e 100644
--- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java
+++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java
@@ -118,7 +118,7 @@ public class BaseItemDustUnique extends Item{
private String getCorrectTexture(final String pileSize){
if (!CORE.ConfigSwitches.useGregtechTextures){
- if ((pileSize == "dust") || (pileSize == "Dust")){
+ if ((pileSize.equals("dust")) || (pileSize.equals("Dust"))){
this.setTextureName(CORE.MODID + ":" + "dust");}
else{
this.setTextureName(CORE.MODID + ":" + "dust"+pileSize);
diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java
index 21ea826eea..251230932c 100644
--- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java
+++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java
@@ -26,27 +26,43 @@ public class ItemBlockBasicTile extends ItemBlock {
list.add("Can also be placed beside upto 4 other fish traps");
list.add("Requires at least two faces touching water");
list.add("1/1000 chance to produce triple loot.");
- } else if (this.mID == 1) { // Modularity
+ }
+ else if (this.mID == 1) { // Modularity
list.add("Used to construct modular armour & bauble upgrades..");
- } else if (this.mID == 2) { // Trade
+ }
+ else if (this.mID == 2) { // Trade
list.add("Allows for SMP trade-o-mat type trading.");
- } else if (this.mID == 3) { // Project
+ }
+ else if (this.mID == 3) { // Project
list.add("Scan any crafting recipe in this to mass fabricate them in the Autocrafter..");
- } else if (this.mID == 4) { // Circuit Table
+ }
+ else if (this.mID == 4) { // Circuit Table
list.add("Easy Circuit Configuration");
list.add("Change default setting with a Screwdriver");
list.add("Default is used to select slot for auto-insertion");
- } else if (this.mID == 5) { // Decayables Chest
+ }
+ else if (this.mID == 5) { // Decayables Chest
list.add("Chest which holds radioactive materials");
list.add("Items which decay will tick while inside");
list.add("Place with right click");
- } else if (this.mID == 6) { // Butterfly Killer
+ }
+ else if (this.mID == 6) { // Butterfly Killer
list.add("Kills Forestry Butterflies, Bats and other pests");
list.add("Use either Formaldehyde or Hydrogen cyanide");
list.add("Be weary of your neighbours");
- } else {
- list.add("Bad Tooltip ID - " + mID);
+ }
+ else if (this.mID == 7) {
+ }
+ else if (this.mID == 8){
+
+ }
+ else if (this.mID == 9){
+
+ }
+
+ else {
+ list.add("Bad Tooltip ID - " + mID);
}
super.addInformation(stack, aPlayer, list, bool);
}
diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTooltip.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTooltip.java
deleted file mode 100644
index 9badd384d8..0000000000
--- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTooltip.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package gtPlusPlus.core.item.base.itemblock;
-
-import java.util.List;
-
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.item.ItemStack;
-
-import gtPlusPlus.api.interfaces.ITileTooltip;
-
-public class ItemBlockBasicTooltip extends ItemBlock{
-
- protected final int mID;
-
- public ItemBlockBasicTooltip(final Block block) {
- super(block);
- this.mID = ((ITileTooltip) block).getTooltipID();
- }
-
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if (this.mID == 0){ //blockDarkWorldPortalFrame
- list.add("Assembled in the same shape as the Nether Portal.");
- }
- else if (this.mID == 1){ //Modularity
- list.add("Used to construct modular armour & bauble upgrades..");
- }
- }
-
-
-}
diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java
new file mode 100644
index 0000000000..2d0fd00dd9
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java
@@ -0,0 +1,110 @@
+package gtPlusPlus.core.item.base.itemblock;
+import java.util.List;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemBlockWithMetadata;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+
+public class ItemBlockRoundRobinator extends ItemBlockWithMetadata
+{
+ private final Block mBlock;
+
+ public ItemBlockRoundRobinator(final Block aBlock){
+ super(aBlock, aBlock);
+ this.mBlock = aBlock;
+ }
+
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ list.add("Attempts to output items evenly on all four horizontal planes");
+ if (stack.getItemDamage() == 0) {
+ list.add("1 Item per enabled side every 400 ticks");
+ }
+ else if (stack.getItemDamage() == 1) {
+ list.add("1 Item per enabled side every 100 ticks");
+ }
+ else if (stack.getItemDamage() == 2) {
+ list.add("1 Item per enabled side every 20 ticks");
+ }
+ else if (stack.getItemDamage() == 3) {
+ list.add("1 Item per enabled side every 10 ticks");
+ }
+ else if (stack.getItemDamage() == 4) {
+ list.add("1 Item per enabled side every tick");
+ }
+ list.add("Top and bottom do not pull, so you must push items in");
+ list.add("Sides can also be disabled with a screwdriver");
+ list.add("Shift+RMB with empty hand to view inventory contents");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ /**
+ * Gets an icon index based on an item's damage value
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIconFromDamage(final int p_77617_1_)
+ {
+ return this.mBlock.getIcon(0, p_77617_1_);
+ }
+
+ /**
+ * Returns the metadata of the block which this Item (ItemBlock) can place
+ */
+ @Override
+ public int getMetadata(final int p_77647_1_)
+ {
+ return p_77647_1_;
+ }
+
+ @Override
+ public String getUnlocalizedName(final ItemStack stack) {
+ return this.getUnlocalizedName() + "." + stack.getItemDamage();
+ }
+
+ @Override
+ public boolean isDamageable() {
+ return false;
+ }
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
+ return false;
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
+ return false;
+ }
+
+ @Override
+ public int getDisplayDamage(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
+
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public int getItemEnchantability(ItemStack stack) {
+ return 0;
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java b/src/Java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java
index 93a5a969f7..6a8751b682 100644
--- a/src/Java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java
+++ b/src/Java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java
@@ -29,7 +29,7 @@ public class FireProtectionBauble extends BaseBauble {
private static Field isImmuneToFire;
static {
- isImmuneToFire = ReflectionUtils.getField(Entity.class, DevHelper.IsObfuscatedEnvironment() ? "func_70045_F" : "isImmuneToFire");
+ isImmuneToFire = ReflectionUtils.getField(Entity.class, DevHelper.isObfuscatedEnvironment() ? "func_70045_F" : "isImmuneToFire");
}
public static boolean fireImmune(Entity aEntity) {
diff --git a/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java b/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java
index fd0d044c05..0e23e9a845 100644
--- a/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java
+++ b/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java
@@ -2,9 +2,11 @@ package gtPlusPlus.core.item.chemistry;
import java.lang.reflect.Field;
import java.util.ArrayList;
+import java.util.List;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
+import gtPlusPlus.api.helpers.MaterialHelper;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.minecraft.ItemPackage;
@@ -15,6 +17,11 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import gtPlusPlus.plugin.agrichem.BioRecipes;
+import gtPlusPlus.plugin.agrichem.item.algae.ItemAgrichemBase;
+import gtPlusPlus.plugin.agrichem.item.algae.ItemAlgaeBase;
+import gtPlusPlus.plugin.agrichem.item.algae.ItemBioChip;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -41,7 +48,8 @@ public class AgriculturalChem extends ItemPackage {
public static Fluid FertileManureSlurry;
// Blood
public static Fluid CustomBlood;
-
+ // Red Mud
+ public static Fluid RedMud;
/**
* Items
*/
@@ -71,6 +79,64 @@ public class AgriculturalChem extends ItemPackage {
// Fertilizer
+
+ public static Item mAlgae;
+ public static Item mBioCircuit;
+ public static Item mAgrichemItem1;
+
+ /*
+ * 0 - Algae Biomass
+ * 1 - Green Algae Biomass
+ * 2 - Brown Algae Biomass
+ * 3 - Golden-Brown Algae Biomass
+ * 4 - Red Algae Biomass
+ * 5 - Cellulose Fiber
+ * 6 - Golden-Brown Cellulose Fiber
+ * 7 - Red Cellulose Fiber
+ * 8 - Compost
+ * 9 - Wood Pellet
+ * 10 - Wood Brick
+ * 11 - Cellulose Pulp
+ * 12 - Raw Bio Resin
+ * 13 - Catalyst Carrier
+ * 14 - Green Metal Catalyst
+ * 15 - Alginic Acid
+ * 16 - Alumina
+ * 17 - Aluminium Pellet
+ * 18 - Sodium Aluminate
+ * 19 - Sodium Hydroxide // Exists in Newer GT
+ * 20 - Sodium Carbonate
+ * 21 - Lithium Chloride
+ * 22 - Pellet Mold
+ * 23 - Clean Aluminium Mix
+ */
+
+ public static ItemStack mAlgaeBiosmass;
+ public static ItemStack mGreenAlgaeBiosmass;
+ public static ItemStack mBrownAlgaeBiosmass;
+ public static ItemStack mGoldenBrownAlgaeBiosmass;
+ public static ItemStack mRedAlgaeBiosmass;
+ public static ItemStack mCelluloseFiber;
+ public static ItemStack mGoldenBrownCelluloseFiber;
+ public static ItemStack mRedCelluloseFiber;
+ public static ItemStack mCompost;
+ public static ItemStack mWoodPellet;
+ public static ItemStack mWoodBrick;
+ public static ItemStack mCellulosePulp;
+ public static ItemStack mRawBioResin;
+ public static ItemStack mCatalystCarrier;
+ public static ItemStack mGreenCatalyst;
+ public static ItemStack mAlginicAcid;
+ public static ItemStack mAlumina;
+ public static ItemStack mAluminiumPellet;
+ public static ItemStack mSodiumAluminate;
+ public static ItemStack mSodiumHydroxide;
+ public static ItemStack mSodiumCarbonate;
+ public static ItemStack mLithiumChloride;
+ public static ItemStack mPelletMold;
+ public static ItemStack mCleanAluminiumMix;
+
+
@Override
public void items() {
// Nitrogen, Ammonium Nitrate, Phosphates, Calcium, Copper, Carbon
@@ -82,7 +148,100 @@ public class AgriculturalChem extends ItemPackage {
"Ca5(PO4)3(OH)", Utils.rgbtoHexValue(240, 240, 240))[0];
// Dirt Dust :)
- dustDirt = ItemUtils.generateSpecialUseDusts("Dirt", "Dried Earth", Utils.rgbtoHexValue(65, 50, 15))[0];
+ dustDirt = ItemUtils.generateSpecialUseDusts("Dirt", "Dried Earth", Utils.rgbtoHexValue(65, 50, 15))[0];
+
+ mAlgae = new ItemAlgaeBase();
+ mAgrichemItem1 = new ItemAgrichemBase();
+ mBioCircuit = new ItemBioChip();
+ GregtechItemList.Circuit_BioRecipeSelector.set(mBioCircuit);
+
+
+
+ mAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 0, 1);
+ mGreenAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 1, 1);
+ mBrownAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 2, 1);
+ mGoldenBrownAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 3, 1);
+ mRedAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 4, 1);
+ mCelluloseFiber = ItemUtils.simpleMetaStack(mAgrichemItem1, 5, 1);
+ mGoldenBrownCelluloseFiber = ItemUtils.simpleMetaStack(mAgrichemItem1, 6, 1);
+ mRedCelluloseFiber = ItemUtils.simpleMetaStack(mAgrichemItem1, 7, 1);
+ mCompost = ItemUtils.simpleMetaStack(mAgrichemItem1, 8, 1);
+ mWoodPellet = ItemUtils.simpleMetaStack(mAgrichemItem1, 9, 1);
+ mWoodBrick = ItemUtils.simpleMetaStack(mAgrichemItem1, 10, 1);
+ mCellulosePulp = ItemUtils.simpleMetaStack(mAgrichemItem1, 11, 1);
+ mRawBioResin = ItemUtils.simpleMetaStack(mAgrichemItem1, 12, 1);
+ mCatalystCarrier = ItemUtils.simpleMetaStack(mAgrichemItem1, 13, 1);
+ mGreenCatalyst = ItemUtils.simpleMetaStack(mAgrichemItem1, 14, 1);
+ mAlginicAcid = ItemUtils.simpleMetaStack(mAgrichemItem1, 15, 1);
+ mAlumina = ItemUtils.simpleMetaStack(mAgrichemItem1, 16, 1);
+ mAluminiumPellet = ItemUtils.simpleMetaStack(mAgrichemItem1, 17, 1);
+ mSodiumAluminate = ItemUtils.simpleMetaStack(mAgrichemItem1, 18, 1);
+
+ /**
+ * If It exists, don't add a new one.
+ */
+ if (OreDictionary.doesOreNameExist("dustSodiumHydroxide_GT5U") || OreDictionary.doesOreNameExist("dustSodiumHydroxide")) {
+ List<ItemStack> aTest = OreDictionary.getOres("dustSodiumHydroxide", false);
+ ItemStack aTestStack;
+ if (aTest.isEmpty()) {
+ aTest = OreDictionary.getOres("dustSodiumHydroxide_GT5U", false);
+ if (aTest.isEmpty()) {
+ aTestStack = ItemUtils.simpleMetaStack(mAgrichemItem1, 19, 1);
+ }
+ else {
+ aTestStack = aTest.get(0);
+ }
+ }
+ else {
+ aTestStack = aTest.get(0);
+ }
+ mSodiumHydroxide = aTestStack;
+ }
+ else {
+ mSodiumHydroxide = ItemUtils.simpleMetaStack(mAgrichemItem1, 19, 1);
+ }
+ mSodiumCarbonate = ItemUtils.simpleMetaStack(mAgrichemItem1, 20, 1);
+ mLithiumChloride = ItemUtils.simpleMetaStack(mAgrichemItem1, 21, 1);
+ mPelletMold = ItemUtils.simpleMetaStack(mAgrichemItem1, 22, 1);
+ mCleanAluminiumMix = ItemUtils.simpleMetaStack(mAgrichemItem1, 23, 1);
+
+ ItemUtils.addItemToOreDictionary(mGreenAlgaeBiosmass, "biomassGreenAlgae");
+ ItemUtils.addItemToOreDictionary(mBrownAlgaeBiosmass, "biomassBrownAlgae");
+ ItemUtils.addItemToOreDictionary(mGoldenBrownAlgaeBiosmass, "biomassGoldenBrownAlgae");
+ ItemUtils.addItemToOreDictionary(mRedAlgaeBiosmass, "biomassRedAlgae");
+
+ ItemUtils.addItemToOreDictionary(mCelluloseFiber, "fiberCellulose");
+ ItemUtils.addItemToOreDictionary(mGoldenBrownCelluloseFiber, "fiberCellulose");
+ ItemUtils.addItemToOreDictionary(mGoldenBrownCelluloseFiber, "fiberGoldenBrownCellulose");
+ ItemUtils.addItemToOreDictionary(mRedCelluloseFiber, "fiberCellulose");
+ ItemUtils.addItemToOreDictionary(mRedCelluloseFiber, "fiberRedCellulose");
+
+ ItemUtils.addItemToOreDictionary(mWoodPellet, "pelletWood");
+ ItemUtils.addItemToOreDictionary(mWoodBrick, "brickWood");
+ ItemUtils.addItemToOreDictionary(mCellulosePulp, "pulpCellulose");
+
+ ItemUtils.addItemToOreDictionary(mCatalystCarrier, "catalystEmpty");
+ ItemUtils.addItemToOreDictionary(mGreenCatalyst, "catalystAluminiumSilver");
+ ItemUtils.addItemToOreDictionary(mAlginicAcid, "dustAlginicAcid");
+ ItemUtils.addItemToOreDictionary(mAlumina, "dustAlumina");
+ ItemUtils.addItemToOreDictionary(mAluminiumPellet, "pelletAluminium");
+
+ ItemUtils.addItemToOreDictionary(mSodiumAluminate, "dustSodiumAluminate");
+ ItemUtils.addItemToOreDictionary(mSodiumHydroxide, "dustSodiumHydroxide");
+ ItemUtils.addItemToOreDictionary(mSodiumCarbonate, "dustSodiumCarbonate");
+ ItemUtils.addItemToOreDictionary(mLithiumChloride, "dustLithiumChloride");
+
+ //Handle GT NaOH dusts
+ List<ItemStack> NaOHSmall = OreDictionary.getOres("dustSmallSodiumHydroxide_GT5U", false);
+ if (!NaOHSmall.isEmpty()) {
+ ItemUtils.addItemToOreDictionary(NaOHSmall.get(0), "dustSmallSodiumHydroxide");
+ }
+ List<ItemStack> NaOHTiny = OreDictionary.getOres("dustTinySodiumHydroxide_GT5U", false);
+ if (!NaOHTiny.isEmpty()) {
+ ItemUtils.addItemToOreDictionary(NaOHTiny.get(0), "dustTinySodiumHydroxide");
+ }
+
+
}
@Override
@@ -102,7 +261,10 @@ public class AgriculturalChem extends ItemPackage {
// Sewage
FertileManureSlurry = FluidUtils.generateFluidNonMolten("fertile.manure.slurry", "Fertile Manure Slurry",
- 45 + 175, new short[] { 65, 50, 15, 100 }, null, null, 0, true);
+ 45 + 175, new short[] { 65, 50, 15, 100 }, null, null, 0, true);
+
+ RedMud = FluidUtils.generateFluidNoPrefix("mud.red.slurry", "Red Mud Slurry", 32 + 175, new short[] { 180, 35, 25, 100 }, true);
+
}
@@ -156,20 +318,20 @@ public class AgriculturalChem extends ItemPackage {
}
- private static AutoMap<ItemStack> mMeats = new AutoMap<ItemStack>();
- private static AutoMap<ItemStack> mFish = new AutoMap<ItemStack>();
- private static AutoMap<ItemStack> mFruits = new AutoMap<ItemStack>();
- private static AutoMap<ItemStack> mVege = new AutoMap<ItemStack>();
- private static AutoMap<ItemStack> mNuts = new AutoMap<ItemStack>();
- private static AutoMap<ItemStack> mSeeds = new AutoMap<ItemStack>();
- private static AutoMap<ItemStack> mPeat = new AutoMap<ItemStack>();
- private static AutoMap<ItemStack> mBones = new AutoMap<ItemStack>();
- private static AutoMap<ItemStack> mBoneMeal = new AutoMap<ItemStack>();
-
- private static AutoMap<ItemStack> mList_Master_Meats = new AutoMap<ItemStack>();
- private static AutoMap<ItemStack> mList_Master_FruitVege = new AutoMap<ItemStack>();
- private static AutoMap<ItemStack> mList_Master_Bones = new AutoMap<ItemStack>();
- private static AutoMap<ItemStack> mList_Master_Seeds = new AutoMap<ItemStack>();
+ private final static AutoMap<ItemStack> mMeats = new AutoMap<ItemStack>();
+ private final static AutoMap<ItemStack> mFish = new AutoMap<ItemStack>();
+ private final static AutoMap<ItemStack> mFruits = new AutoMap<ItemStack>();
+ private final static AutoMap<ItemStack> mVege = new AutoMap<ItemStack>();
+ private final static AutoMap<ItemStack> mNuts = new AutoMap<ItemStack>();
+ private final static AutoMap<ItemStack> mSeeds = new AutoMap<ItemStack>();
+ private final static AutoMap<ItemStack> mPeat = new AutoMap<ItemStack>();
+ private final static AutoMap<ItemStack> mBones = new AutoMap<ItemStack>();
+ private final static AutoMap<ItemStack> mBoneMeal = new AutoMap<ItemStack>();
+
+ private final static AutoMap<ItemStack> mList_Master_Meats = new AutoMap<ItemStack>();
+ private final static AutoMap<ItemStack> mList_Master_FruitVege = new AutoMap<ItemStack>();
+ private final static AutoMap<ItemStack> mList_Master_Seeds = new AutoMap<ItemStack>();
+ private final static AutoMap<ItemStack> mList_Master_Bones = new AutoMap<ItemStack>();
private static void processAllOreDict() {
processOreDict("listAllmeatraw", mMeats);
@@ -323,6 +485,10 @@ public class AgriculturalChem extends ItemPackage {
}
}
}
+
+ public static ItemStack aFertForestry;
+ public static ItemStack aFertIC2;
+
private static void addMiscRecipes() {
@@ -342,6 +508,7 @@ public class AgriculturalChem extends ItemPackage {
Field aFertField = ReflectionUtils.getField(aItemRegInstance.getClass(), "fertilizerCompound");
Object aItemInstance = aFertField.get(aItemRegInstance);
if (aItemInstance instanceof Item) {
+ aFertForestry = ItemUtils.getSimpleStack((Item) aItemInstance);
Item aForestryFert = (Item) aItemInstance;
CORE.RA.addDehydratorRecipe(
new ItemStack[] { CI.getNumberedCircuit(11), ItemUtils.getSimpleStack(aDustOrganicFert, 4) }, null,
@@ -359,6 +526,7 @@ public class AgriculturalChem extends ItemPackage {
* IC2 Support
*/
if (LoadedMods.IndustrialCraft2) {
+ aFertIC2 = ItemUtils.getItemStackFromFQRN("IC2:itemFertilizer", 1);
CORE.RA.addDehydratorRecipe(
new ItemStack[] { CI.getNumberedCircuit(12), ItemUtils.getSimpleStack(aDustOrganicFert, 4) }, null,
null, new ItemStack[] { ItemUtils.getItemStackFromFQRN("IC2:itemFertilizer", 3), aManureByprod,
@@ -376,8 +544,8 @@ public class AgriculturalChem extends ItemPackage {
GT_Values.RA.addCentrifugeRecipe(CI.getNumberedCircuit(20), ItemUtils.getSimpleStack(aManureByprod, 4),
FluidUtils.getFluidStack("sulfuricacid", 250), // In Fluid
FluidUtils.getFluidStack("sulfuricapatite", 50), // Out Fluid
- Materials.Phosphorus.getDustSmall(2), Materials.Calcium.getDustSmall(2),
- Materials.Copper.getDustTiny(1), Materials.Carbon.getDust(1), ItemUtils.getSimpleStack(dustDirt, 1),
+ MaterialHelper.getDustSmall(Materials.Phosphorus, 2), MaterialHelper.getDustSmall(Materials.Calcium, 2),
+ MaterialHelper.getDustTiny(Materials.Copper, 1), MaterialHelper.getDust(Materials.Carbon, 1), ItemUtils.getSimpleStack(dustDirt, 1),
ItemUtils.getItemStackOfAmountFromOreDict("dustTinyAmmoniumNitrate", 1),
new int[] { 2500, 2500, 750, 1000, 5000, 250 }, // Chances
20 * 20, // Time
@@ -414,6 +582,9 @@ public class AgriculturalChem extends ItemPackage {
addAdvancedOrganiseFertRecipes();
addMiscRecipes();
+
+ BioRecipes.init();
+
return true;
}
}
diff --git a/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java b/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java
index f5ddfa4dd9..8428328f37 100644
--- a/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java
+++ b/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java
@@ -3,18 +3,15 @@ package gtPlusPlus.core.item.chemistry;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
-import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.api.objects.minecraft.ItemPackage;
import gtPlusPlus.core.item.ModItems;
-import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.AddGregtechRecipe;
-import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
@@ -24,7 +21,6 @@ public class CoalTar extends ItemPackage {
public static Fluid Coal_Gas;
public static Fluid Coal_Oil;
public static Fluid Ethylene;
- public static Fluid Benzene;
public static Fluid Ethylbenzene;
public static Fluid Anthracene;
public static Fluid Toluene;
@@ -33,10 +29,6 @@ public class CoalTar extends ItemPackage {
public static Fluid Sulfuric_Coal_Tar_Oil;
public static Fluid Naphthalene;
public static Fluid Phthalic_Acid;
- public static Fluid Ethylanthraquinone2;
- public static Fluid Ethylanthrahydroquinone2;
- public static Fluid Hydrogen_Peroxide;
- public static Fluid Lithium_Peroxide;
private static void recipeEthylBenzineFuelsIntoHeavyFuel() {
CORE.RA.addChemicalRecipe(
@@ -262,77 +254,6 @@ public class CoalTar extends ItemPackage {
}
- private static void recipe2Ethylanthraquinone() {
- GT_Values.RA.addChemicalRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("dustPhthalicAnhydride", 4),
- ItemUtils.getItemStackOfAmountFromOreDict("cellEthylbenzene", 2),
- null,
- FluidUtils.getFluidStack("fluid.2ethylanthraquinone", 2000+(144*4)),
- ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 2),
- 20*16);
-
- }
-
- private static void recipe2Ethylanthrahydroquinone() {
- GT_Values.RA.addChemicalRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("platePalladium", 0),
- ItemUtils.getItemStackOfAmountFromOreDict("cell2Ethylanthraquinone", 1),
- FluidUtils.getFluidStack("hydrogen", 500),
- FluidUtils.getFluidStack("fluid.2ethylanthrahydroquinone", 1200),
- ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 1),
- 20*40);
-
- }
-
- private static void recipeHydrogenPeroxide() {
-
- CORE.RA.addChemicalRecipe(
- GT_ModHandler.getAirCell(15),
- ItemUtils.getItemStackOfAmountFromOreDict("cell2Ethylanthrahydroquinone", 5),
- 20,
- FluidUtils.getFluidStack("fluid.anthracene", 50),
- FluidUtils.getFluidStack("fluid.2ethylanthrahydroquinone", 4450),
- ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenPeroxide", 2),
- CI.emptyCells(18),
- 20*30,
- 240);
-
- }
-
-
- private static void recipeLithiumHydroperoxide() {
-
- CORE.RA.addChemicalRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 7),
- ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenPeroxide", 1),
- 20,
- FluidUtils.getFluidStack("fluid.cellhydrogenperoxide", 50),
- null,
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroperoxide", 14),
- CI.emptyCells(1),
- 20*30,
- 240);
- }
-
-
- private static void recipeLithiumPeroxide() {
- CORE.RA.addDehydratorRecipe(
- new ItemStack[]{
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroperoxide", 2),
- ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 3)
- },
- null,
- null,
- new ItemStack[]{
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumPeroxide", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenPeroxide", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 2)
- },
- new int[]{10000, 10000, 10000},
- 20*100,
- 240);
- }
-
@Override
public String errorMessage() {
return "Bad Coal Science!";
@@ -349,11 +270,6 @@ public class CoalTar extends ItemPackage {
recipeCoalTarOilToSulfuricOilToNaphthalene();
recipeNaphthaleneToPhthalicAcid();
recipePhthalicAcidToPhthalicAnhydride();
- recipe2Ethylanthraquinone();
- recipe2Ethylanthrahydroquinone();
- recipeHydrogenPeroxide();
- recipeLithiumHydroperoxide();
- recipeLithiumPeroxide();
recipeEthylBenzineFuelsIntoHeavyFuel();
@@ -398,19 +314,11 @@ public class CoalTar extends ItemPackage {
//Create Ethylene
- if (!FluidUtils.doesFluidExist("Ethylene")){
- Ethylene = FluidUtils.generateFluidNonMolten("Ethylene", "Ethylene", -103, new short[]{255, 255, 255, 100}, null, null);
+ if (!FluidUtils.doesFluidExist("ethylene")){
+ Ethylene = FluidUtils.generateFluidNonMolten("ethylene", "Ethylene", -103, new short[]{255, 255, 255, 100}, null, null);
}
else {
- Ethylene = FluidUtils.getWildcardFluidStack("Ethylene", 1).getFluid();
- }
-
- //Create Benzene - (Toluene + Hydrogen | 95% Benzene / 5% methane)
- if (!FluidUtils.doesFluidExist("NitrousOxide")){
- Benzene = FluidUtils.generateFluidNonMolten("Benzene", "Benzene", 81, new short[]{150, 75, 0, 100}, null, null);
- }
- else {
- Benzene = FluidUtils.getWildcardFluidStack("Benzene", 1).getFluid();
+ Ethylene = FluidUtils.getWildcardFluidStack("ethylene", 1).getFluid();
}
//Create Ethylbenzene - Ethylbenzene is produced in on a large scale by combining benzene and ethylene in an acid-catalyzed chemical reaction
@@ -419,13 +327,11 @@ public class CoalTar extends ItemPackage {
//Create Anthracene
Anthracene = FluidUtils.generateFluidNonMolten("Anthracene", "Anthracene", 340, new short[]{255, 255, 255, 100}, null, null);
//Toluene
- if (!FluidUtils.doesFluidExist("Toluene")){
- Toluene = FluidUtils.generateFluidNonMolten("Toluene", "Toluene", -95, new short[]{140, 70, 20, 100}, null, null);
+ if (!FluidUtils.doesFluidExist("liquid_toluene")){
+ Toluene = FluidUtils.generateFluidNonMolten("liquid_toluene", "Toluene", -95, new short[]{140, 70, 20, 100}, null, null);
}
else {
- Toluene = FluidUtils.getWildcardFluidStack("Toluene", 1).getFluid();
- Item itemCellToluene = new BaseItemComponent("Toluene", "Toluene", new short[]{140, 70, 20, 100});
- CORE.RA.addFluidCannerRecipe(ItemUtils.getEmptyCell(), ItemUtils.getSimpleStack(itemCellToluene), FluidUtils.getFluidStack(Toluene, 1000), null);
+ Toluene = FluidUtils.getWildcardFluidStack("liquid_toluene", 1).getFluid();
}
//Create Coal Tar
@@ -448,23 +354,6 @@ public class CoalTar extends ItemPackage {
- //Create 2-Ethylanthraquinone
- //2-Ethylanthraquinone is prepared from the reaction of phthalic anhydride and ethylbenzene
- Ethylanthraquinone2 = FluidUtils.generateFluidNonMolten("2Ethylanthraquinone", "2-Ethylanthraquinone", 415, new short[]{227, 255, 159, 100}, null, null);
- //Create 2-Ethylanthrahydroquinone
- //Palladium plate + Hydrogen(250) + 2-Ethylanthraquinone(500) = 600 Ethylanthrahydroquinone
- Ethylanthrahydroquinone2 = FluidUtils.generateFluidNonMolten("2Ethylanthrahydroquinone", "2-Ethylanthrahydroquinone", 415, new short[]{207, 225, 129, 100}, null, null);
- //Create Hydrogen Peroxide
- //Compressed Air(1500) + Ethylanthrahydroquinone(500) + Anthracene(5) = 450 Ethylanthraquinone && 200 Peroxide
- Hydrogen_Peroxide = FluidUtils.generateFluidNonMolten("HydrogenPeroxide", "Hydrogen Peroxide", 150, new short[]{210, 255, 255, 100}, null, null);
-
-
-
- //Lithium Hydroperoxide - LiOH + H2O2 → LiOOH + 2 H2O
- //ItemUtils.generateSpecialUseDusts("LithiumHydroperoxide", "Lithium Hydroperoxide", "HLiO2", Utils.rgbtoHexValue(125, 125, 125));
- // v - Dehydrate
- //Lithium Peroxide - 2 LiOOH → Li2O2 + H2O2 + 2 H2O
- Lithium_Peroxide = FluidUtils.generateFluidNonMolten("LithiumPeroxide", "Lithium Peroxide", 446, new short[]{135, 135, 135, 100}, null, null);
}
diff --git a/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java b/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java
index c64ad07d2a..35d2066793 100644
--- a/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java
+++ b/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java
@@ -1,19 +1,29 @@
package gtPlusPlus.core.item.chemistry;
+import gregtech.api.enums.GT_Values;
import gregtech.api.enums.TextureSet;
+import gregtech.api.util.GT_ModHandler;
import gtPlusPlus.api.objects.minecraft.ItemPackage;
+import gtPlusPlus.core.item.chemistry.general.ItemGenericChemBase;
+import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.ELEMENT;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.MaterialGenerator;
import gtPlusPlus.core.material.MaterialStack;
import gtPlusPlus.core.material.NONMATERIAL;
import gtPlusPlus.core.material.state.MaterialState;
+import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.plugin.agrichem.item.algae.ItemAgrichemBase;
+import net.minecraft.block.Block;
+import net.minecraft.init.Items;
import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
public class GenericChem extends ItemPackage {
@@ -66,12 +76,18 @@ public class GenericChem extends ItemPackage {
public Fluid Putrescine; //https://en.wikipedia.org/wiki/Putrescine
+ public static Fluid Ethylanthraquinone2;
+ public static Fluid Ethylanthrahydroquinone2;
+ public static Fluid Hydrogen_Peroxide;
+ public static Fluid Lithium_Peroxide;
+
/**
* Items
*/
// Phenol Byproducts
public Item PhenolicResins; //https://en.wikipedia.org/wiki/Phenol_formaldehyde_resin
+ public ItemGenericChemBase mGenericChemItem1;
@@ -80,7 +96,46 @@ public class GenericChem extends ItemPackage {
PhenolicResins = ItemUtils.generateSpecialUseDusts("phenolicresins", "Phenolic Resin", "HOC6H4CH2OH", Utils.rgbtoHexValue(80, 40, 40))[0];
MaterialGenerator.generate(BAKELITE, false);
MaterialGenerator.generate(NYLON, false);
- MaterialGenerator.generate(TEFLON, false);
+ MaterialGenerator.generate(TEFLON, false);
+
+ mGenericChemItem1 = new ItemGenericChemBase();
+
+ registerItemStacks();
+ registerOreDict();
+ }
+
+ private ItemStack mCatalystCarrier;
+
+ public ItemStack mRedCatalyst;
+ public ItemStack mYellowCatalyst;
+ public ItemStack mBlueCatalyst;
+ public ItemStack mOrangeCatalyst;
+ public ItemStack mPurpleCatalyst;
+ public ItemStack mBrownCatalyst;
+
+
+ public void registerItemStacks() {
+
+ mCatalystCarrier = ItemUtils.simpleMetaStack(AgriculturalChem.mAgrichemItem1, 13, 1);
+
+ mRedCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 0, 1);
+ mYellowCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 1, 1);
+ mBlueCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 2, 1);
+ mOrangeCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 3, 1);
+ mPurpleCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 4, 1);
+ mBrownCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 5, 1);
+
+ }
+
+ public void registerOreDict() {
+
+ ItemUtils.addItemToOreDictionary(mRedCatalyst, "catalystIronCopper");
+ ItemUtils.addItemToOreDictionary(mYellowCatalyst, "catalystTungstenNickel");
+ ItemUtils.addItemToOreDictionary(mBlueCatalyst, "catalystCobaltTitanium");
+ ItemUtils.addItemToOreDictionary(mOrangeCatalyst, "catalystVanadiumPalladium");
+ ItemUtils.addItemToOreDictionary(mPurpleCatalyst, "catalystIridiumRuthenium");
+ ItemUtils.addItemToOreDictionary(mBrownCatalyst, "catalystNickelAluminium");
+
}
@Override
@@ -115,18 +170,500 @@ public class GenericChem extends ItemPackage {
Cadaverine = FluidUtils.generateFluidNoPrefix("cadaverine", "Cadaverine", 32 + 175, new short[] { 100, 70, 30, 100 }, true);
Putrescine = FluidUtils.generateFluidNoPrefix("putrescine", "Putrescine", 32 + 175, new short[] { 100, 70, 30, 100 }, true);
+ //Create 2-Ethylanthraquinone
+ //2-Ethylanthraquinone is prepared from the reaction of phthalic anhydride and ethylbenzene
+ Ethylanthraquinone2 = FluidUtils.generateFluidNonMolten("2Ethylanthraquinone", "2-Ethylanthraquinone", 415, new short[]{227, 255, 159, 100}, null, null);
+ //Create 2-Ethylanthrahydroquinone
+ //Palladium plate + Hydrogen(250) + 2-Ethylanthraquinone(500) = 600 Ethylanthrahydroquinone
+ Ethylanthrahydroquinone2 = FluidUtils.generateFluidNonMolten("2Ethylanthrahydroquinone", "2-Ethylanthrahydroquinone", 415, new short[]{207, 225, 129, 100}, null, null);
+ //Create Hydrogen Peroxide
+ //Compressed Air(1500) + Ethylanthrahydroquinone(500) + Anthracene(5) = 450 Ethylanthraquinone && 200 Peroxide
+ Hydrogen_Peroxide = FluidUtils.generateFluidNonMolten("HydrogenPeroxide", "Hydrogen Peroxide", 150, new short[]{210, 255, 255, 100}, null, null);
+
+
+
+ //Lithium Hydroperoxide - LiOH + H2O2 → LiOOH + 2 H2O
+ //ItemUtils.generateSpecialUseDusts("LithiumHydroperoxide", "Lithium Hydroperoxide", "HLiO2", Utils.rgbtoHexValue(125, 125, 125));
+ // v - Dehydrate
+ //Lithium Peroxide - 2 LiOOH → Li2O2 + H2O2 + 2 H2O
+ Lithium_Peroxide = FluidUtils.generateFluidNonMolten("LithiumPeroxide", "Lithium Peroxide", 446, new short[]{135, 135, 135, 100}, null, null);
+
+
+
}
@Override
public String errorMessage() {
- // TODO Auto-generated method stub
- return "Failed to generate recipes for AgroChem.";
+ return "Failed to generate recipes for GenericChem.";
}
@Override
- public boolean generateRecipes() {
-
+ public boolean generateRecipes() {
+
+ recipeCatalystRed();
+ recipeCatalystYellow();
+ recipeCatalystBlue();
+ recipeCatalystOrange();
+ recipeCatalystPurple();
+ recipeCatalystBrown();
+
+ recipeNitroBenzene();
+ recipeAniline();
+ recipeCadaverineAndPutrescine();
+ recipeCyclohexane();
+ recipeCyclohexanone();
+
+ recipe2Ethylanthraquinone();
+ recipe2Ethylanthrahydroquinone();
+ recipeHydrogenPeroxide();
+ recipeLithiumHydroperoxide();
+ recipeLithiumPeroxide();
return true;
}
+
+ private void recipeCyclohexane() {
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getTierTwoChip(),
+ ItemUtils.getSimpleStack(mBrownCatalyst, 1)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Benzene, 2000),
+ FluidUtils.getFluidStack("hydrogen", 10000)
+ },
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(mCatalystCarrier, 1)
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Cyclohexane, 1000),
+ },
+ 20 * 120,
+ 120,
+ 2);
+
+ }
+
+ private void recipeCyclohexanone() {
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getTierTwoChip(),
+ ItemUtils.getSimpleStack(mBlueCatalyst, 1)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Cyclohexane, 2000),
+ FluidUtils.getFluidStack("air", 10000)
+ },
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(mCatalystCarrier, 1)
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Cyclohexanone, 2000),
+ },
+ 20 * 120,
+ 120,
+ 2);
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getTierTwoChip(),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Phenol, 2000),
+ FluidUtils.getFluidStack("oxygen", 5000)
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Cyclohexanone, 2000),
+ },
+ 20 * 120,
+ 120,
+ 2);
+
+
+
+
+ }
+
+ private void recipeCatalystRed() {
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ getTierOneChip(),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 10),
+ ELEMENT.getInstance().IRON.getDust(2),
+ ELEMENT.getInstance().COPPER.getDust(2),
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(mRedCatalyst, 10),
+ 20 * 20,
+ 30);
+
+ }
+
+ private void recipeCatalystYellow() {
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ getTierThreeChip(),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 10),
+ ELEMENT.getInstance().TUNGSTEN.getDust(4),
+ ELEMENT.getInstance().NICKEL.getDust(4),
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(mYellowCatalyst, 10),
+ 60 * 20,
+ 2000);
+
+ }
+
+ private void recipeCatalystBlue() {
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ getTierTwoChip(),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 10),
+ ELEMENT.getInstance().COBALT.getDust(3),
+ ELEMENT.getInstance().TITANIUM.getDust(3),
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(mBlueCatalyst, 10),
+ 40 * 20,
+ 500);
+
+ }
+
+ private void recipeCatalystOrange() {
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ getTierTwoChip(),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 10),
+ ELEMENT.getInstance().VANADIUM.getDust(5),
+ ELEMENT.getInstance().PALLADIUM.getDust(5),
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(mOrangeCatalyst, 10),
+ 40 * 20,
+ 500);
+
+ }
+
+ private void recipeCatalystPurple() {
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ getTierFourChip(),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 10),
+ ELEMENT.getInstance().IRIDIUM.getDust(6),
+ ELEMENT.getInstance().RUTHENIUM.getDust(6),
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(mPurpleCatalyst, 10),
+ 120 * 20,
+ 8000);
+
+ }
+
+ private void recipeCatalystBrown() {
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ getTierOneChip(),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 10),
+ ELEMENT.getInstance().NICKEL.getDust(4),
+ ELEMENT.getInstance().ALUMINIUM.getDust(4),
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(mBrownCatalyst, 10),
+ 15 * 20,
+ 30);
+
+ }
+
+ private void recipeCadaverineAndPutrescine() {
+
+ // Basic Recipe
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getTierOneChip(),
+ ItemUtils.getSimpleStack(Items.rotten_flesh, 64)
+ },
+ new FluidStack[] {
+ FluidUtils.getHotWater(2000)
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Cadaverine, 250),
+ FluidUtils.getFluidStack(Putrescine, 250),
+ },
+ 20 * 120,
+ 120,
+ 1);
+
+ // Advanced Recipe
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getTierTwoChip(),
+ ItemUtils.getSimpleStack(Items.rotten_flesh, 128),
+ ItemUtils.simpleMetaStack(AgriculturalChem.mAgrichemItem1, 8, 32)
+ },
+ new FluidStack[] {
+ FluidUtils.getHotWater(3000)
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Cadaverine, 750),
+ FluidUtils.getFluidStack(Putrescine, 750),
+ },
+ 20 * 120,
+ 240,
+ 2);
+
+ }
+
+ private void recipeAniline() {
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getTierThreeChip(),
+ ItemUtils.getSimpleStack(mBlueCatalyst, 1)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(NitroBenzene, 2000),
+ FluidUtils.getFluidStack("hydrogen", 10000)
+ },
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(mCatalystCarrier, 1)
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Aniline, 2000),
+ },
+ 20 * 30,
+ 500,
+ 3);
+
+ }
+
+ private void recipeNitroBenzene() {
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getTierThreeChip(),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Benzene, 5000),
+ FluidUtils.getFluidStack("sulfuricacid", 3000),
+ FluidUtils.getFluidStack("nitricacid", 3000),
+ FluidUtils.getDistilledWater(10000)
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("dilutedsulfuricacid", 3000),
+ FluidUtils.getFluidStack(NitroBenzene, 5000),
+ },
+ 20 * 30,
+ 500,
+ 3);
+
+ }
+
+ private void recipe2Ethylanthraquinone() {
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(4),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustPhthalicAnhydride", 4),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(CoalTar.Ethylbenzene, 2000),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Ethylanthraquinone2, 2000+(144*4)),
+ },
+ 20 * 15,
+ 120,
+ 1);
+
+ /*GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustPhthalicAnhydride", 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellEthylbenzene", 2),
+ null,
+ FluidUtils.getFluidStack("fluid.2ethylanthraquinone", 2000+(144*4)),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 2),
+ 20*16);*/
+
+ }
+
+ private void recipe2Ethylanthrahydroquinone() {
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(4),
+ ItemUtils.getSimpleStack(mOrangeCatalyst, 1),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Ethylanthraquinone2, 4000),
+ FluidUtils.getFluidStack("hydrogen", 2000),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Ethylanthrahydroquinone2, 5000),
+ },
+ 20 * 40,
+ 120,
+ 1);
+
+ /*GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("platePalladium", 0),
+ ItemUtils.getItemStackOfAmountFromOreDict("cell2Ethylanthraquinone", 1),
+ FluidUtils.getFluidStack("hydrogen", 500),
+ FluidUtils.getFluidStack("fluid.2ethylanthrahydroquinone", 1200),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 1),
+ 20*40);*/
+
+ }
+
+ private void recipeLithiumPeroxide() {
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[]{
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroperoxide", 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 3)
+ },
+ null,
+ null,
+ new ItemStack[]{
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumPeroxide", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenPeroxide", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 2)
+ },
+ new int[]{10000, 10000, 10000},
+ 20*100,
+ 120);
+ }
+
+ private void recipeLithiumHydroperoxide() {
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(4),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 7),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("fluid.hydrogenperoxide", 2000),
+ },
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroperoxide", 14),
+ },
+ new FluidStack[] {
+
+ },
+ 20 * 30,
+ 240,
+ 1);
+
+
+
+ /*CORE.RA.addChemicalRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 7),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenPeroxide", 1),
+ 20,
+ FluidUtils.getFluidStack("fluid.cellhydrogenperoxide", 50),
+ null,
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroperoxide", 14),
+ CI.emptyCells(1),
+ 20*30,
+ 240); */
+ }
+
+ private void recipeHydrogenPeroxide() {
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(4),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("air", 15000),
+ FluidUtils.getFluidStack(Ethylanthrahydroquinone2, 5000),
+ FluidUtils.getFluidStack("fluid.anthracene", 50),
+ },
+ new ItemStack[] {
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(Ethylanthraquinone2, 4000),
+ FluidUtils.getFluidStack("fluid.hydrogenperoxide", 2000),
+ },
+ 20 * 30,
+ 240,
+ 1);
+
+ /* CORE.RA.addChemicalRecipe(
+ GT_ModHandler.getAirCell(15),
+ ItemUtils.getItemStackOfAmountFromOreDict("cell2Ethylanthrahydroquinone", 5),
+ 20,
+ FluidUtils.getFluidStack("fluid.anthracene", 50),
+ FluidUtils.getFluidStack("fluid.2ethylanthrahydroquinone", 4450),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenPeroxide", 2),
+ CI.emptyCells(18),
+ 20*30,
+ 240);*/
+
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ private static final ItemStack getTierOneChip() {
+ return CI.getNumberedBioCircuit(4);
+ }
+ private static final ItemStack getTierTwoChip() {
+ return CI.getNumberedBioCircuit(8);
+ }
+ private static final ItemStack getTierThreeChip() {
+ return CI.getNumberedBioCircuit(12);
+ }
+ private static final ItemStack getTierFourChip() {
+ return CI.getNumberedBioCircuit(16);
+ }
+
+
+
}
diff --git a/src/Java/gtPlusPlus/core/item/chemistry/OilChem.java b/src/Java/gtPlusPlus/core/item/chemistry/OilChem.java
index 4fe9347324..4406995d27 100644
--- a/src/Java/gtPlusPlus/core/item/chemistry/OilChem.java
+++ b/src/Java/gtPlusPlus/core/item/chemistry/OilChem.java
@@ -1,16 +1,6 @@
package gtPlusPlus.core.item.chemistry;
-import java.util.ArrayList;
-
-import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.minecraft.ItemPackage;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.minecraft.FluidUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.oredict.OreDictionary;
public class OilChem extends ItemPackage {
@@ -18,54 +8,16 @@ public class OilChem extends ItemPackage {
* Fluids
*/
- // Poop Juice
- public static Fluid PoopJuice;
- // Manure Slurry
- public static Fluid ManureSlurry;
- // Fertile Manure Slurry
- public static Fluid FertileManureSlurry;
/**
* Items
*/
- // Manure Byproducts
- public static Item dustManureByproducts;
- // Organic Fertilizer
- public static Item dustOrganicFertilizer;
- // Dirt
- public static Item dustDirt;
-
- // Poop Juice
- // vv - Centrifuge
- // Manure Slurry && Manure Byproducts -> (Elements) Centrifuge to several tiny
- // piles
- // vv - Chem Reactor - Add Peat, Meat
- // Organic Fertilizer
- // vv - Dehydrate
- // Fertilizer
-
- // Poop Juice
- // vv - Mixer - Add Blood, Bone, Meat (1000L Poo, 200L Blood, x2 Bone, x3 Meat)
- // Fertile Manure Slurry
- // vv - Chem Reactor - Add Peat x1.5
- // Organic Fertilizer x3
- // vv - Dehydrate
- // Fertilizer
@Override
public void items() {
- // Nitrogen, Ammonium Nitrate, Phosphates, Calcium, Copper, Carbon
- dustManureByproducts = ItemUtils.generateSpecialUseDusts("ManureByproducts", "Manure Byproduct",
- "(N2H4O3)N2P2Ca3CuC8", Utils.rgbtoHexValue(110, 75, 25))[0];
-
- // Basically Guano
- dustOrganicFertilizer = ItemUtils.generateSpecialUseDusts("OrganicFertilizer", "Organic Fertilizer",
- "Ca5(PO4)3(OH)", Utils.rgbtoHexValue(240, 240, 240))[0];
-
- // Dirt Dust :)
- dustDirt = ItemUtils.generateSpecialUseDusts("Dirt", "Dried Earth", Utils.rgbtoHexValue(65, 50, 15))[0];
+
}
@Override
@@ -75,126 +27,19 @@ public class OilChem extends ItemPackage {
@Override
public void fluids() {
- // Sewage
- PoopJuice = FluidUtils.generateFluidNonMolten("raw.waste", "Raw Animal Waste", 32 + 175,
- new short[] { 100, 70, 30, 100 }, null, null, 0, true);
-
- // Sewage
- ManureSlurry = FluidUtils.generateFluidNonMolten("manure.slurry", "Manure Slurry", 39 + 175,
- new short[] { 75, 45, 15, 100 }, null, null, 0, true);
-
- // Sewage
- FertileManureSlurry = FluidUtils.generateFluidNonMolten("fertile.manure.slurry", "Fertile Manure Slurry",
- 45 + 175, new short[] { 65, 50, 15, 100 }, null, null, 0, true);
- }
-
- private static AutoMap<ItemStack> mMeats = new AutoMap<ItemStack>();
- private static AutoMap<ItemStack> mFish = new AutoMap<ItemStack>();
- private static AutoMap<ItemStack> mFruits = new AutoMap<ItemStack>();
- private static AutoMap<ItemStack> mVege = new AutoMap<ItemStack>();
- private static AutoMap<ItemStack> mNuts = new AutoMap<ItemStack>();
- private static AutoMap<ItemStack> mSeeds = new AutoMap<ItemStack>();
- private static AutoMap<ItemStack> mPeat = new AutoMap<ItemStack>();
- private static AutoMap<ItemStack> mBones = new AutoMap<ItemStack>();
- private static AutoMap<ItemStack> mBoneMeal = new AutoMap<ItemStack>();
-
- private static AutoMap<ItemStack> mList_Master_Meats = new AutoMap<ItemStack>();
- private static AutoMap<ItemStack> mList_Master_FruitVege = new AutoMap<ItemStack>();
- private static AutoMap<ItemStack> mList_Master_Bones = new AutoMap<ItemStack>();
- private static AutoMap<ItemStack> mList_Master_Seeds = new AutoMap<ItemStack>();
-
- private static void processAllOreDict() {
- processOreDict("listAllmeatraw", mMeats);
- processOreDict("listAllfishraw", mFish);
- processOreDict("listAllfruit", mFruits);
- processOreDict("listAllVeggie", mVege);
- processOreDict("listAllnut", mNuts);
- processOreDict("listAllSeed", mSeeds);
- processOreDict("brickPeat", mPeat);
- processOreDict("bone", mBones);
- processOreDict("dustBone", mBoneMeal);
- // Just make a mega list, makes life easier.
- if (!mMeats.isEmpty()) {
- for (ItemStack g : mMeats) {
- mList_Master_Meats.put(g);
- }
- }
- if (!mFish.isEmpty()) {
- for (ItemStack g : mFish) {
- mList_Master_Meats.put(g);
- }
- }
- if (!mFruits.isEmpty()) {
- for (ItemStack g : mFruits) {
- mList_Master_FruitVege.put(g);
- }
- }
- if (!mVege.isEmpty()) {
- for (ItemStack g : mVege) {
- mList_Master_FruitVege.put(g);
- }
- }
- if (!mNuts.isEmpty()) {
- for (ItemStack g : mNuts) {
- mList_Master_FruitVege.put(g);
- }
- }
- if (!mSeeds.isEmpty()) {
- for (ItemStack g : mSeeds) {
- mList_Master_Seeds.put(g);
- }
- }
- if (!mBoneMeal.isEmpty()) {
- for (ItemStack g : mBoneMeal) {
- mList_Master_Bones.put(g);
- }
- }
- if (!mBones.isEmpty()) {
- for (ItemStack g : mBones) {
- mList_Master_Bones.put(g);
- }
- }
- }
-
- private static void processOreDict(String aOreName, AutoMap<ItemStack> aMap) {
- ArrayList<ItemStack> aTemp = OreDictionary.getOres(aOreName);
- if (!aTemp.isEmpty()) {
- for (ItemStack stack : aTemp) {
- aMap.put(stack);
- }
- }
+
}
- private static void addBasicSlurryRecipes() {}
-
- private static void addAdvancedSlurryRecipes() {}
-
- private static void addBasicOrganiseFertRecipes() {}
-
- private static void addAdvancedOrganiseFertRecipes() {}
-
- private static void addMiscRecipes() {}
+
@Override
public String errorMessage() {
- return "Failed to generate recipes for AgroChem.";
+ return "Failed to generate recipes for OilChem.";
}
@Override
public boolean generateRecipes() {
- // Organise OreDict
- processAllOreDict();
-
- // Slurry Production
- addBasicSlurryRecipes();
- addAdvancedSlurryRecipes();
-
- // Organic Fert. Production
- addBasicOrganiseFertRecipes();
- addAdvancedOrganiseFertRecipes();
-
- addMiscRecipes();
return true;
}
}
diff --git a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java
index c02e767dcd..bbdf322817 100644
--- a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java
+++ b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java
@@ -9,6 +9,7 @@ import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.Recipe_GT;
+import gtPlusPlus.api.helpers.MaterialHelper;
import gtPlusPlus.api.objects.minecraft.ItemPackage;
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.lib.CORE;
@@ -292,7 +293,7 @@ public class RocketFuels extends ItemPackage {
GT_Values.RA.addCentrifugeRecipe(
CI.getNumberedCircuit(23),
- ItemUtils.getItemStackOfAmountFromOreDict("cellRP1Fuel", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellRP1", 1),
FluidUtils.getFluidStack(Liquid_Oxygen, 4000),
FluidUtils.getFluidStack(RP1_Plus_Liquid_Oxygen, 200),
CI.emptyCells(1),
@@ -478,15 +479,17 @@ public class RocketFuels extends ItemPackage {
}
+ MaterialHelper.getCells(aMaterial_Water, 1);
+
ItemStack aCellEmpty = CI.emptyCells(1);
- ItemStack aCellWater = aMaterial_Water.getCells(1);
- ItemStack aCellOxygen = aMaterial_Oxygen.getCells(1);
- ItemStack aCellChloramine = aMaterial_Chloramine.getCells(1);
- ItemStack aCellDimethylamine = aMaterial_Dimethylamine.getCells(1);
- ItemStack aCellDilutedHydrochloricAcid = aMaterial_DilutedHydrochloricAcid.getCells(1);
- ItemStack aCellNitrogenDioxide = aMaterial_NitrogenDioxide.getCells(1);
- ItemStack aCellDinitrogenTetroxide = aMaterial_DinitrogenTetroxide.getCells(1);
- ItemStack aCellDimethylhydrazine = aMaterial_Dimethylhydrazine.getCells(1);
+ ItemStack aCellWater = MaterialHelper.getCells(aMaterial_Water, 1);
+ ItemStack aCellOxygen = MaterialHelper.getCells(aMaterial_Oxygen, 1);
+ ItemStack aCellChloramine = MaterialHelper.getCells(aMaterial_Chloramine, 1);
+ ItemStack aCellDimethylamine = MaterialHelper.getCells(aMaterial_Dimethylamine, 1);
+ ItemStack aCellDilutedHydrochloricAcid = MaterialHelper.getCells(aMaterial_DilutedHydrochloricAcid, 1);
+ ItemStack aCellNitrogenDioxide = MaterialHelper.getCells(aMaterial_NitrogenDioxide, 1);
+ ItemStack aCellDinitrogenTetroxide = MaterialHelper.getCells(aMaterial_DinitrogenTetroxide, 1);
+ ItemStack aCellDimethylhydrazine = MaterialHelper.getCells(aMaterial_Dimethylhydrazine, 1);
@@ -671,7 +674,17 @@ public class RocketFuels extends ItemPackage {
//Register default fluids
Diesel = MaterialUtils.getMaterial("Fuel", "Diesel").getFluid(1).getFluid();
- Oil_Heavy = MaterialUtils.getMaterial("OilHeavy", "Oil").getFluid(1).getFluid();
+
+ // 5.08 Compat
+ if (!FluidUtils.doesFluidExist("liquid_heavy_oil")){
+ Oil_Heavy = FluidUtils.generateFluidNoPrefix("liquid_heavy_oil", "Heavy Oil", 200, new short[]{10, 10, 10, 100});
+ }
+ else {
+ Oil_Heavy = MaterialUtils.getMaterial("OilHeavy", "Oil").getFluid(1).getFluid();
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellOilHeavy", 1) == null){
+ new BaseItemComponent("OilHeavy", "Heavy Oil", new short[] {10, 10, 10});
+ }
+ }
//Create Kerosene
@@ -679,7 +692,7 @@ public class RocketFuels extends ItemPackage {
CoalTar.Coal_Oil = Kerosene;
//RP! Focket Fuel
- RP1 = FluidUtils.generateFluidNonMolten("RP1Fuel", "RP-1 Rocket Fuel", 500, new short[]{210, 50, 50, 100}, null, null);
+ RP1 = FluidUtils.generateFluidNonMolten("RP1Fuel", "RP-1", 500, new short[]{210, 50, 50, 100}, null, null);
//Create Nitrogen Tetroxide
Nitrogen_Tetroxide = FluidUtils.generateFluidNonMolten("NitrogenTetroxide", "Nitrogen Tetroxide", -11, new short[]{170, 170, 0, 100}, null, null);
@@ -753,7 +766,7 @@ public class RocketFuels extends ItemPackage {
Formaldehyde = FluidUtils.generateFluidNonMolten("Formaldehyde", "Formaldehyde", -92, new short[]{150, 75, 150, 100}, null, null);
Unsymmetrical_Dimethylhydrazine_Plus_Nitrogen_Tetroxide = FluidUtils.generateFluidNonMolten("RocketFuelMixA", "H8N4C2O4 Rocket Fuel", -185, new short[]{50, 220, 50, 100}, null, null);
- RP1_Plus_Liquid_Oxygen = FluidUtils.generateFluidNonMolten("RocketFuelMixB", "Rp-1 Fuel Mixture", -250, new short[]{250, 50, 50, 100}, null, null);
+ RP1_Plus_Liquid_Oxygen = FluidUtils.generateFluidNonMolten("RocketFuelMixB", "Rp-1 Rocket Fuel", -250, new short[]{250, 50, 50, 100}, null, null);
Monomethylhydrazine_Plus_Nitric_Acid = FluidUtils.generateFluidNonMolten("RocketFuelMixC", "CN3H7O3 Rocket Fuel", -300, new short[]{125, 75, 180, 100}, null, null);
Dense_Hydrazine_Mix = FluidUtils.generateFluidNonMolten("RocketFuelMixD", "Dense Hydrazine Fuel Mixture", -250, new short[]{175, 80, 120, 100}, null, null);
diff --git a/src/Java/gtPlusPlus/core/item/chemistry/StandardBaseParticles.java b/src/Java/gtPlusPlus/core/item/chemistry/StandardBaseParticles.java
index 1e833a7b00..10eaaf0da9 100644
--- a/src/Java/gtPlusPlus/core/item/chemistry/StandardBaseParticles.java
+++ b/src/Java/gtPlusPlus/core/item/chemistry/StandardBaseParticles.java
@@ -149,7 +149,7 @@ public class StandardBaseParticles extends BaseItemParticle {
@Override
public void registerIcons(IIconRegister reg) {
for (int i = 0; i < this.icons.length; i++) {
- this.icons[i] = reg.registerIcon(CORE.MODID + ":" + "particle/"+i);
+ this.icons[i] = reg.registerIcon(CORE.MODID + ":" + "particle/new/"+i);
}
}
diff --git a/src/Java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java b/src/Java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java
new file mode 100644
index 0000000000..8a003ec7aa
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java
@@ -0,0 +1,162 @@
+package gtPlusPlus.core.item.chemistry.general;
+
+import java.util.List;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.World;
+
+public class ItemGenericChemBase extends Item {
+
+ final protected IIcon base[];
+
+ final private int aMetaSize = 6;
+
+ /*
+ * 0 - Red Metal Catalyst //FeCu
+ * 1 - Yellow Metal Catalyst //WNi
+ * 2 - Blue Metal Catalyst //CoTi
+ * 3 - Orange Metal Catalyst //Vanadium Pd
+ * 4 - Purple Metal Catalyst //IrIdium Ruthenium
+ * 5 - Brown Metal Catalyst //NiAl
+ *
+ */
+
+ public ItemGenericChemBase() {
+ this.setHasSubtypes(true);
+ this.setNoRepair();
+ this.setMaxStackSize(64);
+ this.setMaxDamage(0);
+ base = new IIcon[aMetaSize];
+ this.setUnlocalizedName("BasicGenericChemItem");
+ GameRegistry.registerItem(this, this.getUnlocalizedName());
+ }
+
+ @Override
+ public boolean isDamageable() {
+ return false;
+ }
+
+ @Override
+ public boolean shouldRotateAroundWhenRendering() {
+ return super.shouldRotateAroundWhenRendering();
+ }
+
+ @Override
+ public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
+ super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack aStack) {
+ return super.getItemStackDisplayName(aStack);
+ }
+
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) {
+ try {
+
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ }
+ super.addInformation(aStack, p_77624_2_, aList, p_77624_4_);
+ }
+
+ @Override
+ public EnumRarity getRarity(ItemStack p_77613_1_) {
+ return EnumRarity.common;
+ }
+
+ @Override
+ public boolean requiresMultipleRenderPasses() {
+ return false;
+ }
+
+ @Override
+ public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) {
+ for (int i=0;i<aMetaSize;i++) {
+ aList.add(ItemUtils.simpleMetaStack(aItem, i, 1));
+ }
+ }
+
+ @Override
+ public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
+ return false;
+ }
+
+ @Override
+ public boolean isRepairable() {
+ return false;
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
+ return false;
+ }
+
+ @Override
+ public int getDisplayDamage(ItemStack stack) {
+ return stack.getItemDamage();
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public int getItemEnchantability(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public void registerIcons(final IIconRegister u) {
+ for (int i=0;i<this.aMetaSize;i++) {
+ String aPath = CORE.MODID + ":" + "science/general/MetaItem1/"+i;
+ this.base[i] = u.registerIcon(aPath);
+ }
+ }
+
+
+ @Override
+ public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
+ return this.base[damage];
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int damage) {
+ return this.base[damage];
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
+ return this.base[stack.getItemDamage()];
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack stack, int pass) {
+ return this.base[stack.getItemDamage()];
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack stack) {
+ return super.getUnlocalizedName() + "." + stack.getItemDamage();
+ }
+
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java b/src/Java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java
index 1c28f99ff8..3f8e31d8d2 100644
--- a/src/Java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java
+++ b/src/Java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java
@@ -26,7 +26,9 @@ public class ItemDummyResearch extends ItemGenericToken {
RESEARCH_4_BASIC_PHYSICS("Basic Physics", "Fundamental laws of motion"),
RESEARCH_5_ADV_PHYSICS("Advanced Physics", "Advanced knowledge!"),
RESEARCH_6_BASIC_METALLURGY("Basic Metallurgy", "Information about material smelting"),
- RESEARCH_7_ADV_METALLURGY("Advanced Metallurgy", "Advanced Material Sciences!");
+ RESEARCH_7_ADV_METALLURGY("Advanced Metallurgy", "Advanced Material Sciences!"),
+ RESEARCH_8_TURBINE_AUTOMATION("Turbine Automation", "You really don't want to share this with anyone!"),
+ RESEARCH_9_CLOAKING("Cloaking Technologies", "Sneaking around like a mouse");
diff --git a/src/Java/gtPlusPlus/core/item/general/ItemControlCore.java b/src/Java/gtPlusPlus/core/item/general/ItemControlCore.java
index 5ef72b6f17..b74b7972be 100644
--- a/src/Java/gtPlusPlus/core/item/general/ItemControlCore.java
+++ b/src/Java/gtPlusPlus/core/item/general/ItemControlCore.java
@@ -71,6 +71,9 @@ public class ItemControlCore extends Item {
@Override
public String getItemStackDisplayName(final ItemStack tItem) {
+ if (tItem == null) {
+ return "Control Core";
+ }
String aReturnValue = super.getItemStackDisplayName(tItem);
if (tItem != null) {
try {
diff --git a/src/Java/gtPlusPlus/core/item/general/ItemGenericToken.java b/src/Java/gtPlusPlus/core/item/general/ItemGenericToken.java
index c076bf5c95..21d2c6e120 100644
--- a/src/Java/gtPlusPlus/core/item/general/ItemGenericToken.java
+++ b/src/Java/gtPlusPlus/core/item/general/ItemGenericToken.java
@@ -148,8 +148,19 @@ public class ItemGenericToken extends CoreItem {
}
@Override
- public int getItemStackLimit(ItemStack stack) {
- return mMaxStackSizes.get(stack.getItemDamage());
+ public int getItemStackLimit(ItemStack aStack) {
+ if (aStack == null) {
+ return getItemStackLimit();
+ }
+ else {
+ Integer aSize = mMaxStackSizes.get(aStack.getItemDamage());
+ if (aSize != null) {
+ return aSize;
+ }
+ else {
+ return getItemStackLimit();
+ }
+ }
}
@Override
diff --git a/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java b/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java
index c8acdc2152..82bb29b5bf 100644
--- a/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java
+++ b/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java
@@ -2,23 +2,10 @@ package gtPlusPlus.core.item.general;
import java.util.List;
-import cpw.mods.fml.common.Optional;
-import cpw.mods.fml.common.registry.GameRegistry;
-
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraft.world.World;
-
import baubles.api.BaubleType;
import baubles.api.IBauble;
+import cpw.mods.fml.common.Optional;
+import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
@@ -31,6 +18,16 @@ import gtPlusPlus.xmod.gregtech.common.helpers.ChargingHelper;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.item.IElectricItemManager;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.World;
@Optional.InterfaceList(value = {@Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles"), @Optional.Interface(iface = "baubles.api.BaubleType", modid = "Baubles")})
public class ItemHealingDevice extends Item implements IElectricItem, IElectricItemManager, IBauble{
@@ -232,7 +229,7 @@ public class ItemHealingDevice extends Item implements IElectricItem, IElectricI
@Override //TODO
public void onWornTick(final ItemStack aBaubleStack, final EntityLivingBase arg1) {
- if (!arg1.worldObj.isRemote){
+ if (arg1 != null && arg1.worldObj != null && !arg1.worldObj.isRemote){
//Try Charge First
diff --git a/src/Java/gtPlusPlus/core/item/general/ItemSlowBuildingRing.java b/src/Java/gtPlusPlus/core/item/general/ItemSlowBuildingRing.java
index 09c23d3551..fa008bf1a3 100644
--- a/src/Java/gtPlusPlus/core/item/general/ItemSlowBuildingRing.java
+++ b/src/Java/gtPlusPlus/core/item/general/ItemSlowBuildingRing.java
@@ -2,10 +2,15 @@ package gtPlusPlus.core.item.general;
import java.util.List;
+import baubles.api.BaubleType;
+import baubles.api.IBauble;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.registry.GameRegistry;
-
-import net.minecraft.client.Minecraft;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.handler.events.CustomMovementHandler;
+import gtPlusPlus.core.handler.events.SneakManager;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -14,14 +19,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-import baubles.api.BaubleType;
-import baubles.api.IBauble;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.handler.events.CustomMovementHandler;
-import gtPlusPlus.core.handler.events.SneakManager;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-
@Optional.InterfaceList(value = {@Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles"), @Optional.Interface(iface = "baubles.api.BaubleType", modid = "Baubles")})
public class ItemSlowBuildingRing extends Item implements IBauble{
@@ -84,7 +81,17 @@ public class ItemSlowBuildingRing extends Item implements IBauble{
@Override //TODO
public void onEquipped(final ItemStack arg0, final EntityLivingBase arg1) {
- doEffect(arg1);
+ try {
+ EntityPlayer aPlayer;
+ if (arg1 instanceof EntityPlayer) {
+ aPlayer = (EntityPlayer) arg1;
+ SneakManager s = SneakManager.get(aPlayer);
+ s.putRingOn();
+ }
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ }
}
@Override //TODO
@@ -94,8 +101,7 @@ public class ItemSlowBuildingRing extends Item implements IBauble{
if (arg1 instanceof EntityPlayer) {
aPlayer = (EntityPlayer) arg1;
SneakManager s = SneakManager.get(aPlayer);
- s.setSprintingStateON();
- s.setCrouchingStateOFF();
+ s.takeRingOff();
}
}
catch (Throwable t) {
@@ -111,11 +117,8 @@ public class ItemSlowBuildingRing extends Item implements IBauble{
private static void doEffect(final EntityLivingBase arg1){
try {
// Get World
- World aWorld = arg1.worldObj;
- if (arg1.worldObj.isRemote){
- return;
- }
- if (aWorld != null) {
+ World aWorld = arg1.worldObj;
+ if (aWorld != null && !aWorld.isRemote) {
EntityPlayer aPlayer;
if (arg1 instanceof EntityPlayer) {
aPlayer = (EntityPlayer) arg1;
@@ -125,9 +128,7 @@ public class ItemSlowBuildingRing extends Item implements IBauble{
}
if (aPlayer.isSprinting()) {
aPlayer.setSprinting(false);
- }
- s.setSprintingStateOFF();
- s.setCrouchingStateON();
+ }
}
}
}
diff --git a/src/Java/gtPlusPlus/core/item/tool/misc/DebugScanner.java b/src/Java/gtPlusPlus/core/item/tool/misc/DebugScanner.java
index d0f3005d00..0170df0dc7 100644
--- a/src/Java/gtPlusPlus/core/item/tool/misc/DebugScanner.java
+++ b/src/Java/gtPlusPlus/core/item/tool/misc/DebugScanner.java
@@ -7,6 +7,7 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
+import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
@@ -62,19 +63,22 @@ public class DebugScanner extends CoreItem {
PlayerUtils.messagePlayer(player, "Invisible? "+entity.isInvisible());
PlayerUtils.messagePlayer(player, "Age: "+entity.ticksExisted);
- if (entity instanceof EntityLiving) {
- EntityLiving g = (EntityLiving) entity;
+ if (entity instanceof EntityLivingBase) {
+ EntityLivingBase g = (EntityLivingBase) entity;
PlayerUtils.messagePlayer(player, "Health: "+g.getHealth()+"/"+g.getMaxHealth());
PlayerUtils.messagePlayer(player, "On ground? "+g.onGround);
- PlayerUtils.messagePlayer(player, "Can Loot? "+g.canPickUpLoot());
- PlayerUtils.messagePlayer(player, "Child? "+g.isChild());
- if (entity instanceof EntityPlayer) {
- EntityPlayer y = (EntityPlayer) entity;
- PlayerUtils.messagePlayer(player, "Experience: "+y.experience);
- PlayerUtils.messagePlayer(player, "Name: "+y.getCommandSenderName());
- }
+ PlayerUtils.messagePlayer(player, "Child? "+g.isChild());
+ }
+ if (entity instanceof EntityLiving) {
+ EntityLiving g = (EntityLiving) entity;
+ PlayerUtils.messagePlayer(player, "Can Loot? "+g.canPickUpLoot());
}
+ if (entity instanceof EntityPlayer) {
+ EntityPlayer y = (EntityPlayer) entity;
+ PlayerUtils.messagePlayer(player, "Experience: "+y.experience);
+ PlayerUtils.messagePlayer(player, "Name: "+y.getCommandSenderName());
+ }
}
return true;
diff --git a/src/Java/gtPlusPlus/core/item/tool/misc/GregtechPump.java b/src/Java/gtPlusPlus/core/item/tool/misc/GregtechPump.java
index 0c31b999cd..a48573888e 100644
--- a/src/Java/gtPlusPlus/core/item/tool/misc/GregtechPump.java
+++ b/src/Java/gtPlusPlus/core/item/tool/misc/GregtechPump.java
@@ -1127,7 +1127,7 @@ public class GregtechPump extends Item implements ISpecialElectricItem, IElectri
else if ((aTileEntity instanceof IFluidTank || aTileEntity instanceof IFluidHandler)) {
if (aTileEntity instanceof IFluidTank) {
Logger.INFO("Tile Was instanceof IFluidTank.");
- FluidStack f = ((IFluidTank) aTileEntity).getFluid();
+ FluidStack f = ((IFluidTank) aTileEntity).getFluid();
if (aSetFluid == null) {
aSetFluid = f;
aSetFluid.amount = f.amount;
diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java
index 04f1861cfe..2a267dc16d 100644
--- a/src/Java/gtPlusPlus/core/lib/CORE.java
+++ b/src/Java/gtPlusPlus/core/lib/CORE.java
@@ -5,10 +5,13 @@ import java.util.concurrent.ConcurrentHashMap;
import com.mojang.authlib.GameProfile;
+import cpw.mods.fml.common.FMLCommonHandler;
import gregtech.api.GregTech_API;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.api.objects.random.XSTR;
import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.core.util.sys.GeoUtils;
import gtPlusPlus.core.util.sys.NetworkUtils;
import gtPlusPlus.preloader.CORE_Preloader;
@@ -52,7 +55,7 @@ public class CORE {
public static final String name = "GT++";
public static final String MODID = "miscutils";
- public static final String VERSION = "1.7.03.01";
+ public static final String VERSION = "1.7.03.45";
public static String MASTER_VERSION = NetworkUtils.getContentFromURL("https://raw.githubusercontent.com/draknyte1/GTplusplus/master/Recommended.txt").toLowerCase();
public static String USER_COUNTRY = GeoUtils.determineUsersCountry();
public static boolean isModUpToDate = Utils.isModUpToDate();
@@ -76,7 +79,7 @@ public class CORE {
public static int turbineCutoffBase = 75000;
//GT++ Fake Player Profile
- public static GameProfile gameProfile = new GameProfile(UUID.nameUUIDFromBytes("gtplusplus.core".getBytes()), "[GT++]");
+ public static final GameProfile gameProfile = new GameProfile(UUID.nameUUIDFromBytes("gtplusplus.core".getBytes()), "[GT++]");
public static final WeakHashMap<World, EntityPlayerMP> fakePlayerCache = new WeakHashMap<World, EntityPlayerMP>();
//Tooltips;
public static final String GT_Tooltip = "Added by: " + EnumChatFormatting.DARK_GREEN+"Alkalus "+EnumChatFormatting.GRAY+"- "+EnumChatFormatting.RED+"[GT++]";
@@ -88,6 +91,7 @@ public class CORE {
//Because I want to be lazy. Beyond Reality Classic Var.
public static boolean BRC = false;
+ public static final String SEPERATOR = "/";
/**
@@ -286,7 +290,20 @@ public class CORE {
}
public static final void crash() {
- System.exit(0);
+ Logger.INFO("==========================================================");
+ Logger.INFO("[GT++ CRASH]");
+ Logger.INFO("==========================================================");
+ Logger.INFO("Oooops...");
+ Logger.INFO("This should only happy in a development environment or when something really bad happens.");
+ Logger.INFO("==========================================================");
+ Logger.INFO("Called from: "+ReflectionUtils.getMethodName(0));
+ Logger.INFO(ReflectionUtils.getMethodName(1));
+ Logger.INFO(ReflectionUtils.getMethodName(2));
+ Logger.INFO(ReflectionUtils.getMethodName(3));
+ Logger.INFO(ReflectionUtils.getMethodName(4));
+ Logger.INFO(ReflectionUtils.getMethodName(5));
+ Logger.INFO(ReflectionUtils.getMethodName(6));
+ FMLCommonHandler.instance().exitJava(0, true);
}
public static final void gc() {
diff --git a/src/Java/gtPlusPlus/core/material/ELEMENT.java b/src/Java/gtPlusPlus/core/material/ELEMENT.java
index 99586b37fe..ba2579aa97 100644
--- a/src/Java/gtPlusPlus/core/material/ELEMENT.java
+++ b/src/Java/gtPlusPlus/core/material/ELEMENT.java
@@ -217,9 +217,32 @@ public final class ELEMENT {
//Runescape materials
- public static final Material BLACK_METAL = new Material("Black Metal", MaterialState.SOLID, TextureSet.SET_METALLIC, new short[] {5, 5, 5}, 2350, 4650, 24, 17, false, "҈", 0, new MaterialStack[]{new MaterialStack(getInstance().LEAD, 15), new MaterialStack(getInstance().TUNGSTEN, 25), new MaterialStack(getInstance().CARBON, 60)});//Not a GT Inherited Material
+ public static final Material BLACK_METAL = new Material("Black Metal", MaterialState.SOLID, TextureSet.SET_METALLIC, new short[] {5, 5, 5}, 2350, 4650, 24, 17, false, "҈", 0, new MaterialStack[]{new MaterialStack(getInstance().LEAD, 15), new MaterialStack(getInstance().MANGANESE, 25), new MaterialStack(getInstance().CARBON, 60)});//Not a GT Inherited Material
public static final Material WHITE_METAL = new Material("White Metal", MaterialState.SOLID, TextureSet.SET_METALLIC, new short[] {255, 255, 255}, 4560, 7580, 35, 41, false, "҉", 0, new MaterialStack[]{new MaterialStack(getInstance().COPPER, 5), new MaterialStack(getInstance().ANTIMONY, 10), new MaterialStack(getInstance().PLATINUM, 10), new MaterialStack(getInstance().TIN, 75)});//Not a GT Inherited Material
- public static final Material GRANITE = new Material("Ancient Granite", MaterialState.SOLID, TextureSet.SET_SAND, new short[] {107, 107, 107}, 500, 2000, 16, 12, false, "«»", 0, false);//Not a GT Inherited Material
+
+ public static final Material GRANITE = new Material(
+ "Ancient Granite",
+ MaterialState.SOLID,
+ TextureSet.SET_SAND,
+ new short[] {107, 107, 107},
+ 500,
+ 2000,
+ 16,
+ 12,
+ false,
+ "«»",
+ 0,
+ false,
+ new MaterialStack[]{
+ new MaterialStack(getInstance().OXYGEN, 30),
+ new MaterialStack(getInstance().IRON, 20),
+ new MaterialStack(getInstance().SILICON, 20),
+ new MaterialStack(getInstance().ALUMINIUM, 10),
+ new MaterialStack(getInstance().POTASSIUM, 10),
+ new MaterialStack(getInstance().CALCIUM, 5),
+ new MaterialStack(getInstance().SODIUM, 5)
+ });//Not a GT Inherited Material
+
public static final Material RUNITE = new Material("Runite", MaterialState.SOLID, TextureSet.SET_FINE, new short[] {60, 200, 190}, 6750, 11550, 73, 87, true, "§", 0);//Not a GT Inherited Material
public static final Material DRAGON_METAL = new Material("Dragonblood", MaterialState.SOLID, TextureSet.SET_SHINY, new short[] {220, 40, 20, 2}, 10160, 17850, 96, 105, true, "۞", 0);//Not a GT Inherited Material
diff --git a/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java b/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java
index 0e661fd429..8dad69f70a 100644
--- a/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java
+++ b/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java
@@ -38,24 +38,6 @@ public final class MISC_MATERIALS {
new MaterialStack(ELEMENT.getInstance().OXYGEN, 1)
});
- public static final Material STRONTIUM_HYDROXIDE = new Material(
- "Strontium Hydroxide",
- MaterialState.SOLID,
- TextureSet.SET_METALLIC,
- null,
- -1,
- -1,
- -1,
- -1,
- false,
- "Sr(OH)2",
- 0,
- false,
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().STRONTIUM, 1),
- new MaterialStack(MISC_MATERIALS.HYDROXIDE, 2)
- });
-
public static final Material SELENIUM_DIOXIDE = new Material(
"Selenium Dioxide",
MaterialState.PURE_LIQUID, //State
@@ -103,6 +85,21 @@ public final class MISC_MATERIALS {
new MaterialStack(ELEMENT.getInstance().NITROGEN, 1)
});
+ public static final Material CARBON_MONOXIDE = new Material(
+ "Carbon Monoxide",
+ MaterialState.PURE_LIQUID, //State
+ null, //Material Colour
+ -1, //Melting Point in C
+ -1, //Boiling Point in C
+ -1, //Protons
+ -1,
+ false, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
+ new MaterialStack(ELEMENT.getInstance().CARBON, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 1)
+ });
+
public static final Material CARBON_DIOXIDE = new Material(
"Carbon Dioxide",
MaterialState.PURE_LIQUID, //State
@@ -142,7 +139,7 @@ public final class MISC_MATERIALS {
new MaterialStack(MaterialUtils.generateMaterialFromGtENUM(Materials.Galena), 1),
new MaterialStack(MaterialUtils.generateMaterialFromGtENUM(Materials.Chalcopyrite), 1),
new MaterialStack(MaterialUtils.generateMaterialFromGtENUM(Materials.Cobaltite), 1),
- new MaterialStack(ELEMENT.STANDALONE.BLACK_METAL, 1)
+ new MaterialStack(ELEMENT.STANDALONE.GRANITE, 1)
});
public static final Material RARE_EARTH_MID = new Material(
@@ -162,8 +159,8 @@ public final class MISC_MATERIALS {
new MaterialStack(ORES.CROCROITE, 1),
new MaterialStack(ORES.NICHROMITE, 1),
new MaterialStack(ORES.ZIRCON, 1),
+ new MaterialStack(ELEMENT.STANDALONE.GRANITE, 1),
new MaterialStack(ELEMENT.STANDALONE.BLACK_METAL, 1),
- new MaterialStack(ELEMENT.STANDALONE.WHITE_METAL, 1),
new MaterialStack(ELEMENT.STANDALONE.RUNITE, 1)
});
@@ -288,6 +285,24 @@ public final class MISC_MATERIALS {
new MaterialStack(SODIUM_CHLORIDE, 2),
});
+ public static final Material STRONTIUM_HYDROXIDE = new Material(
+ "Strontium Hydroxide",
+ MaterialState.SOLID,
+ TextureSet.SET_METALLIC,
+ null,
+ -1,
+ -1,
+ -1,
+ -1,
+ false,
+ "Sr(OH)2",
+ 0,
+ false,
+ new MaterialStack[]{
+ new MaterialStack(ELEMENT.getInstance().STRONTIUM, 1),
+ new MaterialStack(MISC_MATERIALS.HYDROXIDE, 2)
+ });
+
}
diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java
index dbcbeac32a..b5922dde53 100644
--- a/src/Java/gtPlusPlus/core/material/Material.java
+++ b/src/Java/gtPlusPlus/core/material/Material.java
@@ -237,7 +237,7 @@ public class Material {
int hashSize = MathUtils.howManyPlaces(aValueForGen);
String a = String.valueOf(aValueForGen);
- String b = null;
+ String b = "";
if (hashSize < 9) {
int aSecondHash = this.materialState.hashCode();
@@ -379,9 +379,6 @@ public class Material {
aDataSet.put(m.getStackMaterial().vRadiationLevel);
}
byte aAverage = MathUtils.getByteAverage(aDataSet);
- if (aAverage > Byte.MAX_VALUE || aAverage < Byte.MIN_VALUE) {
- aAverage = 0;
- }
if (aAverage > 0) {
Logger.MATERIALS(this.getLocalizedName()+" is radioactive due to trace elements. Level: "+aAverage+".");
this.isRadioactive = true;
@@ -531,11 +528,6 @@ public class Material {
}
}
- public Material(String string, MaterialState solid, TextureSet setShiny, int i, short[] s, int j, int k, int l,
- int m, boolean b, String string2, int n) {
- // TODO Auto-generated constructor stub
- }
-
public final TextureSet getTextureSet() {
synchronized(this) {
return textureSet;
@@ -868,10 +860,9 @@ public class Material {
ItemStack a1 = getOre(1);
Item a2 = a1.getItem();
Block a3 = Block.getBlockFromItem(a2);
-
- //Logger.DEBUG_MATERIALS("[Invalid Ore] Is a1 valid? "+(a1 != null));
- //Logger.DEBUG_MATERIALS("[Invalid Ore] Is a2 valid? "+(a2 != null));
- //Logger.DEBUG_MATERIALS("[Invalid Ore] Is a3 valid? "+(a3 != null));
+ if (a3 != null) {
+ return a3;
+ }
Block x = Block.getBlockFromItem(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ore"+Utils.sanitizeString(this.unlocalizedName), stacksize).getItem());
if (x != null){
@@ -1103,96 +1094,41 @@ public class Material {
if (this.materialState == MaterialState.ORE){
return null;
}
+
+ Fluid aGTBaseFluid = null;
- final Materials isValid = Materials.get(this.getLocalizedName());
- //Logger.MATERIALS("Is "+this.getLocalizedName()+" a Gregtech material? "+(isValid != null && isValid != Materials._NULL)+" | Found "+isValid.mDefaultLocalName);
- if (isValid != Materials._NULL){
- for (Materials m : invalidMaterials.values()){
- if (isValid == m){
- Logger.MATERIALS("Trying to generate a fluid for blacklisted material: "+m.mDefaultLocalName);
- FluidStack a1 = m.getFluid(1);
- FluidStack a2 = m.getGas(1);
- FluidStack a3 = m.getMolten(1);
- FluidStack a4 = m.getSolid(1);
- FluidStack a5 = m.getPlasma(1);
- if (a1 != null){
- Logger.MATERIALS("Using a pre-defined Fluid from GT. Fluid.");
- return a1.getFluid();
- }
- if (a2 != null){
- Logger.MATERIALS("Using a pre-defined Fluid from GT. Gas.");
- return a2.getFluid();
- }
- if (a3 != null){
- Logger.MATERIALS("Using a pre-defined Fluid from GT. Molten.");
- return a3.getFluid();
- }
- if (a4 != null){
- Logger.MATERIALS("Using a pre-defined Fluid from GT. Solid.");
- return a4.getFluid();
- }
- if (a5 != null){
- Logger.MATERIALS("Using a pre-defined Fluid from GT. Plasma.");
- return a5.getFluid();
- }
- Logger.MATERIALS("Using null.");
- return null;
- }
- }
- }
-
- if (this.materialState == MaterialState.SOLID){
- if (isValid.mFluid != null){
- Logger.MATERIALS("Using a pre-defined Fluid from GT. mFluid.");
- return isValid.mFluid;
- }
- else if (isValid.mStandardMoltenFluid != null){
- Logger.MATERIALS("Using a pre-defined Fluid from GT. mStandardMoltenFluid.");
- return isValid.mStandardMoltenFluid;
- }
- }
- else if (this.materialState == MaterialState.GAS){
- if (isValid.mGas != null){
- Logger.MATERIALS("Using a pre-defined Fluid from GT. mGas.");
- return isValid.mGas;
- }
- }
- else if (this.materialState == MaterialState.LIQUID || this.materialState == MaterialState.PURE_LIQUID){
- if (isValid.mFluid != null){
- Logger.MATERIALS("Using a pre-defined Fluid from GT. mFluid.");
- return isValid.mFluid;
- }
- else if (isValid.mGas != null){
- Logger.MATERIALS("Using a pre-defined Fluid from GT. mGas.");
- return isValid.mGas;
- }
- else if (isValid.mStandardMoltenFluid != null){
- Logger.MATERIALS("Using a pre-defined Fluid from GT. mStandardMoltenFluid.");
- return isValid.mStandardMoltenFluid;
- }
- }
+ // Clean up Internal Fluid Generation
+ final Materials n1 = MaterialUtils.getMaterial(this.getLocalizedName(), Utils.sanitizeString(this.getLocalizedName()));
+ final Materials n2 = MaterialUtils.getMaterial(this.getUnlocalizedName(), Utils.sanitizeString(this.getUnlocalizedName()));
- FluidStack aTest1 = FluidUtils.getFluidStack("molten."+Utils.sanitizeString(this.getLocalizedName()), 1);
- FluidStack aTest2 = FluidUtils.getFluidStack("fluid."+Utils.sanitizeString(this.getLocalizedName()), 1);
- FluidStack aTest3 = FluidUtils.getFluidStack(Utils.sanitizeString(this.getLocalizedName()), 1);
+ FluidStack f1 = FluidUtils.getWildcardFluidStack(n1, 1);
+ FluidStack f2 = FluidUtils.getWildcardFluidStack(n2, 1);
+ FluidStack f3 = FluidUtils.getWildcardFluidStack(Utils.sanitizeString(this.getUnlocalizedName(), new char[] {'-', '_'}), 1);
+ FluidStack f4 = FluidUtils.getWildcardFluidStack(Utils.sanitizeString(this.getLocalizedName(), new char[] {'-', '_'}), 1);
- if (aTest1 != null) {
- Logger.MATERIALS("Found FluidRegistry entry for "+"molten."+Utils.sanitizeString(this.getLocalizedName()));
- return aTest1.getFluid();
+ if (f1 != null) {
+ aGTBaseFluid = f1.getFluid();
}
- if (aTest2 != null) {
- Logger.MATERIALS("Found FluidRegistry entry for "+"fluid."+Utils.sanitizeString(this.getLocalizedName()));
- return aTest2.getFluid();
+ else if (f2 != null) {
+ aGTBaseFluid = f2.getFluid();
}
- if (aTest3 != null) {
- Logger.MATERIALS("Found FluidRegistry entry for "+Utils.sanitizeString(this.getLocalizedName()));
- return aTest3.getFluid();
+ else if (f3 != null) {
+ aGTBaseFluid = f3.getFluid();
}
+ else if (f4 != null) {
+ aGTBaseFluid = f4.getFluid();
+ }
+
ItemStack aFullCell = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1);
+ ItemStack aFullCell2 = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getLocalizedName(), 1);
+ ItemStack aFullCell3 = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+Utils.sanitizeString(this.getUnlocalizedName(), new char[] {'-', '_'}), 1);
+ ItemStack aFullCell4 = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+Utils.sanitizeString(this.getLocalizedName(), new char[] {'-', '_'}), 1);
+
Logger.MATERIALS("Generating our own fluid.");
- //Generate a Cell if we need to
- if (aFullCell == null){
+ //Generate a Cell if we need to, but first validate all four searches are invalid
+
+ if (!ItemUtils.checkForInvalidItems(new ItemStack[] {aFullCell, aFullCell2, aFullCell3, aFullCell4})){
if (this.vGenerateCells){
Item g = new BaseItemCell(this);
aFullCell = ItemUtils.getSimpleStack(g);
@@ -1202,7 +1138,29 @@ public class Material {
Logger.MATERIALS("Did not generate a cell for "+this.getUnlocalizedName());
}
}
+ else {
+ // One cell we searched for was valid, let's register it.
+ if (aFullCell != null) {
+ this.registerComponentForMaterial(ComponentTypes.CELL, aFullCell);
+ }
+ else if (aFullCell2 != null) {
+ this.registerComponentForMaterial(ComponentTypes.CELL, aFullCell2);
+ }
+ else if (aFullCell3 != null) {
+ this.registerComponentForMaterial(ComponentTypes.CELL, aFullCell3);
+ }
+ else if (aFullCell4 != null) {
+ this.registerComponentForMaterial(ComponentTypes.CELL, aFullCell4);
+ }
+ }
+ // We found a GT fluid, let's use it.
+ // Good chance we registered the cell from this material too.
+ if (aGTBaseFluid != null) {
+ return aGTBaseFluid;
+ }
+
+ // This fluid does not exist at all, time to generate it.
if (this.materialState == MaterialState.SOLID){
return FluidUtils.addGTFluid(
this.getUnlocalizedName(),
diff --git a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java
index 1757b461ee..20fdfd3c8c 100644
--- a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java
+++ b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java
@@ -59,27 +59,35 @@ public class MaterialGenerator {
@SuppressWarnings("unused")
private static volatile Block tempBlock;
+
+ public static boolean addFluidExtractionRecipe(ItemStack aEmpty, ItemStack aRemains, FluidStack aFluid) {
+ return addFluidExtractionRecipe(aEmpty, aRemains, aFluid, null, null);
+ }
+
/**
* Called Reflectively from CORE.RA.addFluidExtractionRecipe
+ * @param aSpecial
+ * @return
*/
- private static void addFluidExtractionRecipe(ItemStack aEmpty, ItemStack aRemains, FluidStack aFluid, int aDuration, int aEU) {
- /*GT_Recipe r = new Recipe_GT(
- true,
- new ItemStack[] {aEmpty, aRemains != null ? aRemains : null},
- new ItemStack[] {},
- null,
- new int[] {},
- new FluidStack[] {},
- new FluidStack[] {c},
- a2, a3, a1);*/
- //new RecipeGen_FluidCanning(r, true);
- new RecipeGen_FluidCanning(true, aEmpty, aRemains, aFluid, aDuration, aEU);
+ public static boolean addFluidExtractionRecipe(ItemStack aEmpty, ItemStack aRemains, FluidStack aFluid, Integer aDuration, Integer aEU) {
+ RecipeGen_FluidCanning g = new RecipeGen_FluidCanning(true, aEmpty, aRemains, aFluid, aDuration, aEU);
+ if (g != null && g.valid()) {
+ //Logger.INFO("[FIND] Adding Extraction recipe for "+ItemUtils.getItemName(aEmpty)+", "+ItemUtils.getItemName(aRemains)+", "+ItemUtils.getFluidName(aFluid));
+ return true;
+ }
+ Logger.INFO("[ERROR] FAILED adding Extraction recipe for "+ItemUtils.getItemName(aEmpty)+", "+ItemUtils.getItemName(aRemains)+", "+ItemUtils.getFluidName(aFluid));
+ return false;
}
+
+ public static boolean addFluidCannerRecipe(ItemStack aEmpty, ItemStack aFullContainer, FluidStack aFluidIn, FluidStack rFluidOut) {
+ return addFluidCannerRecipe(aEmpty, aFullContainer, aFluidIn, rFluidOut, null, null);
+ }
/**
* Called Reflectively from CORE.RA.addFluidCannerRecipe
+ * @return
*/
- private static void addFluidCannerRecipe(ItemStack aFullContainer, ItemStack aEmpty, FluidStack aFluid) {
+ public static boolean addFluidCannerRecipe(ItemStack aEmpty, ItemStack aFullContainer, FluidStack aFluidIn, FluidStack rFluidOut, Integer aTime, Integer aEu) {
/*GT_Recipe r = new Recipe_GT(
true,
new ItemStack[] {aEmpty},
@@ -90,7 +98,11 @@ public class MaterialGenerator {
new FluidStack[] {rFluidOut},
0, 0, 0);*/
//new RecipeGen_FluidCanning(r, false);
- new RecipeGen_FluidCanning(false, aEmpty, aFullContainer, aFluid, null, null);
+ RecipeGen_FluidCanning g = new RecipeGen_FluidCanning(false, aEmpty, aFullContainer, aFluidIn, null, null, 0);
+ if (g != null && g.valid()) {
+ return true;
+ }
+ return false;
}
public static void generate(final Material matInfo){
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
index c3c8da7761..14858b15aa 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
@@ -5,8 +5,6 @@ import static gtPlusPlus.core.lib.CORE.GTNH;
import java.util.ArrayList;
import cpw.mods.fml.common.Loader;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
@@ -276,6 +274,35 @@ public class RECIPES_GREGTECH {
20 * 60 * 1 * (GTNH ? 2 : 1),
(int) GT_Values.V[5]);
+ // Turbine Automation Port
+ CORE.RA.addAssemblylineRecipe(
+ ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_8_TURBINE_AUTOMATION, 1),
+ 20 * 60 * 60 * 24,
+ new ItemStack[] {
+ CI.getTieredMachineHull(8, 4),
+ CI.getConveyor(8, GTNH ? 24 : 12),
+ CI.getElectricMotor(7, GTNH ? 32 : 16),
+ CI.getElectricPiston(7, GTNH ? 16 : 4),
+ CI.getEnergyCore(6, GTNH ? 8 : 2),
+ CI.getPlate(8, GTNH ? 24 : 12),
+ CI.getTieredComponent(OrePrefixes.screw, 8, GTNH ? 48 : 24),
+ CI.getTieredComponent(OrePrefixes.bolt, 7, GTNH ? 32 : 16),
+ CI.getTieredComponent(OrePrefixes.rod, 6, GTNH ? 12 : 6),
+ CI.getTieredComponent(OrePrefixes.circuit, 7, GTNH ? 20 : 10),
+ CI.getTieredComponent(OrePrefixes.rotor, 6, GTNH ? 16 : 8),
+ },
+ new FluidStack[] {
+ CI.getTieredFluid(8, 144 * 32),
+ CI.getAlternativeTieredFluid(7, 144 * 16),
+ CI.getTertiaryTieredFluid(7, 144 * 16),
+ ALLOY.BABBIT_ALLOY.getFluid(128 * 144),
+ ALLOY.ZERON_100.getFluid(144 * 64)
+
+ },
+ GregtechItemList.Hatch_Input_TurbineHousing.get(4),
+ 20 * 60 * 60 * (GTNH ? 2 : 1),
+ (int) GT_Values.V[8]);
+
/*
* Contianment casings
@@ -360,88 +387,116 @@ public class RECIPES_GREGTECH {
}
- //Nano Healer
- CORE.RA.addAssemblylineRecipe(
- ItemUtils.simpleMetaStack(Items.golden_apple, 1, 1),
- 20 * 60 * 10,
- new ItemStack[] {
- ItemUtils.getSimpleStack(aGemCasings[2], GTNH ? 4 : 2),
- CI.getTieredComponent(OrePrefixes.plate, 8, GTNH ? 32 : 16),
- CI.getTieredComponent(OrePrefixes.circuit, 7, GTNH ? 16 : 4),
- CI.getTieredComponent(OrePrefixes.cableGt02, 7, GTNH ? 16 : 8),
- CI.getTieredComponent(OrePrefixes.gearGt, 6, GTNH ? 6 : 3),
- CI.getTieredComponent(OrePrefixes.screw, 7, GTNH ? 16 : 8),
- CI.getTieredComponent(OrePrefixes.bolt, 5, GTNH ? 24 : 12),
- CI.getTieredComponent(OrePrefixes.frameGt, 4, GTNH ? 12 : 6),
- aCoilWire[3]
- },
- new FluidStack[] {
- CI.getTieredFluid(7, 144 * 18 * (GTNH ? 16 : 8)),
- CI.getTertiaryTieredFluid(7, 144 * 18 * (GTNH ? 16 : 8)),
- CI.getAlternativeTieredFluid(6, 144 * 18 * (GTNH ? 16 : 8)),
- CI.getAlternativeTieredFluid(7, 144 * 18 * (GTNH ? 16 : 8)),
-
- },
- ItemUtils.getItemStackFromFQRN("miscutils:personalHealingDevice", 1),
- 20 * 60 * 30 * (GTNH ? 2 : 1),
- (int) GT_Values.V[7]);
-
-
-
- //Charge Pack LuV-UV
-
- ItemStack[] aChargeResearch = new ItemStack[] {
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore7", 1),
- ItemUtils.getSimpleStack(ModItems.itemChargePack_High_1, 1),
- ItemUtils.getSimpleStack(ModItems.itemChargePack_High_2, 1),
- ItemUtils.getSimpleStack(ModItems.itemChargePack_High_3, 1),
- };
-
- ItemStack[] aChargeOutputs = new ItemStack[] {
- ItemUtils.getSimpleStack(ModItems.itemChargePack_High_1, 1),
- ItemUtils.getSimpleStack(ModItems.itemChargePack_High_2, 1),
- ItemUtils.getSimpleStack(ModItems.itemChargePack_High_3, 1),
- ItemUtils.getSimpleStack(ModItems.itemChargePack_High_4, 1),
- };
+ if (LoadedMods.Baubles) {
+ //Nano Healer
+ CORE.RA.addAssemblylineRecipe(
+ ItemUtils.simpleMetaStack(Items.golden_apple, 1, 1),
+ 20 * 60 * 10,
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(aGemCasings[2], GTNH ? 4 : 2),
+ CI.getTieredComponent(OrePrefixes.plate, 8, GTNH ? 32 : 16),
+ CI.getTieredComponent(OrePrefixes.circuit, 7, GTNH ? 16 : 4),
+ CI.getTieredComponent(OrePrefixes.cableGt02, 7, GTNH ? 16 : 8),
+ CI.getTieredComponent(OrePrefixes.gearGt, 6, GTNH ? 6 : 3),
+ CI.getTieredComponent(OrePrefixes.screw, 7, GTNH ? 16 : 8),
+ CI.getTieredComponent(OrePrefixes.bolt, 5, GTNH ? 24 : 12),
+ CI.getTieredComponent(OrePrefixes.frameGt, 4, GTNH ? 12 : 6),
+ aCoilWire[3]
+ },
+ new FluidStack[] {
+ CI.getTieredFluid(7, 144 * 18 * (GTNH ? 16 : 8)),
+ CI.getTertiaryTieredFluid(7, 144 * 18 * (GTNH ? 16 : 8)),
+ CI.getAlternativeTieredFluid(6, 144 * 18 * (GTNH ? 16 : 8)),
+ CI.getAlternativeTieredFluid(7, 144 * 18 * (GTNH ? 16 : 8)),
- ItemStack[] aBufferCoreInputs = new ItemStack[] {
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore7", GTNH ? 8 : 4),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore8", GTNH ? 8 : 4),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore9", GTNH ? 8 : 4),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore10", GTNH ? 8 : 4),
- };
+ },
+ ItemUtils.getItemStackFromFQRN("miscutils:personalHealingDevice", 1),
+ 20 * 60 * 30 * (GTNH ? 2 : 1),
+ (int) GT_Values.V[7]);
+
+
+
+ //Charge Pack LuV-UV
+
+ ItemStack[] aChargeResearch = new ItemStack[] {
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore7", 1),
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_High_1, 1),
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_High_2, 1),
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_High_3, 1),
+ };
+
+ ItemStack[] aChargeOutputs = new ItemStack[] {
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_High_1, 1),
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_High_2, 1),
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_High_3, 1),
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_High_4, 1),
+ };
+
+ ItemStack[] aBufferCoreInputs = new ItemStack[] {
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore7", GTNH ? 8 : 4),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore8", GTNH ? 8 : 4),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore9", GTNH ? 8 : 4),
+ ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore10", GTNH ? 8 : 4),
+ };
+
+ int aCurrSlot = 0;
+ for (int h = 6; h < 10; h++) {
+ CORE.RA.addAssemblylineRecipe(
+ aChargeResearch[aCurrSlot],
+ 20 * 60 * 10 * (aCurrSlot + 1),
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(
+ aGemBatteries[aCurrSlot], GTNH ? 4 : 2),
+ aBufferCoreInputs[aCurrSlot],
+ aCoilWire[aCurrSlot],
+ CI.getTieredComponent(OrePrefixes.plate, h, GTNH ? 16 : 8),
+ CI.getTieredComponent(OrePrefixes.plate, h-1, GTNH ? 32 : 16),
+ CI.getTieredComponent(OrePrefixes.circuit, h, GTNH ? 16 : 4),
+ CI.getTieredComponent(OrePrefixes.circuit, h-1, GTNH ? 32 : 8),
+ CI.getTieredComponent(OrePrefixes.cableGt12, h-1, GTNH ? 32 : 16),
+ CI.getTieredComponent(OrePrefixes.screw, h, GTNH ? 16 : 8),
+ CI.getTieredComponent(OrePrefixes.bolt, h-2, GTNH ? 32 : 16),
+ CI.getElectricMotor(h, GTNH ? 8 : 4),
+ CI.getFieldGenerator(h-1, 2),
+ CI.getRobotArm(h-2, GTNH ? 4 : 2),
+ },
+ new FluidStack[] {
+ CI.getTieredFluid(h, 144 * 18 * (GTNH ? 8 : 4)),
+ CI.getTertiaryTieredFluid(h-1, 144 * 18 * (GTNH ? 8 : 4)),
+ CI.getAlternativeTieredFluid(h-1, 144 * 18 * (GTNH ? 8 : 4)),
+ CI.getAlternativeTieredFluid(h-2, 144 * 18 * (GTNH ? 8 : 4)),
+ },
+ aChargeOutputs[aCurrSlot],
+ 20 * 60 * 30 * (GTNH ? 2 : 1) * (aCurrSlot+1),
+ (int) GT_Values.V[h]);
+ aCurrSlot++;
+ }
- int aCurrSlot = 0;
- for (int h = 6; h < 10; h++) {
+ //Cloaking device
CORE.RA.addAssemblylineRecipe(
- aChargeResearch[aCurrSlot],
- 20 * 60 * 10 * (aCurrSlot + 1),
+ ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_9_CLOAKING, 1),
+ 20 * 60 * 10,
new ItemStack[] {
- ItemUtils.getSimpleStack(
- aGemBatteries[aCurrSlot], GTNH ? 4 : 2),
- aBufferCoreInputs[aCurrSlot],
- aCoilWire[aCurrSlot],
- CI.getTieredComponent(OrePrefixes.plate, h, GTNH ? 16 : 8),
- CI.getTieredComponent(OrePrefixes.plate, h-1, GTNH ? 32 : 16),
- CI.getTieredComponent(OrePrefixes.circuit, h, GTNH ? 16 : 4),
- CI.getTieredComponent(OrePrefixes.circuit, h-1, GTNH ? 32 : 8),
- CI.getTieredComponent(OrePrefixes.cableGt12, h-1, GTNH ? 32 : 16),
- CI.getTieredComponent(OrePrefixes.screw, h, GTNH ? 16 : 8),
- CI.getTieredComponent(OrePrefixes.bolt, h-2, GTNH ? 32 : 16),
- CI.getElectricMotor(h, GTNH ? 8 : 4),
- CI.getFieldGenerator(h-1, 2),
- CI.getRobotArm(h-2, GTNH ? 4 : 2),
+ ItemUtils.getSimpleStack(aGemCasings[3], GTNH ? 4 : 2),
+ CI.getTieredComponent(OrePrefixes.plate, 8, GTNH ? 32 : 16),
+ CI.getTieredComponent(OrePrefixes.circuit, 7, GTNH ? 16 : 4),
+ CI.getTieredComponent(OrePrefixes.cableGt04, 8, GTNH ? 16 : 8),
+ CI.getTieredComponent(OrePrefixes.gearGt, 7, GTNH ? 6 : 3),
+ CI.getTieredComponent(OrePrefixes.screw, 8, GTNH ? 16 : 8),
+ CI.getTieredComponent(OrePrefixes.bolt, 7, GTNH ? 24 : 12),
+ CI.getTieredComponent(OrePrefixes.frameGt, 5, GTNH ? 12 : 6),
+ aCoilWire[3]
},
new FluidStack[] {
- CI.getTieredFluid(h, 144 * 18 * (GTNH ? 8 : 4)),
- CI.getTertiaryTieredFluid(h-1, 144 * 18 * (GTNH ? 8 : 4)),
- CI.getAlternativeTieredFluid(h-1, 144 * 18 * (GTNH ? 8 : 4)),
- CI.getAlternativeTieredFluid(h-2, 144 * 18 * (GTNH ? 8 : 4)),
+ CI.getTieredFluid(8, 144 * 18 * (GTNH ? 16 : 8)),
+ CI.getTertiaryTieredFluid(8, 144 * 18 * (GTNH ? 16 : 8)),
+ CI.getAlternativeTieredFluid(7, 144 * 18 * (GTNH ? 16 : 8)),
+ CI.getAlternativeTieredFluid(8, 144 * 18 * (GTNH ? 16 : 8)),
+
},
- aChargeOutputs[aCurrSlot],
- 20 * 60 * 30 * (GTNH ? 2 : 1) * (aCurrSlot+1),
- (int) GT_Values.V[h]);
- aCurrSlot++;
+ ItemUtils.getItemStackFromFQRN("miscutils:personalCloakingDevice", 1),
+ 20 * 60 * 30 * (GTNH ? 2 : 1),
+ (int) GT_Values.V[8]);
}
@@ -776,7 +831,17 @@ public class RECIPES_GREGTECH {
//Add an empty recipe, but only if we didn't for the standard GT HF. Prevents Fluid transformation exploits.
if (!addedGtExtraction) {
CORE.RA.addFluidCannerRecipe(ItemUtils.getSimpleStack(ModItems.itemHydrofluoricPotion), ItemUtils.getSimpleStack(Items.glass_bottle), null, FluidUtils.getFluidStack("hydrofluoricacid", 125));
- }
+ }
+
+ //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);
+
}
@@ -1491,6 +1556,53 @@ 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
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ ItemUtils.getGregtechCircuit(17),
+ ItemUtils.getItemStackOfAmountFromOreDict("plateRefinedTrinium", GTNH ? 64 : 32),
+ CI.getSensor(6, GTNH ? 6 : 3),
+ CI.getBolt(7, GTNH ? 64 : 32),
+ ItemUtils.getItemStackOfAmountFromOreDict("wireFinePlatinum", GTNH ? 64 : 32),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(7), GTNH ? 12 : 6)
+ },
+ CI.getAlternativeTieredFluid(7, 144 * 32),
+ ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_8_TURBINE_AUTOMATION, 1),
+ 20 * 60 * 5,
+ (int) GT_Values.V[6]);
+
+ // Cloaking Device Research Page
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ ItemUtils.getGregtechCircuit(17),
+ ItemUtils.getSimpleStack(ModItems.itemCircuitLFTR, 4),
+ CI.getFieldGenerator(6, GTNH ? 16 : 8),
+ ItemUtils.getItemStackOfAmountFromOreDict("wireFinePalladium", GTNH ? 32 : 16),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(6), GTNH ? 12 : 6)
+ },
+ CI.getAlternativeTieredFluid(7, 144 * 32),
+ 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),
+ ItemUtils.getSimpleStack(ModItems.itemRope, GTNH ? 32 : 16),
+ ItemUtils.getItemStackOfAmountFromOreDict("gearGtSmallWroughtIron", GTNH ? 8 : 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("wireFineCopper", GTNH ? 32 : 16),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(1), GTNH ? 2 : 1)
+ },
+ FluidUtils.getFluidStack("molten.rubber", 2000),
+ ItemUtils.getSimpleStack(ModItems.itemPersonalFireProofDevice),
+ 20 * 60 * 5,
+ 30);
+ }
@@ -1588,19 +1700,19 @@ public class RECIPES_GREGTECH {
private static void fluidExtractorRecipes() {
//FLiBe fuel
- CORE.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLi2BeF4", 1), null,
- FluidUtils.getFluidStack("li2bef4", 144), 10000, 100, 500);
+ CORE.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLi2BeF4", 1),
+ FluidUtils.getFluidStack("li2bef4", 144), 100, 500);
//LFTR Fuel 1
- CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ZrF4U235.getDust(1), null,
- NUCLIDE.LiFBeF2ZrF4U235.getFluid(144), 10000, 250, 1000);
- CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ZrF4UF4.getDust(1), null,
- NUCLIDE.LiFBeF2ZrF4UF4.getFluid(144), 10000, 150, 2000);
- CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ThF4UF4.getDust(1), null,
- NUCLIDE.LiFBeF2ThF4UF4.getFluid(144), 10000, 200, 1500);
+ CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ZrF4U235.getDust(1),
+ NUCLIDE.LiFBeF2ZrF4U235.getFluid(144), 250, 1000);
+ CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ZrF4UF4.getDust(1),
+ NUCLIDE.LiFBeF2ZrF4UF4.getFluid(144), 150, 2000);
+ CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ThF4UF4.getDust(1),
+ NUCLIDE.LiFBeF2ThF4UF4.getFluid(144), 200, 1500);
//ZIRCONIUM_TETRAFLUORIDE
- CORE.RA.addFluidExtractionRecipe(FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(1), null,
- FluidUtils.getFluidStack(ModItems.fluidZrF4, 144), 10000, 200, 512+256);
+ CORE.RA.addFluidExtractionRecipe(FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(1),
+ FluidUtils.getFluidStack(ModItems.fluidZrF4, 144), 200, 512+256);
@@ -1641,7 +1753,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");
@@ -1956,25 +2068,6 @@ public class RECIPES_GREGTECH {
}
- public static boolean addPulverisationRecipe(final ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2,
- final ItemStack aOutput3) {
- aOutput1 = GT_OreDictUnificator.get(true, aOutput1);
- aOutput2 = GT_OreDictUnificator.get(true, aOutput2);
- if ((GT_Utility.isStackInvalid(aInput)) || (GT_Utility.isStackInvalid(aOutput1))) {
- return false;
- }
- if (GT_Utility.getContainerItem(aInput, false) == null) {
-
- if (GregTech_API.sRecipeFile.get(ConfigCategories.Machines.maceration, aInput, true)) {
- GT_Utility.addSimpleIC2MachineRecipe(aInput, GT_ModHandler.getMaceratorRecipeList(), null,
- new Object[] { aOutput1 });
- }
- GT_Values.RA.addPulveriserRecipe(aInput, new ItemStack[] { aOutput1, aOutput2, aOutput3 },
- new int[] { 10000, 10000, 10000 }, 400, 2);
- }
- return true;
- }
-
private static void cyclotronRecipes() {
// Polonium
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java
index 02b282b1b3..5048c5f2a5 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java
@@ -21,6 +21,7 @@ import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
+import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
import gtPlusPlus.xmod.bop.blocks.BOP_Block_Registrator;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
@@ -156,13 +157,13 @@ public class RECIPES_General {
//Shaped Crafting for ULV Material Dusts
-
+
//Potin
if (RecipeUtils.addShapelessGregtechRecipe(new Object[] {"dustLead", "dustBronze", "dustTin",
"dustLead", "dustBronze"}, ALLOY.POTIN.getDust(5))){
Logger.INFO("Added shapeless recipe for Potin Dust.");
}
-
+
//Tumbaga
if (RecipeUtils.addShapelessGregtechRecipe(new Object[] {
"dustGold", "dustGold", "dustCopper"}, ItemUtils.getSimpleStack(ModItems.dustTumbagaMix))){
@@ -173,7 +174,7 @@ public class RECIPES_General {
ItemUtils.getSimpleStack(ModItems.dustTumbagaMix),
ItemUtils.getSimpleStack(ModItems.dustTumbagaMix),
"dustGold"
- },
+ },
ALLOY.TUMBAGA.getDust(10))){
Logger.INFO("Added shapeless recipe for Tumbaga Dust.");
}
@@ -293,7 +294,7 @@ public class RECIPES_General {
CI.getElectricPump(2, 1),
CI.getPlate(2, GTNH ? 4 : 2),
ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(0), GTNH ? 2 : 1),
- },
+ },
FluidUtils.getHotWater(500), // Fluid
ItemUtils.getSimpleStack(ModBlocks.blockPestKiller), // Output
20 * 60, // Dur
@@ -394,12 +395,11 @@ public class RECIPES_General {
generatePipeRecipes(e.mDefaultLocalName, e.getMass(), tVoltageMultiplier);
}
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK)
- RecipeUtils.addShapedGregtechRecipe(
- CI.component_Plate[4], "rotorGtStainlessSteel", CI.component_Plate[4],
- CI.getTieredCircuitOreDictName(3), CI.machineHull_HV, CI.getTieredCircuitOreDictName(3),
- CI.component_Plate[4], CI.electricPump_HV, CI.component_Plate[4],
- GregtechItemList.Hatch_Air_Intake.get(1L, new Object[0]));
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[4], "rotorGtStainlessSteel", CI.component_Plate[4],
+ CI.getTieredCircuitOreDictName(3), CI.machineHull_HV, CI.getTieredCircuitOreDictName(3),
+ CI.component_Plate[4], CI.electricPump_HV, CI.component_Plate[4],
+ GregtechItemList.Hatch_Air_Intake.get(1L, new Object[0]));
RecipeUtils.addShapedGregtechRecipe(CI.component_Plate[6], ALLOY.MARAGING250.getGear(1), CI.component_Plate[6],
CI.getTieredCircuitOreDictName(4), GregtechItemList.Casing_AdvancedVacuum.get(1),
@@ -417,7 +417,7 @@ public class RECIPES_General {
CI.component_Plate[8], GregtechItemList.Hatch_Input_Naquadah.get(1L, new Object[0]));
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ if (PollutionUtils.isPollutionEnabled()) {
GT_ModHandler.addCraftingRecipe(GregtechItemList.Hatch_Muffler_Adv_LV.get(1L, new Object[0]), bitsd,
new Object[] { "M", "P", Character.valueOf('M'), ItemList.Hatch_Muffler_LV.get(1), Character.valueOf('P'),
GregtechItemList.Pollution_Cleaner_LV.get(1) });
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java
index 0bd5c0cf76..a21200fc10 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java
@@ -16,6 +16,7 @@ import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.*;
+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;
@@ -230,6 +231,7 @@ public class RECIPES_Machines {
fakeMachineCasingCovers();
ztonesCoverRecipes();
superBuses();
+ roundRobinators();
}
private static void initModItems(){
@@ -449,7 +451,7 @@ public class RECIPES_Machines {
//Add recycle recipes for the Iron Plated Bricks
//GT_ModHandler.addPulverisationRecipe(RECIPE_IronPlatedBricks, ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustIron", 6), ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustClay", 2), true);
- RECIPES_GREGTECH.addPulverisationRecipe(
+ CORE.RA.addPulverisationRecipe(
RECIPE_IronPlatedBricks,
ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustIron", 6),
ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustClay", 2),
@@ -939,7 +941,7 @@ public class RECIPES_Machines {
}
- if (CORE.ConfigSwitches.enableMachine_Pollution && CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ if (CORE.ConfigSwitches.enableMachine_Pollution && PollutionUtils.isPollutionEnabled()){
RecipeUtils.addShapedGregtechRecipe(
"plateCarbon", "plateCarbon", "plateCarbon",
@@ -1062,7 +1064,20 @@ public class RECIPES_Machines {
RECIPE_ThermalBoilerCasing);
//Lava Filter Recipe
- GT_Values.RA.addAssemblerRecipe(ItemUtils.getItemStackWithMeta(LoadedMods.IndustrialCraft2, "IC2:itemPartCarbonMesh", "RawCarbonMesh", 0, 16), CI.getNumberedCircuit(18), ItemUtils.getSimpleStack(ModItems.itemLavaFilter), 80*20, 16);
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ CI.getNumberedCircuit(18),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCarbon", GTNH ? 64 : 32),
+ ItemUtils.getItemStackOfAmountFromOreDict("wireFineSteel", GTNH ? 64 : 32),
+ ItemUtils.getItemStackOfAmountFromOreDict("ringTumbaga", GTNH ? 32 : 16),
+ ItemUtils.getItemStackOfAmountFromOreDict("foilCopper", GTNH ? 8 : 4),
+ ItemUtils.getItemStackWithMeta(LoadedMods.IndustrialCraft2, "IC2:itemPartCarbonMesh", "RawCarbonMesh", 0, 64),
+
+ },
+ CI.getTieredFluid(3, 144),
+ ItemUtils.getSimpleStack(ModItems.itemLavaFilter, GTNH ? 8 : 16),
+ 1600,
+ 240
+ );
}
if (CORE.ConfigSwitches.enableMultiblock_LiquidFluorideThoriumReactor){
@@ -2200,10 +2215,10 @@ public class RECIPES_Machines {
ItemList.Hatch_Input_Bus_ZPM.get(1),
ItemList.Hatch_Input_Bus_UV.get(1),
ItemList.Hatch_Input_Bus_MAX.get(1),
- GregtechItemList.Hatch_SuperBus_Input_ULV.get(1),
GregtechItemList.Hatch_SuperBus_Input_LV.get(1),
GregtechItemList.Hatch_SuperBus_Input_MV.get(1),
GregtechItemList.Hatch_SuperBus_Input_HV.get(1),
+ GregtechItemList.Hatch_SuperBus_Input_EV.get(1),
};
ItemStack[] mOutputHatch = new ItemStack[] {
@@ -2213,20 +2228,66 @@ public class RECIPES_Machines {
ItemList.Hatch_Output_Bus_ZPM.get(1),
ItemList.Hatch_Output_Bus_UV.get(1),
ItemList.Hatch_Output_Bus_MAX.get(1),
- GregtechItemList.Hatch_SuperBus_Output_ULV.get(1),
GregtechItemList.Hatch_SuperBus_Output_LV.get(1),
GregtechItemList.Hatch_SuperBus_Output_MV.get(1),
GregtechItemList.Hatch_SuperBus_Output_HV.get(1),
+ GregtechItemList.Hatch_SuperBus_Output_EV.get(1),
};
+ // Special Case recipes for ULV buses
+ {
+
+ int i = 0;
+ ItemStack[] aInputs1 = new ItemStack[] {
+ CI.getNumberedCircuit(17),
+ mInputHatch[i],
+ CI.getElectricMotor(i, GTNH ? 8 : 2),
+ CI.getConveyor(i, GTNH ? 10 : 5),
+ CI.getBolt(i, GTNH ? 32 : 16),
+ CI.getTieredComponent(OrePrefixes.circuit, i, GTNH ? 4 : 2)
+ };
+ Logger.INFO("[FIND] "+ItemUtils.getArrayStackNames(aInputs1));
+ ItemStack[] aOutputs1 = new ItemStack[] {
+ CI.getNumberedCircuit(18),
+ mOutputHatch[i],
+ CI.getElectricPiston(i, GTNH ? 8 : 2),
+ CI.getConveyor(i, GTNH ? 10 : 5),
+ CI.getGear(i, GTNH ? 6 : 3),
+ CI.getTieredComponent(OrePrefixes.circuit, i, GTNH ? 4 : 2)
+ };
+ Logger.INFO("[FIND] "+ItemUtils.getArrayStackNames(aOutputs1));
+
+ FluidStack a1 = CI.getAlternativeTieredFluid(i, 144 * 8);
+ FluidStack a2 = CI.getTertiaryTieredFluid(i, 144 * 8);
+
+
+ Logger.INFO("[FIND] Input Bus Fluid: "+ItemUtils.getFluidName(a1));
+ Logger.INFO("[FIND] Output Bus Fluid: "+ItemUtils.getFluidName(a2));
+
+
+ CORE.RA.addSixSlotAssemblingRecipe(aInputs1,
+ a1,
+ mSuperBusesInput[i].get(1),
+ 20 * 30 * 2 * i,
+ (int) GT_Values.V[i]);
+
+ CORE.RA.addSixSlotAssemblingRecipe(aOutputs1,
+ a2,
+ mSuperBusesOutput[i].get(1),
+ 20 * 30 * 2 * i,
+ (int) GT_Values.V[i]);
+
+
+ }
+
//Input Buses
- for (int i = 0; i < 10; i++) {
+ for (int i = 1; i < 10; i++) {
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- CI.getNumberedCircuit(16),
+ CI.getNumberedCircuit(17),
mInputHatch[i],
CI.getElectricMotor(i, GTNH ? 8 : 2),
CI.getConveyor(i, GTNH ? 10 : 5),
- CI.getGear(i, GTNH ? 6 : 3),
+ CI.getBolt(i, GTNH ? 32 : 16),
CI.getTieredComponent(OrePrefixes.circuit, i, GTNH ? 4 : 2)
},
CI.getAlternativeTieredFluid(i, 144 * 8),
@@ -2234,7 +2295,7 @@ public class RECIPES_Machines {
(int) GT_Values.V[i]);
}
//Output Buses
- for (int i = 0; i < 10; i++) {
+ for (int i = 1; i < 10; i++) {
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
CI.getNumberedCircuit(18),
mOutputHatch[i],
@@ -2251,4 +2312,57 @@ public class RECIPES_Machines {
}
+ private static void roundRobinators() {
+
+ RecipeUtils.addShapedGregtechRecipe(
+ ItemUtils.getSimpleStack(Blocks.hopper), "circuitPrimitive", ItemUtils.getSimpleStack(Blocks.hopper),
+ CI.craftingToolWrench, CI.machineCasing_ULV, CI.craftingToolScrewdriver,
+ ItemUtils.getSimpleStack(Blocks.hopper), "circuitPrimitive", ItemUtils.getSimpleStack(Blocks.hopper),
+ ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 0, 1));
+
+ ItemStack[] aRobinators = new ItemStack[] {
+ ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 0, 1),
+ ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 1, 1),
+ ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 2, 1),
+ ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 3, 1),
+ ItemUtils.simpleMetaStack(ModBlocks.blockRoundRobinator, 4, 1),
+ };
+
+ int aCostMultiplier = GTNH ? 2 : 1;
+
+ for (int i = 0; i < 5; i++) {
+ if (i == 0) {
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getNumberedCircuit(17),
+ CI.getTieredMachineCasing(0),
+ ItemUtils.getSimpleStack(Blocks.hopper, 4),
+ CI.getTieredComponent(OrePrefixes.circuit, 0, 2)
+ },
+ GT_Values.NF, //Input Fluid
+ aRobinators[i],
+ 45 * 10 * 1,
+ 8);
+ continue;
+ }
+ int aTier = i+1;
+ ItemStack[] aInputs = new ItemStack[] {
+ aRobinators[i-1],
+ CI.getTieredMachineHull(aTier, 1 * aCostMultiplier),
+ CI.getConveyor(aTier, 2 * aCostMultiplier),
+ CI.getElectricMotor(aTier, 2 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.plate, aTier, 4 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.circuit, i, 2 * aCostMultiplier),
+ };
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ aInputs,
+ GT_Values.NF, //Input Fluid
+ aRobinators[i],
+ 45 * 10 * 1 * (i+1),
+ MaterialUtils.getVoltageForTier(i));
+
+ }
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_SeleniumProcessing.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_SeleniumProcessing.java
index 73c7279bb8..902806e026 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPES_SeleniumProcessing.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_SeleniumProcessing.java
@@ -86,15 +86,15 @@ public class RECIPES_SeleniumProcessing {
public static void processCopperRecipes() {
- //Copper
+ //Copper
CORE.RA.addDehydratorRecipe(
new ItemStack[]{
- ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Copper, 1), // Item Input
+ ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Copper, 1), // Item Input
},
FluidUtils.getHotWater(1000), // Fluid
MISC_MATERIALS.SELENIUM_DIOXIDE.getFluid(20), // Fluid
new ItemStack[] {
- ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Copper, 1),
+ ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Copper, 1),
MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
@@ -121,12 +121,12 @@ public class RECIPES_SeleniumProcessing {
//Tetra
CORE.RA.addDehydratorRecipe(
new ItemStack[]{
- ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Tetrahedrite, 1), // Item Input
+ ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Tetrahedrite, 1), // Item Input
},
FluidUtils.getHotWater(1000), // Fluid
MISC_MATERIALS.SELENIUM_DIOXIDE.getFluid(10), // Fluid
new ItemStack[] {
- ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Tetrahedrite, 1),
+ ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Tetrahedrite, 1),
MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
@@ -153,12 +153,12 @@ public class RECIPES_SeleniumProcessing {
//Chalco
CORE.RA.addDehydratorRecipe(
new ItemStack[]{
- ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Chalcopyrite, 1), // Item Input
+ ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Chalcopyrite, 1), // Item Input
},
FluidUtils.getHotWater(1000), // Fluid
MISC_MATERIALS.SELENIUM_DIOXIDE.getFluid(10), // Fluid
new ItemStack[] {
- ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Chalcopyrite, 1),
+ ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Chalcopyrite, 1),
MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
@@ -185,12 +185,12 @@ public class RECIPES_SeleniumProcessing {
//Malachite
CORE.RA.addDehydratorRecipe(
new ItemStack[]{
- ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Malachite, 1), // Item Input
+ ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Malachite, 1), // Item Input
},
FluidUtils.getHotWater(1000), // Fluid
MISC_MATERIALS.SELENIUM_DIOXIDE.getFluid(10), // Fluid
new ItemStack[] {
- ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Malachite, 1),
+ ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Malachite, 1),
MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Tools.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Tools.java
index 10cefdf0c4..2cc6d7b41a 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Tools.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Tools.java
@@ -154,16 +154,7 @@ public class RECIPES_Tools {
CobbleStone, sandHammer, CobbleStone,
CobbleStone, CobbleStone, CobbleStone,
RECIPE_Sand);
-
- if (LoadedMods.Baubles){
- //Cloaking Device
- RecipeUtils.recipeBuilder(
- plateDoubleNiChrome, plateIridiumAlloy, plateDoubleNiChrome,
- plateIridiumAlloy, batteryUltimate, plateIridiumAlloy,
- plateDoubleNiChrome, plateIridiumAlloy, plateDoubleNiChrome,
- personalCloakingDevice);
-
- }
+
//Sand to Sandstone
RecipeUtils.recipeBuilder(
Sand, Sand, Sand,
diff --git a/src/Java/gtPlusPlus/core/recipe/common/CI.java b/src/Java/gtPlusPlus/core/recipe/common/CI.java
index 15589ada84..be1089a72a 100644
--- a/src/Java/gtPlusPlus/core/recipe/common/CI.java
+++ b/src/Java/gtPlusPlus/core/recipe/common/CI.java
@@ -6,6 +6,7 @@ import gregtech.api.enums.OrePrefixes;
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.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.material.ALLOY;
@@ -547,7 +548,7 @@ public class CI {
private static final Material[] aMaterial_Main = new Material[] {
ALLOY.POTIN,
- ALLOY.ZIRCONIUM_CARBIDE,
+ ALLOY.TUMBAGA,
ALLOY.EGLIN_STEEL,
ALLOY.INCONEL_792,
ALLOY.TUNGSTEN_TITANIUM_CARBIDE,
@@ -561,7 +562,7 @@ public class CI {
};
private static final Material[] aMaterial_Secondary = new Material[] {
- ALLOY.TUMBAGA,
+ ALLOY.STEEL,
ALLOY.SILICON_CARBIDE,
ALLOY.TUNGSTEN_CARBIDE,
ALLOY.INCONEL_690,
@@ -576,7 +577,7 @@ public class CI {
};
private static final Material[] aMaterial_Tertiary = new Material[] {
- ALLOY.STEEL,
+ ELEMENT.getInstance().LEAD,
ELEMENT.getInstance().ALUMINIUM,
ALLOY.STAINLESS_STEEL,
ELEMENT.getInstance().TUNGSTEN,
@@ -634,12 +635,22 @@ public class CI {
}
public static FluidStack getTieredFluid(int aTier, int aAmount, int aType) {
- ItemStack aCell = getTieredComponent(OrePrefixes.liquid, aTier, 1);
+ // Weird Legacy handling
+ /*ItemStack aCell = getTieredComponent(OrePrefixes.liquid, aTier, 1);
FluidStack a = GT_Utility.getFluidForFilledItem(aCell, true);
if (a == null) {
a = aMaster[aType][aTier].getFluid(aAmount);
- }
- a.amount = aAmount;
+ }*/
+
+ // Modern Handling
+ FluidStack a = aMaster[aType][aTier].getFluid(aAmount);
+ if (a == null) {
+ ItemStack aCell = getTieredComponent(OrePrefixes.liquid, aTier, 1);
+ if (aCell != null) {
+ a = GT_Utility.getFluidForFilledItem(aCell, true);
+ a.amount = aAmount;
+ }
+ }
return a;
}
@@ -1229,4 +1240,8 @@ public class CI {
}
+ public static ItemStack getNumberedBioCircuit(int i) {
+ return ItemUtils.simpleMetaStack(AgriculturalChem.mBioCircuit, i, 0);
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java b/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java
new file mode 100644
index 0000000000..6cd13dc209
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java
@@ -0,0 +1,45 @@
+package gtPlusPlus.core.slots;
+
+import gregtech.api.util.Recipe_GT;
+import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidContainerRegistry;
+import net.minecraftforge.fluids.FluidStack;
+
+public class SlotChemicalPlantInput extends Slot {
+
+ public SlotChemicalPlantInput(final IInventory inventory, final int index, final int x, final int y) {
+ super(inventory, index, x, y);
+ }
+
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ return isItemValidForChemicalPlantSlot(itemstack);
+ }
+
+ public static boolean isItemValidForChemicalPlantSlot(ItemStack aStack) {
+ boolean validItem = Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.containsInput(aStack);
+ if (!validItem) {
+ for (Recipe_GT f : Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.mRecipeList) {
+ if (f.mFluidInputs.length > 0) {
+ for (FluidStack g : f.mFluidInputs) {
+ if (g != null) {
+ if (FluidContainerRegistry.containsFluid(aStack, g)) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ }
+ return validItem;
+ }
+
+ @Override
+ public int getSlotStackLimit() {
+ return 64;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/slots/SlotIntegratedCircuit.java b/src/Java/gtPlusPlus/core/slots/SlotIntegratedCircuit.java
index c41a385c4b..48b050d678 100644
--- a/src/Java/gtPlusPlus/core/slots/SlotIntegratedCircuit.java
+++ b/src/Java/gtPlusPlus/core/slots/SlotIntegratedCircuit.java
@@ -10,12 +10,13 @@ import gtPlusPlus.core.recipe.common.CI;
public class SlotIntegratedCircuit extends Slot {
public static Item mCircuitItem;
+ public static Item mCircuitItem2;
private final short mCircuitLock;
public SlotIntegratedCircuit(final IInventory inventory, final int slot, final int x, final int y) {
this(Short.MAX_VALUE+1, inventory, slot, x, y);
}
-
+
public SlotIntegratedCircuit(int mTypeLock, final IInventory inventory, final int slot, final int x, final int y) {
super(inventory, slot, x, y);
if (mTypeLock > Short.MAX_VALUE || mTypeLock < Short.MIN_VALUE) {
@@ -28,18 +29,29 @@ public class SlotIntegratedCircuit extends Slot {
@Override
public synchronized boolean isItemValid(final ItemStack itemstack) {
+ return isItemValidForSlot(mCircuitLock, itemstack);
+ }
+
+ public static synchronized boolean isItemValidForSlot(final ItemStack itemstack) {
+ return isItemValidForSlot(-1, itemstack);
+ }
+
+ public static synchronized boolean isItemValidForSlot(int aLockedCircuitNumber, final ItemStack itemstack) {
boolean isValid = false;
if (mCircuitItem == null) {
mCircuitItem = CI.getNumberedCircuit(0).getItem();
}
- if (mCircuitItem != null) {
+ if (mCircuitItem2 == null) {
+ mCircuitItem2 = CI.getNumberedBioCircuit(0).getItem();
+ }
+ if (mCircuitItem != null && mCircuitItem2 != null) {
if (itemstack != null) {
- if (itemstack.getItem() == mCircuitItem) {
- if (mCircuitLock == -1) {
+ if (itemstack.getItem() == mCircuitItem || itemstack.getItem() == mCircuitItem2) {
+ if (aLockedCircuitNumber == -1) {
isValid = true;
}
else {
- if (itemstack.getItemDamage() == mCircuitLock) {
+ if (itemstack.getItemDamage() == aLockedCircuitNumber) {
isValid = true;
}
}
@@ -49,6 +61,33 @@ public class SlotIntegratedCircuit extends Slot {
return isValid;
}
+ /**
+ * Returns the circuit type. -1 is invalid, 0 is standard, 1 is GT++ bio.
+ * @param itemstack - the Circuit Stack.
+ * @return
+ */
+ public static synchronized int isRegularProgrammableCircuit(final ItemStack itemstack) {
+ if (mCircuitItem == null) {
+ mCircuitItem = CI.getNumberedCircuit(0).getItem();
+ }
+ if (mCircuitItem2 == null) {
+ mCircuitItem2 = CI.getNumberedBioCircuit(0).getItem();
+ }
+ if (mCircuitItem != null && mCircuitItem2 != null) {
+ if (itemstack != null) {
+ if (itemstack.getItem() == mCircuitItem || itemstack.getItem() == mCircuitItem2) {
+ if (itemstack.getItem() == mCircuitItem) {
+ return 0;
+ }
+ else if (itemstack.getItem() == mCircuitItem2) {
+ return 1;
+ }
+ }
+ }
+ }
+ return -1;
+ }
+
@Override
public int getSlotStackLimit() {
return 64;
diff --git a/src/Java/gtPlusPlus/core/slots/SlotNoInputLogging.java b/src/Java/gtPlusPlus/core/slots/SlotNoInputLogging.java
new file mode 100644
index 0000000000..762714ac94
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/slots/SlotNoInputLogging.java
@@ -0,0 +1,36 @@
+package gtPlusPlus.core.slots;
+
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import net.minecraft.block.Block;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+
+public class SlotNoInputLogging extends SlotNoInput {
+
+ private final int aSlotIndex;
+
+ public SlotNoInputLogging(final IInventory inventory, final int index, final int x, final int y) {
+ super(inventory, index, x, y);
+ aSlotIndex = index;
+ Logger.INFO("Slot "+index+" is doing logging");
+ }
+
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ if (ItemUtils.checkForInvalidItems(itemstack)) {
+ Logger.INFO("Tried Inserting "+ItemUtils.getItemName(itemstack)+" into slot "+aSlotIndex);
+ Block b = Block.getBlockFromItem(itemstack.getItem());
+ Logger.INFO(""+itemstack.getUnlocalizedName());
+ if (b != null) {
+ Logger.INFO(""+b.getLocalizedName());
+ Logger.INFO(""+b.getUnlocalizedName());
+ }
+ }
+ else {
+ Logger.INFO("Bad Itemstack");
+ }
+ return false;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java b/src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java
index ada0fd7b86..e7b7c46e7b 100644
--- a/src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java
+++ b/src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java
@@ -17,6 +17,7 @@ import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable;
import gtPlusPlus.core.tileentities.machines.TileEntityPestKiller;
import gtPlusPlus.core.tileentities.machines.TileEntityPooCollector;
import gtPlusPlus.core.tileentities.machines.TileEntityProjectTable;
+import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator;
import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable;
import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench;
import gtPlusPlus.core.tileentities.machines.TileEntityWorkbenchAdvanced;
@@ -44,6 +45,7 @@ public class ModTileEntities {
GameRegistry.registerTileEntity(TileEntitySuperJukebox.class, "TileEntitySuperJukebox");
GameRegistry.registerTileEntity(TileEntitySuperLight.class, "TileEntitySuperLight");
GameRegistry.registerTileEntity(TileEntityPestKiller.class, "TileEntityPestKiller");
+ GameRegistry.registerTileEntity(TileEntityRoundRobinator.class, "TileEntityRoundRobinator");
//Mod TEs
diff --git a/src/Java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java
index 0cda40c616..23ad2a3233 100644
--- a/src/Java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java
+++ b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java
@@ -11,6 +11,7 @@ import net.minecraft.tileentity.TileEntity;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.inventories.InventoryCircuitProgrammer;
import gtPlusPlus.core.recipe.common.CI;
+import gtPlusPlus.core.slots.SlotIntegratedCircuit;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
public class TileEntityCircuitProgrammer extends TileEntity implements ISidedInventory {
@@ -76,16 +77,21 @@ public class TileEntityCircuitProgrammer extends TileEntity implements ISidedInv
boolean doAdd = false;
ItemStack g = this.getStackInSlot(e);
int aSize = 0;
- ItemStack aInputStack = null;
- if (g != null) {
+ ItemStack aInputStack = null;
+ int aTypeInSlot = SlotIntegratedCircuit.isRegularProgrammableCircuit(g);
+ if (aTypeInSlot >= 0 && g != null) {
+ // No Existing Output
if (!hasOutput) {
aSize = g.stackSize;
doAdd = true;
}
+ // Existing Output
else {
ItemStack f = this.getStackInSlot(25);
- if (f != null) {
- if (f.getItemDamage() == e) {
+ int aTypeInCheckedSlot = SlotIntegratedCircuit.isRegularProgrammableCircuit(f);
+ // Check that the Circuit in the Output slot is not null and the same type as the circuit input.
+ if (aTypeInCheckedSlot >= 0 && (aTypeInSlot == aTypeInCheckedSlot) && f != null) {
+ if (g.getItem() == f.getItem() && f.getItemDamage() == e) {
aSize = f.stackSize + g.stackSize;
if (aSize > 64) {
aInputStack = g.copy();
@@ -93,16 +99,23 @@ public class TileEntityCircuitProgrammer extends TileEntity implements ISidedInv
}
doAdd = true;
}
- }
- else {
- doAdd = true;
- aSize = g.stackSize;
}
}
- if (doAdd) {
- ItemStack aOutput = CI.getNumberedCircuit(e);
- aOutput.stackSize = aSize;
+ if (doAdd) {
+ // Check Circuit Type
+ ItemStack aOutput;
+ if (aTypeInSlot == 0) {
+ aOutput = CI.getNumberedCircuit(e);
+ }
+ else if (aTypeInSlot == 1) {
+ aOutput = CI.getNumberedBioCircuit(e);
+ }
+ else {
+ aOutput = null;
+ }
+
if (aOutput != null) {
+ aOutput.stackSize = aSize;
this.setInventorySlotContents(e, aInputStack);
this.setInventorySlotContents(25, aOutput);
return true;
diff --git a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java
new file mode 100644
index 0000000000..a220997c84
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityRoundRobinator.java
@@ -0,0 +1,739 @@
+package gtPlusPlus.core.tileentities.machines;
+
+import java.util.List;
+
+import gtPlusPlus.GTplusplus;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.handler.GuiHandler;
+import gtPlusPlus.core.inventories.Inventory_RoundRobinator;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import gtPlusPlus.core.util.sys.KeyboardUtils;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockChest;
+import net.minecraft.command.IEntitySelector;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.ISidedInventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagList;
+import net.minecraft.network.NetworkManager;
+import net.minecraft.network.Packet;
+import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
+import net.minecraft.tileentity.IHopper;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.tileentity.TileEntityChest;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.util.Facing;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.World;
+
+public class TileEntityRoundRobinator extends TileEntity implements ISidedInventory, IHopper {
+
+ private int tickCount = 0;
+ private final Inventory_RoundRobinator inventoryContents;
+ private String customName;
+ public int locationX;
+ public int locationY;
+ public int locationZ;
+ private int aData = 1111;
+ private int aTier = 1;
+ private int aTickRate = 100;
+
+ public TileEntityRoundRobinator() {
+ this.inventoryContents = new Inventory_RoundRobinator();
+ this.setTileLocation();
+ }
+
+ public boolean setTileLocation() {
+ if (this.hasWorldObj()) {
+ if (!this.getWorldObj().isRemote) {
+ this.locationX = this.xCoord;
+ this.locationY = this.yCoord;
+ this.locationZ = this.zCoord;
+ this.aTier = this.getWorldObj().getBlockMetadata(locationX, locationY, locationZ) + 1;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ //Rename to hasCircuitToConfigure
+ public final boolean hasInventoryContents() {
+ for (ItemStack i : this.aHopperInventory) {
+ if (i == null) {
+ continue;
+ }
+ else {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public Inventory_RoundRobinator getInventory() {
+ return this.inventoryContents;
+ }
+
+ public int getTier() {
+ return this.aTier;
+ }
+
+ public int getTickRate() {
+ return this.aTickRate;
+ }
+
+ @Override
+ public void updateEntity() {
+ try{
+ // TODO
+ if (this.worldObj != null && !this.worldObj.isRemote){
+ setTileLocation();
+ aTickRate = (60-(aTier*10));
+ if (this.getTier() == 1) {
+ // 20 s
+ aTickRate = 400;
+ }
+ else if (this.getTier() == 2) {
+ // 5
+ aTickRate = 100;
+ }
+ else if (this.getTier() == 3) {
+ // 1
+ aTickRate = 20;
+ }
+ else if (this.getTier() == 4) {
+ // 1/5
+ aTickRate = 10;
+ }
+ else if (this.getTier() == 5) {
+ // 1/20
+ aTickRate = 1;
+ }
+ else {
+ aTickRate = 999999;
+ }
+
+ if (tickCount % getTickRate() == 0) {
+ if (hasInventoryContents()) {
+ Logger.WARNING("Trying to move items. "+aTickRate);
+ this.tryProcessItems();
+ }
+ }
+ this.tickCount++;
+ }
+ }
+ catch (final Throwable t){
+ t.printStackTrace();
+ }
+ }
+
+ public boolean anyPlayerInRange() {
+ return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 32) != null;
+ }
+
+ public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
+ if (!nbt.hasKey(tag)) {
+ nbt.setTag(tag, new NBTTagCompound());
+ }
+ return nbt.getCompoundTag(tag);
+ }
+
+ @Override
+ public void writeToNBT(final NBTTagCompound nbt) {
+ super.writeToNBT(nbt);
+ if (this.hasCustomInventoryName()) {
+ nbt.setString("CustomName", this.getCustomName());
+ }
+ nbt.setInteger("aCurrentMode", aData);
+ this.writeToNBT2(nbt);
+ }
+
+ @Override
+ public void readFromNBT(final NBTTagCompound nbt) {
+ super.readFromNBT(nbt);
+ if (nbt.hasKey("CustomName", 8)) {
+ this.setCustomName(nbt.getString("CustomName"));
+ }
+ aData = nbt.getInteger("aCurrentMode");
+ this.readFromNBT2(nbt);
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ @Override
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
+ return this.getInventory().isUseableByPlayer(entityplayer);
+ }
+
+ @Override
+ public void openInventory() {
+ this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
+ //this.getInventory().openInventory();
+ }
+
+ @Override
+ public void closeInventory() {
+ this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
+ //this.getInventory().closeInventory();
+ }
+
+ @Override
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ return true;
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(final int aSide) {
+ return new int[] {0, 1, 2, 3, 4};
+ }
+
+ @Override
+ public boolean canInsertItem(final int aSlot, final ItemStack aStack, final int aSide) {
+ return aSide < 2;
+ }
+
+ @Override
+ public boolean canExtractItem(final int aSlot, final ItemStack aStack, final int aSide) {
+ return false;
+ }
+
+ public String getCustomName() {
+ return this.customName;
+ }
+
+ public void setCustomName(final String customName) {
+ this.customName = customName;
+ }
+
+ @Override
+ public String getInventoryName() {
+ return this.hasCustomInventoryName() ? this.customName : "container.roundrobinator";
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return (this.customName != null) && !this.customName.equals("");
+ }
+
+ @Override
+ public Packet getDescriptionPacket() {
+ final NBTTagCompound tag = new NBTTagCompound();
+ this.writeToNBT(tag);
+ return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.blockMetadata, tag);
+ }
+
+ @Override
+ public void onDataPacket(final NetworkManager net, final S35PacketUpdateTileEntity pkt) {
+ final NBTTagCompound tag = pkt.func_148857_g();
+ this.readFromNBT(tag);
+ }
+
+
+ public boolean onRightClick(byte side, EntityPlayer player, int x, int y, int z) {
+ if (player != null && player.getHeldItem() == null) {
+ if (!player.isSneaking() && !KeyboardUtils.isShiftKeyDown()) {
+ player.openGui(GTplusplus.instance, GuiHandler.GUI16, player.getEntityWorld(), x, y, z);
+ }
+ else {
+ String InventoryContents = ItemUtils.getArrayStackNames(this.aHopperInventory);
+ PlayerUtils.messagePlayer(player, "Contents: "+InventoryContents+" | "+getDataString());
+ }
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ public boolean onScrewdriverRightClick(byte side, EntityPlayer player, int x, int y, int z) {
+ try {
+ if (side < 2) {
+ // Top/Bottom
+ }
+ else {
+ if (toggleSide(side)) {
+ PlayerUtils.messagePlayer(player, "Enabling side "+side+".");
+ }
+ else {
+ PlayerUtils.messagePlayer(player, "Disabling side "+side+".");
+ }
+ PlayerUtils.messagePlayer(player, "Mode String: "+aData+"");
+ }
+ return true;
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ return false;
+ }
+ }
+
+ public int getDataString() {
+ return aData;
+ }
+
+ public boolean[] getActiveSides() {
+ this.markDirty();
+ String s = String.valueOf(aData);
+ if (s == null || s.length() != 4) {
+ s = "1111";
+ }
+ boolean[] aActiveSides = new boolean[4];
+ for (int i=0;i<4;i++) {
+ char ch = s.charAt(i);
+ if (ch == '1') {
+ aActiveSides[i] = true;
+ }
+ else {
+ aActiveSides[i] = false;
+ }
+ }
+ return aActiveSides;
+ }
+
+ /**
+ * Toggle active state of side
+ * @param aSide - Forge Direction / Side
+ * @return - True if the side is now Active, false if now disabled.
+ */
+ public boolean toggleSide(int aSide) {
+ setSideActive(!getSideActive(aSide), aSide);
+ return getSideActive(aSide);
+ }
+
+
+ public void setSideActive(boolean aActive, int aSide) {
+ try {
+ if (aSide < 2) {
+ }
+ else {
+ if (aData < 1111) {
+ aData = 1111;
+ }
+ else if (aData > 2222) {
+ aData = 2222;
+ }
+ String s = String.valueOf(aData);
+ StringBuilder aDataString = new StringBuilder(s);
+ int aIndex = aSide - 2;
+ if (aActive) {
+ aDataString.setCharAt(aIndex, '1');
+ }
+ else {
+ aDataString.setCharAt(aIndex, '2');
+ }
+ aData = Integer.valueOf(aDataString.toString());
+ this.markDirty();
+ }
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+ public boolean getSideActive(int aSide) {
+ this.markDirty();
+ try {
+ if (aSide < 2) {
+ return false;
+ }
+ else {
+ if (aData < 1111) {
+ aData = 1111;
+ }
+ else if (aData > 2222) {
+ aData = 2222;
+ }
+ String s = String.valueOf(aData);
+ int aIndex = aSide - 2;
+ char ch = s.charAt(aIndex);
+ if (ch == '1') {
+ return true;
+ }
+ else {
+ return false;
+ }
+
+ }
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ return false;
+ }
+ }
+
+ @Override
+ public double getXPos() {
+ return this.locationX;
+ }
+
+ @Override
+ public double getYPos() {
+ return this.locationY;
+ }
+
+ @Override
+ public double getZPos() {
+ return this.locationZ;
+ }
+
+
+
+
+
+
+
+
+ // TODO
+
+
+
+ /*
+ * Hopper Code
+ */
+
+
+ private ItemStack[] aHopperInventory = new ItemStack[5];
+
+ public int getSizeInventory() {
+ return this.aHopperInventory.length;
+ }
+
+ public ItemStack getStackInSlot(int aSlot) {
+ return this.aHopperInventory[aSlot];
+ }
+
+ /**
+ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a
+ * new stack.
+ */
+ public ItemStack decrStackSize(int aSlot, int aMinimumSizeOfExistingStack)
+ {
+ if (this.aHopperInventory[aSlot] != null)
+ {
+ ItemStack itemstack;
+
+ if (this.aHopperInventory[aSlot].stackSize <= aMinimumSizeOfExistingStack)
+ {
+ itemstack = this.aHopperInventory[aSlot];
+ this.aHopperInventory[aSlot] = null;
+ return itemstack;
+ }
+ else
+ {
+ itemstack = this.aHopperInventory[aSlot].splitStack(aMinimumSizeOfExistingStack);
+
+ if (this.aHopperInventory[aSlot].stackSize == 0)
+ {
+ this.aHopperInventory[aSlot] = null;
+ }
+
+ return itemstack;
+ }
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ /**
+ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem -
+ * like when you close a workbench GUI.
+ */
+ public ItemStack getStackInSlotOnClosing(int aSlot)
+ {
+ if (this.aHopperInventory[aSlot] != null)
+ {
+ ItemStack itemstack = this.aHopperInventory[aSlot];
+ this.aHopperInventory[aSlot] = null;
+ return itemstack;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
+ */
+ public void setInventorySlotContents(int aSlot, ItemStack aStack)
+ {
+ this.aHopperInventory[aSlot] = aStack;
+
+ if (aStack != null && aStack.stackSize > this.getInventoryStackLimit())
+ {
+ aStack.stackSize = this.getInventoryStackLimit();
+ }
+ }
+
+ public boolean tryProcessItems() {
+ if (this.worldObj != null && !this.worldObj.isRemote) {
+ boolean didSomething = false;
+ if (!this.isEmpty()) {
+ Logger.WARNING("Has Items, Trying to push to all active directions.");
+ didSomething = this.tryPushItemsIntoNeighbours();
+ }
+ if (didSomething) {
+ this.markDirty();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Is Empty
+ * @return
+ */
+ private boolean isEmpty() {
+ ItemStack[] aitemstack = this.aHopperInventory;
+ int i = aitemstack.length;
+
+ for (int j = 0; j < i; ++j) {
+ ItemStack itemstack = aitemstack[j];
+
+ if (itemstack != null) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ private boolean tryPushItemsIntoNeighbours() {
+
+ boolean aDidPush = false;
+
+ for (int u = 2; u < 6; u++) {
+ if (!this.getSideActive(u)) {
+ Logger.WARNING("Not pushing on side "+u);
+ continue;
+ }
+
+ Logger.WARNING("Pushing on side "+u);
+ IInventory iinventory = this.getInventoryFromFacing(u);
+
+ if (iinventory == null) {
+ Logger.WARNING("No inventory found.");
+ continue;
+ }
+ else {
+
+ int i = Facing.oppositeSide[u];
+ Logger.WARNING("Using Opposite direction: "+i);
+
+ if (this.isInventoryFull(iinventory, i)) {
+ Logger.WARNING("Target is full, skipping.");
+ continue;
+ }
+ else {
+ Logger.WARNING("Target has space, let's move a single item.");
+ for (int j = 0; j < this.getSizeInventory(); ++j) {
+ if (this.getStackInSlot(j) != null) {
+ ItemStack itemstack = this.getStackInSlot(j).copy();
+ ItemStack itemstack1 = setStackInNeighbour(iinventory, this.decrStackSize(j, 1), i);
+ if (itemstack1 == null || itemstack1.stackSize == 0) {
+ iinventory.markDirty();
+ aDidPush = true;
+ continue;
+ }
+ this.setInventorySlotContents(j, itemstack);
+ }
+ }
+ }
+ }
+ }
+
+ return aDidPush;
+ }
+
+ private boolean isInventoryFull(IInventory aInv, int aSide) {
+ if (aInv instanceof ISidedInventory && aSide > -1) {
+ ISidedInventory isidedinventory = (ISidedInventory)aInv;
+ int[] aint = isidedinventory.getAccessibleSlotsFromSide(aSide);
+
+ for (int l = 0; l < aint.length; ++l)
+ {
+ ItemStack itemstack1 = isidedinventory.getStackInSlot(aint[l]);
+
+ if (itemstack1 == null || itemstack1.stackSize != itemstack1.getMaxStackSize())
+ {
+ return false;
+ }
+ }
+ }
+ else {
+ int j = aInv.getSizeInventory();
+
+ for (int k = 0; k < j; ++k)
+ {
+ ItemStack itemstack = aInv.getStackInSlot(k);
+
+ if (itemstack == null || itemstack.stackSize != itemstack.getMaxStackSize())
+ {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ public static ItemStack setStackInNeighbour(IInventory aNeighbour, ItemStack aStack, int aSide) {
+ if (aNeighbour instanceof ISidedInventory && aSide > -1)
+ {
+ ISidedInventory isidedinventory = (ISidedInventory)aNeighbour;
+ int[] aint = isidedinventory.getAccessibleSlotsFromSide(aSide);
+
+ for (int l = 0; l < aint.length && aStack != null && aStack.stackSize > 0; ++l)
+ {
+ aStack = tryMoveStack(aNeighbour, aStack, aint[l], aSide);
+ }
+ }
+ else
+ {
+ int j = aNeighbour.getSizeInventory();
+
+ for (int k = 0; k < j && aStack != null && aStack.stackSize > 0; ++k)
+ {
+ aStack = tryMoveStack(aNeighbour, aStack, k, aSide);
+ }
+ }
+
+ if (aStack != null && aStack.stackSize == 0)
+ {
+ aStack = null;
+ }
+
+ return aStack;
+ }
+
+ private static boolean canInsertItemIntoNeighbour(IInventory aNeighbour, ItemStack aStack, int aSlot, int aSide) {
+ return !aNeighbour.isItemValidForSlot(aSlot, aStack) ? false : !(aNeighbour instanceof ISidedInventory) || ((ISidedInventory)aNeighbour).canInsertItem(aSlot, aStack, aSide);
+ }
+
+ private static ItemStack tryMoveStack(IInventory aNeighbour, ItemStack aStack, int aSlot, int aSide) {
+ ItemStack itemstack1 = aNeighbour.getStackInSlot(aSlot);
+ if (canInsertItemIntoNeighbour(aNeighbour, aStack, aSlot, aSide)) {
+ boolean aDidSomething = false;
+ if (itemstack1 == null) {
+ //Forge: BUGFIX: Again, make things respect max stack sizes.
+ int max = Math.min(aStack.getMaxStackSize(), aNeighbour.getInventoryStackLimit());
+ if (max >= aStack.stackSize) {
+ aNeighbour.setInventorySlotContents(aSlot, aStack);
+ aStack = null;
+ }
+ else {
+ aNeighbour.setInventorySlotContents(aSlot, aStack.splitStack(max));
+ }
+ aDidSomething = true;
+ }
+ else if (areItemStacksEqual(itemstack1, aStack)) {
+ //Forge: BUGFIX: Again, make things respect max stack sizes.
+ int max = Math.min(aStack.getMaxStackSize(), aNeighbour.getInventoryStackLimit());
+ if (max > itemstack1.stackSize) {
+ int l = Math.min(aStack.stackSize, max - itemstack1.stackSize);
+ aStack.stackSize -= l;
+ itemstack1.stackSize += l;
+ aDidSomething = l > 0;
+ }
+ }
+ if (aDidSomething){
+ aNeighbour.markDirty();
+ }
+ }
+ return aStack;
+ }
+
+ private IInventory getInventoryFromFacing(int aSide)
+ {
+ int i = aSide;
+ return tryFindInvetoryAtXYZ(this.getWorldObj(), (double)(this.xCoord + Facing.offsetsXForSide[i]), (double)(this.yCoord + Facing.offsetsYForSide[i]), (double)(this.zCoord + Facing.offsetsZForSide[i]));
+ }
+
+ public static IInventory tryFindInvetoryAtXYZ(World aWorld, double aX, double aY, double aZ)
+ {
+ IInventory iinventory = null;
+ int sX = MathHelper.floor_double(aX);
+ int sY = MathHelper.floor_double(aY);
+ int sZ = MathHelper.floor_double(aZ);
+ TileEntity tileentity = aWorld.getTileEntity(sX, sY, sZ);
+
+ if (tileentity != null && tileentity instanceof IInventory)
+ {
+ iinventory = (IInventory)tileentity;
+
+ if (iinventory instanceof TileEntityChest)
+ {
+ Block block = aWorld.getBlock(sX, sY, sZ);
+
+ if (block instanceof BlockChest)
+ {
+ iinventory = ((BlockChest)block).func_149951_m(aWorld, sX, sY, sZ);
+ }
+ }
+ }
+
+ if (iinventory == null)
+ {
+ List list = aWorld.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1.0D, aY + 1.0D, aZ + 1.0D), IEntitySelector.selectInventories);
+
+ if (list != null && list.size() > 0)
+ {
+ iinventory = (IInventory)list.get(aWorld.rand.nextInt(list.size()));
+ }
+ }
+
+ return iinventory;
+ }
+
+ private static boolean areItemStacksEqual(ItemStack aStack, ItemStack aStack2) {
+ return aStack.getItem() != aStack2.getItem() ? false : (aStack.getItemDamage() != aStack2.getItemDamage() ? false : (aStack.stackSize > aStack.getMaxStackSize() ? false : ItemStack.areItemStackTagsEqual(aStack, aStack2)));
+ }
+
+ public void readFromNBT2(NBTTagCompound p_145839_1_) {
+ super.readFromNBT(p_145839_1_);
+ NBTTagList nbttaglist = p_145839_1_.getTagList("Items", 10);
+ this.aHopperInventory = new ItemStack[this.getSizeInventory()];
+ for (int i = 0; i < nbttaglist.tagCount(); ++i) {
+ NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
+ byte b0 = nbttagcompound1.getByte("Slot");
+ if (b0 >= 0 && b0 < this.aHopperInventory.length) {
+ this.aHopperInventory[b0] = ItemStack.loadItemStackFromNBT(
+ nbttagcompound1
+ );
+ }
+ }
+ }
+
+ public void writeToNBT2(NBTTagCompound aNBT) {
+ super.writeToNBT(aNBT);
+ NBTTagList nbttaglist = new NBTTagList();
+ for (int i = 0; i < this.aHopperInventory.length; ++i) {
+ if (this.aHopperInventory[i] != null) {
+ NBTTagCompound nbttagcompound1 = new NBTTagCompound();
+ nbttagcompound1.setByte("Slot", (byte) i);
+ this.aHopperInventory[i].writeToNBT(nbttagcompound1);
+ nbttaglist.appendTag(nbttagcompound1);
+ }
+ }
+ aNBT.setTag("Items", nbttaglist);
+ }
+
+
+
+
+
+
+
+}
diff --git a/src/Java/gtPlusPlus/core/util/Utils.java b/src/Java/gtPlusPlus/core/util/Utils.java
index 0325198213..c73f9ee7a4 100644
--- a/src/Java/gtPlusPlus/core/util/Utils.java
+++ b/src/Java/gtPlusPlus/core/util/Utils.java
@@ -378,9 +378,6 @@ public class Utils {
}
final Color c = new Color(r, g, b);
String temp = Integer.toHexString(c.getRGB() & 0xFFFFFF).toUpperCase();
-
- // System.out.println( "hex: " + Integer.toHexString( c.getRGB() &
- // 0xFFFFFF ) + " hex value:"+temp);
temp = Utils.appenedHexNotationToString(String.valueOf(temp));
Logger.WARNING("Made " + temp + " - Hopefully it's not a mess.");
Logger.WARNING("It will decode into " + Integer.decode(temp) + ".");
diff --git a/src/Java/gtPlusPlus/core/util/data/ArrayUtils.java b/src/Java/gtPlusPlus/core/util/data/ArrayUtils.java
index cca58467ef..3e96220995 100644
--- a/src/Java/gtPlusPlus/core/util/data/ArrayUtils.java
+++ b/src/Java/gtPlusPlus/core/util/data/ArrayUtils.java
@@ -1,10 +1,15 @@
package gtPlusPlus.core.util.data;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
-import net.minecraft.item.ItemStack;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
+import net.minecraft.item.ItemStack;
public class ArrayUtils {
@@ -75,5 +80,13 @@ public class ArrayUtils {
}
}
+ public static String toString(Object[] aArray, String string) {
+ return org.apache.commons.lang3.ArrayUtils.toString(aArray, string);
+ }
+
+ public static String toString(Object[] aArray) {
+ return org.apache.commons.lang3.ArrayUtils.toString(aArray);
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/ClientUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/ClientUtils.java
new file mode 100644
index 0000000000..806f83d830
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/minecraft/ClientUtils.java
@@ -0,0 +1,18 @@
+package gtPlusPlus.core.util.minecraft;
+
+import cpw.mods.fml.common.FMLCommonHandler;
+import cpw.mods.fml.relauncher.Side;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.lib.CORE;
+
+public class ClientUtils {
+
+ static {
+ if (FMLCommonHandler.instance().getSide() == Side.SERVER) {
+ Logger.ERROR("Something tried to access the ClientUtils class from the Server Side.");
+ Logger.ERROR("Soft crashing to prevent data corruption.");
+ CORE.crash();
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java
index ff60d8c416..d7b6bc0a30 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java
@@ -149,7 +149,7 @@ public class FluidUtils {
public static Fluid addGtFluid(final String aName, final String aLocalized, final GT_Materials aMaterial, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount, final boolean aGenerateCell) {
- Fluid g = addGTFluid(aName, "fluid.autogenerated", aLocalized, aMaterial.mRGBa, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount, aGenerateCell);
+ Fluid g = addGTFluid(aName, "fluid.autogenerated", aLocalized, aMaterial != null ? aMaterial.mRGBa : new short[]{255, 255, 255, 0}, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount, aGenerateCell);
if (g != null) {
if (aMaterial != null) {
switch (aState) {
@@ -310,7 +310,7 @@ public class FluidUtils {
rFluid.setTemperature((int) (aTemperatureK));
}
if ((aFullContainer != null) && (aEmptyContainer != null) && !FluidContainerRegistry.registerFluidContainer(new FluidStack(rFluid, aFluidAmount), aFullContainer, aEmptyContainer)) {
- CORE.RA.addFluidCannerRecipe(CI.emptyCells(1), aFullContainer, null, new FluidStack(rFluid, aFluidAmount));
+ CORE.RA.addFluidCannerRecipe(CI.emptyCells(1), aFullContainer, new FluidStack(rFluid, aFluidAmount));
}
else {
//Utils.LOG_INFO("Failed creating recipes to fill/empty cells of "+aName+".");
@@ -463,20 +463,16 @@ public class FluidUtils {
if (dustStack != null){
CORE.RA.addFluidExtractionRecipe(
- dustStack, //Input
- null, //Input 2
+ dustStack, //Input 2
FluidUtils.getFluidStack(gtFluid, amountPerItem), //Fluid Output
- 0, //Chance
1*20, //Duration
16 //Eu Tick
);
}
if (dustStack2 != null){
CORE.RA.addFluidExtractionRecipe(
- dustStack2, //Input
- null, //Input 2
+ dustStack2, //Input 2
FluidUtils.getFluidStack(gtFluid, amountPerItem), //Fluid Output
- 0, //Chance
1*20, //Duration
16 //Eu Tick
);
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java
index c529f60ba1..d69dd5d66e 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java
@@ -306,7 +306,14 @@ public class HazmatUtils {
//Logger.INFO("[Hazmat] Item was mapped for TTs");
Collections.sort(aTempTooltipData);
//Logger.INFO("[Hazmat] Sorted TTs");
- return aTempTooltipData.toArray();
+
+ String[] mBuiltOutput = new String[aTempTooltipData.size()];
+ int aIndex = 0;
+ for (String i : aTempTooltipData) {
+ mBuiltOutput[aIndex++] = i;
+ }
+
+ return mBuiltOutput;
}
}
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java
index 25d1eb2793..cb490203df 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java
@@ -47,6 +47,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
+import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;
@@ -694,7 +695,9 @@ public class ItemUtils {
public static String[] getArrayStackNamesAsArray(final ItemStack[] aStack) {
final String[] itemNames = aStack == null ? new String[] {} : new String[aStack.length];
- Logger.INFO(""+aStack.length);
+ if (aStack != null){
+ Logger.INFO(""+aStack.length);
+ }
if (aStack == null || aStack.length < 1) {
return itemNames;
@@ -1081,6 +1084,14 @@ public class ItemUtils {
}
+
+ public static String getFluidName(FluidStack aFluid) {
+ return aFluid != null ? aFluid.getFluid().getLocalizedName(aFluid) : "NULL";
+ }
+
+ public static String getFluidName(Fluid aFluid) {
+ return aFluid != null ? aFluid.getLocalizedName() : "NULL";
+ }
public static String getItemName(ItemStack aStack) {
if (aStack == null) {
@@ -1218,7 +1229,7 @@ public class ItemUtils {
}
public static boolean doesOreDictHaveEntryFor(String string) {
- return OreDictionary.doesOreNameExist(string);
+ return OreDictUtils.containsValidEntries(string);
}
public static void hideItemFromNEI(ItemStack aItemToHide) {
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/LangUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/LangUtils.java
new file mode 100644
index 0000000000..ea161e4adb
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/minecraft/LangUtils.java
@@ -0,0 +1,56 @@
+package gtPlusPlus.core.util.minecraft;
+
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import cpw.mods.fml.common.registry.LanguageRegistry;
+import gregtech.api.util.GT_LanguageManager;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
+
+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();
+ Field aModLanguageData = ReflectionUtils.getField(LanguageRegistry.class, "modLanguageData");
+ if (aModLanguageData != null){
+ Map<String,Properties> aProps = new HashMap<String, Properties>();
+ Object aInstanceProps;
+ try {
+ aInstanceProps = aModLanguageData.get(aInstance);
+ if (aInstanceProps != null){
+ aProps = (Map<String, Properties>) aInstanceProps;
+ Properties aLangProps = aProps.get(aLang);
+ if (aLangProps != null){
+ if (aLangProps.containsKey(aKey)) {
+ aLangProps.remove(aKey);
+ aLangProps.put(aKey, aNewValue);
+ }
+ else {
+ aLangProps.put(aKey, aNewValue);
+ }
+ aProps.remove(aLang);
+ aProps.put(aLang, aLangProps);
+ ReflectionUtils.setField(aInstance, aModLanguageData, aProps);
+ }
+ }
+ }
+ catch (IllegalArgumentException | IllegalAccessException e) {
+
+ }
+ }
+ return false;
+ }
+
+ public static String trans(String aNr, String aEnglish) {
+ return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aNr, aEnglish, false);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
index 364430b07d..9c623bb9be 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
@@ -25,6 +25,7 @@ import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.data.EnumUtils;
import gtPlusPlus.core.util.data.StringUtils;
+import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -207,9 +208,9 @@ public class MaterialUtils {
return true;
}
- public static int getTierOfMaterial(final int aMeltingPoint){
+ public static int getTierOfMaterial(final double aMeltingPoint){
- return aMeltingPoint < 1000 ? 0 : (Math.round(aMeltingPoint/1000));
+ return aMeltingPoint < 1000 ? 0 : (MathUtils.roundToClosestInt(aMeltingPoint/1000f));
/*if ((aMeltingPoint >= 0) && (aMeltingPoint <= 1000)){
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/OreDictUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/OreDictUtils.java
new file mode 100644
index 0000000000..324d39b863
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/minecraft/OreDictUtils.java
@@ -0,0 +1,25 @@
+package gtPlusPlus.core.util.minecraft;
+
+import java.util.List;
+
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.oredict.OreDictionary;
+
+public class OreDictUtils {
+
+ public static boolean containsValidEntries(String aOreName) {
+ boolean a = OreDictionary.doesOreNameExist(aOreName);
+ List<ItemStack> b = OreDictionary.getOres(aOreName, false);
+
+ if (!a) {
+ return false;
+ }
+ else {
+ if (b == null || b.isEmpty()) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java
index 6a41e54ec3..2ae2a9f1de 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java
@@ -15,6 +15,7 @@ import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords;
import gregtech.common.GT_Proxy;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.core.item.base.cell.BaseItemCell;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.MISC_MATERIALS;
import gtPlusPlus.core.material.MaterialGenerator;
@@ -44,6 +45,10 @@ public class PollutionUtils {
mIsPollutionEnabled = false;
}
}
+
+ public static boolean isPollutionEnabled() {
+ return mIsPollutionEnabled;
+ }
public static boolean mPollution() {
try {
@@ -138,7 +143,7 @@ public class PollutionUtils {
if (te == null) {
return false;
}
- return nullifyPollution(te);
+ return nullifyPollution((IHasWorldObjectAndCoords) te);
}
public static boolean nullifyPollution(IHasWorldObjectAndCoords aTileOfSomeSort) {
@@ -239,19 +244,39 @@ public class PollutionUtils {
if (CD != null) {
Logger.INFO("[PollutionCompat] Found carbon dioxide fluid, registering it.");
PollutionUtils.mPollutionFluidStacks.put(CD);
+ MISC_MATERIALS.CARBON_DIOXIDE.registerComponentForMaterial(CD);
ItemStack cellCD = ItemUtils.getItemStackOfAmountFromOreDict("cellCarbonDioxide", 1);
if (ItemUtils.checkForInvalidItems(cellCD)) {
Logger.INFO("[PollutionCompat] Found carbon dioxide cell, registering component.");
MISC_MATERIALS.CARBON_DIOXIDE.registerComponentForMaterial(OrePrefixes.cell, cellCD);
}
+ else {
+ Logger.INFO("[PollutionCompat] Did not find carbon dioxide cell, registering new component.");
+ new BaseItemCell(MISC_MATERIALS.CARBON_DIOXIDE);
+ }
}
else {
MaterialGenerator.generate(MISC_MATERIALS.CARBON_DIOXIDE, false, false);
}
+
if (CM != null) {
Logger.INFO("[PollutionCompat] Found carbon monoxide fluid, registering it.");
PollutionUtils.mPollutionFluidStacks.put(CM);
+ MISC_MATERIALS.CARBON_MONOXIDE.registerComponentForMaterial(CM);
+ ItemStack cellCD = ItemUtils.getItemStackOfAmountFromOreDict("cellCarbonMonoxide", 1);
+ if (ItemUtils.checkForInvalidItems(cellCD)) {
+ Logger.INFO("[PollutionCompat] Found carbon monoxide cell, registering component.");
+ MISC_MATERIALS.CARBON_MONOXIDE.registerComponentForMaterial(OrePrefixes.cell, cellCD);
+ }
+ else {
+ Logger.INFO("[PollutionCompat] Did not find carbon monoxide cell, registering new component.");
+ new BaseItemCell(MISC_MATERIALS.CARBON_MONOXIDE);
+ }
+ }
+ else {
+ MaterialGenerator.generate(MISC_MATERIALS.CARBON_MONOXIDE, false, false);
}
+
if (SD != null) {
Logger.INFO("[PollutionCompat] Found sulfur dioxide fluid, registering it.");
PollutionUtils.mPollutionFluidStacks.put(SD);
diff --git a/src/Java/gtPlusPlus/core/util/reflect/OreDictUtils.java b/src/Java/gtPlusPlus/core/util/reflect/OreDictUtils.java
deleted file mode 100644
index 6d34733545..0000000000
--- a/src/Java/gtPlusPlus/core/util/reflect/OreDictUtils.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package gtPlusPlus.core.util.reflect;
-
-public class OreDictUtils {
-
-
-
-}
diff --git a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
index 7ef9ef6632..135f98dd17 100644
--- a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
+++ b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
@@ -28,7 +28,22 @@ public class ReflectionUtils {
public static Map<String, Class<?>> mCachedClasses = new LinkedHashMap<String, Class<?>>();
public static Map<String, CachedMethod> mCachedMethods = new LinkedHashMap<String, CachedMethod>();
public static Map<String, CachedField> mCachedFields = new LinkedHashMap<String, CachedField>();
+ public static Map<String, CachedConstructor> mCachedConstructors = new LinkedHashMap<String, CachedConstructor>();
+ private static class CachedConstructor {
+
+ private final Constructor<?> METHOD;
+
+ public CachedConstructor(Constructor<?> aCons) {
+ METHOD = aCons;
+ }
+
+ public Constructor<?> get() {
+ return METHOD;
+ }
+
+ }
+
private static class CachedMethod {
private final boolean STATIC;
@@ -107,6 +122,49 @@ public class ReflectionUtils {
return false;
}
+ private static boolean cacheConstructor(Class<?> aClass, Constructor<?> aConstructor) {
+ if (aConstructor == null) {
+ return false;
+ }
+ CachedConstructor y = mCachedConstructors.get(aClass.getName()+"."+ArrayUtils.toString(aConstructor.getParameterTypes()));
+ if (y == null) {
+ mCachedConstructors.put(aClass.getName()+"."+ArrayUtils.toString(aConstructor.getParameterTypes()), new CachedConstructor(aConstructor));
+ return true;
+ }
+ return false;
+ }
+
+
+ /**
+ * Returns a cached {@link Constructor} object.
+ * @param aClass - Class containing the Constructor.
+ * @param aTypes - Varags Class Types for objects constructor.
+ * @return - Valid, non-final, {@link Method} object, or {@link null}.
+ */
+ public static Constructor<?> getConstructor(Class<?> aClass, Class<?>... aTypes) {
+ if (aClass == null || aTypes == null) {
+ return null;
+ }
+
+ String aMethodKey = ArrayUtils.toString(aTypes);
+ //Logger.REFLECTION("Looking up method in cache: "+(aClass.getName()+"."+aMethodName + "." + aMethodKey));
+ CachedConstructor y = mCachedConstructors.get(aClass.getName() + "." + aMethodKey);
+ if (y == null) {
+ Constructor<?> u = getConstructor_Internal(aClass, aTypes);
+ if (u != null) {
+ Logger.REFLECTION("Caching Constructor: "+aClass.getName() + "." + aMethodKey);
+ cacheConstructor(aClass, u);
+ return u;
+ } else {
+ return null;
+ }
+ } else {
+ return y.get();
+ }
+ }
+
+
+
/**
* Returns a cached {@link Class} object.
@@ -716,6 +774,55 @@ public class ReflectionUtils {
}
return m;
}
+
+ private static Constructor<?> getConstructor_Internal(Class<?> aClass, Class<?>... aTypes) {
+ Constructor<?> c = null;
+ try {
+ Logger.REFLECTION("Constructor: Internal Lookup: "+aClass.getName());
+ c = aClass.getDeclaredConstructor(aTypes);
+ if (c != null) {
+ c.setAccessible(true);
+ int modifiers = c.getModifiers();
+ Field modifierField = c.getClass().getDeclaredField("modifiers");
+ modifiers = modifiers & ~Modifier.FINAL;
+ modifierField.setAccessible(true);
+ modifierField.setInt(c, modifiers);
+ }
+ }
+ catch (Throwable t) {
+ Logger.REFLECTION("Constructor: Internal Lookup Failed: "+aClass.getName());
+ try {
+ c = getConstructorRecursively(aClass, aTypes);
+ } catch (Exception e) {
+ Logger.REFLECTION("Unable to find method '"+aClass.getName()+"'");
+ e.printStackTrace();
+ dumpClassInfo(aClass);
+ }
+ }
+ return c;
+ }
+
+ private static Constructor<?> getConstructorRecursively(Class<?> aClass, Class<?>... aTypes) throws Exception {
+ try {
+ Logger.REFLECTION("Constructor: Recursion Lookup: "+aClass.getName());
+ Constructor<?> c = aClass.getConstructor(aTypes);
+ if (c != null) {
+ c.setAccessible(true);
+ int modifiers = c.getModifiers();
+ Field modifierField = c.getClass().getDeclaredField("modifiers");
+ modifiers = modifiers & ~Modifier.FINAL;
+ modifierField.setAccessible(true);
+ modifierField.setInt(c, modifiers);
+ }
+ return c;
+ } catch (final NoSuchMethodException | IllegalArgumentException | IllegalAccessException e) {
+ final Class<?> superClass = aClass.getSuperclass();
+ if (superClass == null || superClass == Object.class) {
+ throw e;
+ }
+ return getConstructor_Internal(superClass, aTypes);
+ }
+ }
private static Method getMethodRecursively(final Class<?> clazz, final String aMethodName) throws NoSuchMethodException {
try {
@@ -795,7 +902,7 @@ public class ReflectionUtils {
}
private static Class<?> getClass_Internal(String string) {
- Class aClass = null;
+ Class<?> aClass = null;
if (ReflectionUtils.doesClassExist(string)) {
try {
aClass = Class.forName(string);
@@ -815,7 +922,7 @@ public class ReflectionUtils {
Logger.REFLECTION("Building: "+aClassName);
}
Logger.REFLECTION("Trying to search '"+aClassName+"' for inner classes.");
- Class clazz = ReflectionUtils.getClass(aClassName);
+ Class<?> clazz = ReflectionUtils.getClass(aClassName);
Class[] y = clazz.getDeclaredClasses();
if (y == null || y.length <= 0) {
@@ -824,7 +931,7 @@ public class ReflectionUtils {
}
else {
boolean found = false;
- for (Class h : y) {
+ for (Class<?> h : y) {
Logger.REFLECTION("Found hidden inner class: "+h.getCanonicalName());
if (h.getSimpleName().toLowerCase().equals(aData[aData.length-1].toLowerCase())) {
Logger.REFLECTION("Found correct class. ["+aData[aData.length-1]+"] Caching at correct location: "+string);
diff --git a/src/Java/gtPlusPlus/everglades/biome/BiomeGenerator_Custom.java b/src/Java/gtPlusPlus/everglades/biome/BiomeGenerator_Custom.java
index 83dedc376a..0f8acd75b4 100644
--- a/src/Java/gtPlusPlus/everglades/biome/BiomeGenerator_Custom.java
+++ b/src/Java/gtPlusPlus/everglades/biome/BiomeGenerator_Custom.java
@@ -21,10 +21,6 @@ import net.minecraftforge.event.terraingen.OreGenEvent;
import net.minecraftforge.event.terraingen.TerrainGen;
public class BiomeGenerator_Custom extends BiomeDecorator {
- /** The world the BiomeDecorator is currently decorating */
- public World currentWorld;
- /** The Biome Decorator's random number generator. */
- public Random randomGenerator;
public WorldGenerator fluoriteGen;
diff --git a/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java b/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java
index b5f5fa7989..dae1a663d7 100644
--- a/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java
+++ b/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java
@@ -220,7 +220,8 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler {
@Override
public int compareTo(CachedRecipe o) {
- if (o instanceof DecayableRecipeNEI) {
+ boolean b = DecayableRecipeNEI.class.isInstance(o);
+ if (b) {
DecayableRecipeNEI p = (DecayableRecipeNEI) o;
if (p.time > this.time) {
return 1;
@@ -232,5 +233,30 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler {
}
return 0;
}
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj != null) {
+ if (DecayableRecipeNEI.class.isInstance(obj)) {
+ DecayableRecipeNEI p = (DecayableRecipeNEI) obj;
+ if (p != null) {
+ // Time check first to keep it simple and not unbox the Recipes.
+ if (p.time == this.time) {
+ ItemStack aInput = p.input.item;
+ ItemStack aOutput = p.output.item;
+ if (GT_Utility.areStacksEqual(aInput, this.input.item, true)) {
+ if (GT_Utility.areStacksEqual(aOutput, this.output.item, true)) {
+ return true;
+ }
+ }
+ }
+ }
+
+ }
+ }
+ return false;
+ }
+
+
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java b/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java
new file mode 100644
index 0000000000..e4279cf489
--- /dev/null
+++ b/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java
@@ -0,0 +1,458 @@
+package gtPlusPlus.nei;
+
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.lwjgl.opengl.GL11;
+
+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_Recipe.GT_Recipe_Map;
+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 net.minecraftforge.fluids.FluidContainerRegistry;
+import net.minecraftforge.fluids.FluidStack;
+
+public class GT_NEI_FluidReactor
+extends TemplateRecipeHandler {
+ public static final int sOffsetX = 5;
+ public static final int sOffsetY = 11;
+
+ static {
+ GuiContainerManager.addInputHandler(new GT_RectHandler());
+ GuiContainerManager.addTooltipHandler(new GT_RectHandler());
+ }
+
+ protected final 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]));
+ if (!NEI_GT_Config.sIsAdded) {
+ FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getOverlayIdentifier());
+ GuiCraftingRecipe.craftinghandlers.add(this);
+ GuiUsageRecipe.usagehandlers.add(this);
+ }
+ }
+
+ public 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);
+ }
+
+ @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 (!tRecipe.mHidden) {
+ this.arecipes.add(new CachedDefaultRecipe(tRecipe));
+ }
+ }
+ } else {
+ super.loadCraftingRecipes(outputId, results);
+ }
+ }
+
+ @Override
+ public void loadCraftingRecipes(final ItemStack aResult) {
+ final ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult);
+
+ final ArrayList<ItemStack> tResults = new ArrayList<ItemStack>();
+ tResults.add(aResult);
+ tResults.add(GT_OreDictUnificator.get(true, aResult));
+ if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) {
+ for (final OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) {
+ tResults.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L));
+ }
+ }
+ final FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true);
+ if (tFluid != null) {
+ tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false));
+ for (final 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) {
+ if (!tRecipe.mHidden) {
+ final CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe);
+ for (final ItemStack tStack : tResults) {
+ if (tNEIRecipe.contains(tNEIRecipe.mOutputs, tStack)) {
+ this.arecipes.add(tNEIRecipe);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public void loadUsageRecipes(final ItemStack aInput) {
+ final ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput);
+
+ final 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) {
+ tInputs.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L));
+ }
+ }
+ final FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true);
+ if (tFluid != null) {
+ tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false));
+ for (final 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) {
+ if (!tRecipe.mHidden) {
+ final CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe);
+ for (final ItemStack tStack : tInputs) {
+ if (tNEIRecipe.contains(tNEIRecipe.mInputs, tStack)) {
+ this.arecipes.add(tNEIRecipe);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public String getOverlayIdentifier() {
+ //return this.mRecipeMap.mNEIName;
+ return "Penis";
+ }
+
+ @Override
+ public void drawBackground(final int recipe) {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GuiDraw.changeTexture(this.getGuiTexture());
+ GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 78);
+ }
+
+ @Override
+ public int recipiesPerPage() {
+ return 1;
+ }
+
+ @Override
+ public String getRecipeName() {
+ //return GT_LanguageManager.getTranslation(this.mRecipeMap.mUnlocalizedName);
+ return " Chem Plant";
+ }
+
+ @Override
+ public String getGuiTexture() {
+ return CORE.MODID+":textures/gui/FluidReactor.png";
+ }
+
+ @Override
+ public List<String> handleItemTooltip(final GuiRecipe gui, final ItemStack aStack, final List<String> currenttip, final int aRecipeIndex) {
+ final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex);
+ if ((tObject instanceof CachedDefaultRecipe)) {
+ final CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject;
+ for (final PositionedStack tStack : tRecipe.mOutputs) {
+ if (aStack == tStack.item) {
+ if ((!(tStack instanceof FixedPositionedStack)) || (((FixedPositionedStack) tStack).mChance <= 0) || (((FixedPositionedStack) tStack).mChance == 10000)) {
+ break;
+ }
+ currenttip.add("Chance: " + (((FixedPositionedStack) tStack).mChance / 100) + "." + ((((FixedPositionedStack) tStack).mChance % 100) < 10 ? "0" + (((FixedPositionedStack) tStack).mChance % 100) : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100)) + "%");
+ break;
+ }
+ }
+ for (final PositionedStack tStack : tRecipe.mInputs) {
+ if (aStack == tStack.item) {
+ if ((gregtech.api.enums.ItemList.Display_Fluid.isStackEqual(tStack.item, true, true)) ||
+ (tStack.item.stackSize != 0)) {
+ break;
+ }
+ currenttip.add("Does not get consumed in the process");
+ break;
+ }
+ }
+ }
+ return currenttip;
+ }
+
+ @Override
+ public void drawExtras(final int aRecipeIndex) {
+ final long tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt;
+ final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration;
+ if (tEUt != 0) {
+ drawText(10, 73, "Total: " + (long) (tDuration * tEUt) + " EU", -16777216);
+ //drawText(10, 83, "Usage: " + tEUt + " EU/t", -16777216);
+ if (this.mRecipeMap.mShowVoltageAmperageInNEI) {
+ drawText(10, 83, "Voltage: " + (tEUt / this.mRecipeMap.mAmperage) + " EU/t", -16777216);
+ drawText(10, 93, "Amperage: " + this.mRecipeMap.mAmperage, -16777216);
+ } else {
+ drawText(10, 93, "Voltage: unspecified", -16777216);
+ drawText(10, 103, "Amperage: unspecified", -16777216);
+ }
+ }
+ if (tDuration > 0) {
+ drawText(10, 103, "Time: " + (tDuration < 20 ? "< 1" : Integer.valueOf(tDuration / 20)) + " secs", -16777216);
+ }
+ if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) {
+ drawText(10, 113, this.mRecipeMap.mNEISpecialValuePre + (((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, -16777216);
+ }
+ }
+
+ public static class GT_RectHandler
+ implements IContainerInputHandler, IContainerTooltipHandler {
+ @Override
+ public boolean mouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) {
+ if (this.canHandle(gui)) {
+ if (button == 0) {
+ return this.transferRect(gui, false);
+ }
+ if (button == 1) {
+ return this.transferRect(gui, true);
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean lastKeyTyped(final GuiContainer gui, final char keyChar, final int keyCode) {
+ return false;
+ }
+
+ public boolean canHandle(final GuiContainer gui) {
+ return (((gui instanceof GT_GUIContainer_BasicMachine)) && (GT_Utility.isStringValid(((GT_GUIContainer_BasicMachine) gui).mNEI)) /*|| ((gui instanceof GT_GUIContainer_FusionReactor)) && (GT_Utility.isStringValid(((GT_GUIContainer_FusionReactor) gui).mNEI))*/);
+ }
+
+ @Override
+ public List<String> handleTooltip(final GuiContainer gui, final int mousex, final int mousey, final List<String> currenttip) {
+ if ((this.canHandle(gui)) && (currenttip.isEmpty())) {
+ if ((gui instanceof GT_GUIContainer_BasicMachine) && new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) {
+ currenttip.add("Recipes");
+ } /*else if (gui instanceof GT_GUIContainer_FusionReactor && new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) {
+ currenttip.add("Recipes");
+ }*/
+
+ }
+ return currenttip;
+ }
+
+ private boolean transferRect(final GuiContainer gui, final boolean usage) {
+ if (gui instanceof GT_GUIContainer_BasicMachine) {
+ return (this.canHandle(gui)) && (new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0]));
+ } /*else if (gui instanceof GT_GUIContainer_FusionReactor) {
+ return (canHandle(gui)) && (new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0]));
+ }*/
+ return false;
+ }
+
+ @Override
+ public List<String> handleItemDisplayName(final GuiContainer gui, final ItemStack itemstack, final List<String> currenttip) {
+ return currenttip;
+ }
+
+ @Override
+ public List<String> handleItemTooltip(final GuiContainer gui, final ItemStack itemstack, final int mousex, final int mousey, final List<String> currenttip) {
+ return currenttip;
+ }
+
+ @Override
+ public boolean keyTyped(final GuiContainer gui, final char keyChar, final int keyCode) {
+ return false;
+ }
+
+ @Override
+ public void onKeyTyped(final GuiContainer gui, final char keyChar, final int keyID) {
+ }
+
+ @Override
+ public void onMouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) {
+ }
+
+ @Override
+ public void onMouseUp(final GuiContainer gui, final int mousex, final int mousey, final int button) {
+ }
+
+ @Override
+ public boolean mouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) {
+ return false;
+ }
+
+ @Override
+ public void onMouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) {
+ }
+
+ @Override
+ public void onMouseDragged(final GuiContainer gui, final int mousex, final int mousey, final int button, final long heldTime) {
+ }
+ }
+
+ public class FixedPositionedStack
+ extends PositionedStack {
+ public final int mChance;
+ public boolean permutated = false;
+
+ public FixedPositionedStack(final Object object, final int x, final int y) {
+ this(object, x, y, 0);
+ }
+
+ public FixedPositionedStack(final Object object, final int x, final int y, final int aChance) {
+ super(object, x, y, true);
+ this.mChance = aChance;
+ }
+
+ @Override
+ public void generatePermutations() {
+ if (this.permutated) {
+ return;
+ }
+ final ArrayList<ItemStack> tDisplayStacks = new ArrayList<ItemStack>();
+ for (final ItemStack tStack : this.items) {
+ if (GT_Utility.isStackValid(tStack)) {
+ if (tStack.getItemDamage() == 32767) {
+ final List<ItemStack> permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem());
+ if (!permutations.isEmpty()) {
+ ItemStack stack;
+ for (final Iterator<ItemStack> i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[]{stack}))) {
+ stack = i$.next();
+ }
+ } else {
+ final ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize);
+ base.stackTagCompound = tStack.stackTagCompound;
+ tDisplayStacks.add(base);
+ }
+ } else {
+ tDisplayStacks.add(GT_Utility.copy(new Object[]{tStack}));
+ }
+ }
+ }
+ this.items = (tDisplayStacks.toArray(new ItemStack[0]));
+ if (this.items.length == 0) {
+ this.items = new ItemStack[]{new ItemStack(Blocks.fire)};
+ }
+ this.permutated = true;
+ this.setPermutationToRender(0);
+ }
+ }
+
+ public class CachedDefaultRecipe
+ extends TemplateRecipeHandler.CachedRecipe {
+ public final GT_Recipe mRecipe;
+ public final List<PositionedStack> mOutputs = new ArrayList<PositionedStack>();
+ public final List<PositionedStack> mInputs = new ArrayList<PositionedStack>();
+
+ public CachedDefaultRecipe(final GT_Recipe aRecipe) {
+ super();
+ this.mRecipe = aRecipe;
+
+ int tStartIndex = 0;
+
+ // Four Input Slots
+ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
+ this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 3, -4));
+ }
+ tStartIndex++;
+ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
+ this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 21, -4));
+ }
+ tStartIndex++;
+ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
+ this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 39, -4));
+ }
+ tStartIndex++;
+ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
+ this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 57, -4));
+ }
+ tStartIndex++;
+
+
+ if (aRecipe.mSpecialItems != null) {
+ this.mInputs.add(new FixedPositionedStack(aRecipe.mSpecialItems, 120, 52));
+ }
+ tStartIndex = 0;
+
+ //Four Output Slots
+ if (aRecipe.getOutput(tStartIndex) != null) {
+ this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex)));
+ }
+ tStartIndex++;
+ if (aRecipe.getOutput(tStartIndex) != null) {
+ this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex)));
+ }
+ tStartIndex++;
+ if (aRecipe.getOutput(tStartIndex) != null) {
+ this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex)));
+ }
+ tStartIndex++;
+ if (aRecipe.getOutput(tStartIndex) != null) {
+ this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex)));
+ }
+ tStartIndex++;
+
+
+ //New fluid display behaviour when 3 fluid inputs are detected. (Basically a mix of the code below for outputs an the code above for 9 input slots.)
+ if (aRecipe.mFluidInputs.length >= 1) {
+ if ((aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) {
+ this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 3, 31));
+ }
+ if ((aRecipe.mFluidInputs.length > 1) && (aRecipe.mFluidInputs[1] != null) && (aRecipe.mFluidInputs[1].getFluid() != null)) {
+ this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[1], true), 21, 31));
+ }
+ if ((aRecipe.mFluidInputs.length > 2) && (aRecipe.mFluidInputs[2] != null) && (aRecipe.mFluidInputs[2].getFluid() != null)) {
+ this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[2], true), 39, 31));
+ }
+ if ((aRecipe.mFluidInputs.length > 3) && (aRecipe.mFluidInputs[3] != null) && (aRecipe.mFluidInputs[3].getFluid() != null)) {
+ this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[3], true), 57, 31));
+ }
+ }
+
+ if (aRecipe.mFluidOutputs.length > 0) {
+ if ((aRecipe.mFluidOutputs[0] != null) && (aRecipe.mFluidOutputs[0].getFluid() != null)) {
+ this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 138, 5));
+ }
+ if ((aRecipe.mFluidOutputs.length > 1) && (aRecipe.mFluidOutputs[1] != null) && (aRecipe.mFluidOutputs[1].getFluid() != null)) {
+ this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[1], true), 138, 23));
+ }
+ }
+ }
+
+ @Override
+ public List<PositionedStack> getIngredients() {
+ return this.getCycledIngredients(GT_NEI_FluidReactor.this.cycleticks / 10, this.mInputs);
+ }
+
+ @Override
+ public PositionedStack getResult() {
+ return null;
+ }
+
+ @Override
+ public List<PositionedStack> getOtherStacks() {
+ return this.mOutputs;
+ }
+ }
+}
diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_MultiBlockHandler.java b/src/Java/gtPlusPlus/nei/GT_NEI_MultiBlockHandler.java
index 6612ab703f..e3c980e6a4 100644
--- a/src/Java/gtPlusPlus/nei/GT_NEI_MultiBlockHandler.java
+++ b/src/Java/gtPlusPlus/nei/GT_NEI_MultiBlockHandler.java
@@ -928,7 +928,7 @@ extends TemplateRecipeHandler {
}
- public class recipeCompare implements Comparator<GT_Recipe> {
+ public class RecipeCompare implements Comparator<GT_Recipe> {
public int compare(GT_Recipe a, GT_Recipe b) {
if (a.mEUt != b.mEUt) {
return a.mEUt - b.mEUt;
diff --git a/src/Java/gtPlusPlus/nei/NEI_GT_Config.java b/src/Java/gtPlusPlus/nei/NEI_GT_Config.java
index ab949bd517..ad03040059 100644
--- a/src/Java/gtPlusPlus/nei/NEI_GT_Config.java
+++ b/src/Java/gtPlusPlus/nei/NEI_GT_Config.java
@@ -18,10 +18,13 @@ implements IConfigureNEI {
}
}
for (final Gregtech_Recipe_Map tMap : gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map.sMappings) {
- if (tMap.mNEIAllowed) {
- new GT_NEI_MultiBlockHandler(tMap);
+ if (tMap.mNEIAllowed) {
+ if (!tMap.mUnlocalizedName.equals(Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.mUnlocalizedName)) {
+ new GT_NEI_MultiBlockHandler(tMap);
+ }
}
}
+ new GT_NEI_FluidReactor(Gregtech_Recipe_Map.sFluidChemicalReactorRecipes);
sIsAdded = true;
API.registerRecipeHandler(new DecayableRecipeHandler());
API.registerUsageHandler(new DecayableRecipeHandler());
diff --git a/src/Java/gtPlusPlus/plugin/agrichem/AlgaeDefinition.java b/src/Java/gtPlusPlus/plugin/agrichem/AlgaeDefinition.java
new file mode 100644
index 0000000000..c6e98581ff
--- /dev/null
+++ b/src/Java/gtPlusPlus/plugin/agrichem/AlgaeDefinition.java
@@ -0,0 +1,60 @@
+package gtPlusPlus.plugin.agrichem;
+
+public enum AlgaeDefinition {
+
+ /*
+ * In general, the productivity of freshwater algae is primarily limited by
+ * the availability of the nutrient phosphate (PO4-3), while that of
+ * marine algae is limited by nitrate (NO3-) or ammonium (NH4+).
+ * Some algal species, however, may have unusual nutrient requirements,
+ * and their productivity may be limited by certain micronutrients,
+ * such as silica, in the case of diatoms.
+ */
+
+ Euglenophyta("Euglenophyta", "Euglenoids", true, false, getRGB(147, 168, 50)),
+ Chrysophyta("Chrysophyta", "Golden-Brown Algae", true, true, getRGB(186, 146, 0)),
+ Pyrrophyta("Pyrrophyta", "Fire Algae", true, true, getRGB(250, 118, 2)),
+ Chlorophyta("Chlorophyta", "Green Algae", true, true, getRGB(99, 181, 62)),
+ Rhodophyta("Rhodophyta", "Red Algae", false, true, getRGB(153, 5, 22)),
+ Paeophyta("Paeophyta", "Brown Algae", false, true, getRGB(94, 78, 47)),
+ Xanthophyta("Xanthophyta", "Yellow-Green Algae", true, false, getRGB(118, 138, 16));
+
+ public final String mScientificName;
+ public final String mSimpleName;
+ public final boolean mSaltWater;
+ public final boolean mFreshWater;
+ public final int mColour;
+
+ AlgaeDefinition(String aScientificName, String aSimpleName, boolean aFresh, boolean aSalt, int aColour) {
+ mScientificName = aScientificName;
+ mSimpleName = aSimpleName;
+ mFreshWater = aFresh;
+ mSaltWater = aSalt;
+ mColour = aColour;
+ }
+
+ public static AlgaeDefinition getByIndex(int aIndex) {
+ switch(aIndex) {
+ default:
+ case 0:
+ return Euglenophyta;
+ case 1:
+ return Chrysophyta;
+ case 2:
+ return Pyrrophyta;
+ case 3:
+ return Chlorophyta;
+ case 4:
+ return Rhodophyta;
+ case 5:
+ return Paeophyta;
+ case 6:
+ return Xanthophyta;
+ }
+ }
+
+ private final static int getRGB(int r, int g, int b) {
+ return AlgaeUtils.rgbtoHexValue(r, g, b);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/plugin/agrichem/AlgaeUtils.java b/src/Java/gtPlusPlus/plugin/agrichem/AlgaeUtils.java
new file mode 100644
index 0000000000..73ff23888c
--- /dev/null
+++ b/src/Java/gtPlusPlus/plugin/agrichem/AlgaeUtils.java
@@ -0,0 +1,11 @@
+package gtPlusPlus.plugin.agrichem;
+
+import gtPlusPlus.core.util.Utils;
+
+public class AlgaeUtils {
+
+ public static int rgbtoHexValue(final int r, final int g, final int b) {
+ return Utils.rgbtoHexValue(r, g, b);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java b/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java
new file mode 100644
index 0000000000..1179e13a2f
--- /dev/null
+++ b/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java
@@ -0,0 +1,1428 @@
+package gtPlusPlus.plugin.agrichem;
+
+import static gtPlusPlus.core.lib.CORE.GTNH;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.util.GT_ModHandler;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.core.item.ModItems;
+import gtPlusPlus.core.item.base.BaseItemComponent;
+import gtPlusPlus.core.item.chemistry.AgriculturalChem;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.material.ALLOY;
+import gtPlusPlus.core.material.MISC_MATERIALS;
+import gtPlusPlus.core.recipe.common.CI;
+import gtPlusPlus.core.util.minecraft.FluidUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.minecraft.MaterialUtils;
+import gtPlusPlus.core.util.minecraft.OreDictUtils;
+import gtPlusPlus.core.util.minecraft.RecipeUtils;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import gtPlusPlus.plugin.agrichem.block.AgrichemFluids;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.railcraft.utils.RailcraftUtils;
+import ic2.core.Ic2Items;
+import net.minecraft.enchantment.Enchantment;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.oredict.OreDictionary;
+
+public class BioRecipes {
+
+ private static Item mFert;
+ private static Item mDustDirt;
+
+ private static Fluid mSalineWater;
+ private static Fluid mDistilledWater;
+ private static Fluid mThermalWater;
+ private static Fluid mAir;
+ private static Fluid mSulfuricWasteWater;
+ private static Fluid mAmmonia;
+ private static Fluid mMethanol;
+ private static Fluid mAceticAcid;
+ private static Fluid mPropionicAcid;
+ private static Fluid mLiquidPlastic;
+ private static Fluid mFermentationBase;
+ private static Fluid mCarbonDioxide;
+ private static Fluid mCarbonMonoxide;
+ private static Fluid mEthylene;
+ private static Fluid mEthanol;
+ private static Fluid mChlorine;
+ private static Fluid mHydrogen;
+ private static Fluid mDilutedSulfuricAcid;
+ private static Fluid mSulfuricAcid;
+ private static Fluid mUrea;
+ private static Fluid mFormaldehyde;
+ private static Fluid mLiquidResin;
+ private static Fluid mMethane;
+ private static Fluid mBenzene;
+ private static Fluid mEthylbenzene;
+ private static Fluid mStyrene;
+ private static Fluid mButanol;
+ private static Fluid mAcetone;
+
+
+ private static final ItemStack getGreenAlgaeRecipeChip() {
+ return getBioChip(4);
+ }
+ private static final ItemStack getBrownAlgaeRecipeChip() {
+ return getBioChip(8);
+ }
+ private static final ItemStack getGoldenBrownAlgaeRecipeChip() {
+ return getBioChip(12);
+ }
+ private static final ItemStack getRedAlgaeRecipeChip() {
+ return getBioChip(16);
+ }
+
+ private static final ItemStack getBioChip(int aID) {
+ return ItemUtils.simpleMetaStack(AgriculturalChem.mBioCircuit, aID, 0);
+ }
+
+ public static void init() {
+ Logger.INFO("[Bio] Setting Variables");
+ initRecipeVars();
+ Logger.INFO("[Bio] Generating Biochip Recipes");
+ recipeBioChip();
+ Logger.INFO("[Bio] Generating Recipes");
+ recipeAlgaeBiomass();
+ Logger.INFO("[Bio] Finished with recipes");
+ }
+
+ private static final void initRecipeVars() {
+ mFert = AgriculturalChem.dustOrganicFertilizer;
+ mDustDirt = AgriculturalChem.dustDirt;
+
+ // 5.08 Salt Water Solution ;)
+ if (!FluidUtils.doesFluidExist("saltwater")){
+ mSalineWater = FluidUtils.generateFluidNoPrefix("saltwater", "Salt Water", 200, new short[]{10, 30, 220, 100});
+ }
+ else {
+ Materials aSaltWater = MaterialUtils.getMaterial("saltwater");
+ if (aSaltWater != null) {
+ FluidStack aWaterStack = aSaltWater.getFluid(1);
+ if (aWaterStack != null) {
+ mSalineWater = aSaltWater.getFluid(1).getFluid();
+ }
+ }
+ if (mSalineWater == null) {
+ mSalineWater = FluidUtils.getWildcardFluidStack("saltwater", 1).getFluid();
+ }
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellSaltWater", 1) == null){
+ new BaseItemComponent("saltwater", "Salt Water", new short[] {10, 30, 220});
+ }
+ }
+
+ mDistilledWater = FluidUtils.getDistilledWater(1).getFluid();
+ mThermalWater = FluidUtils.getFluidStack("ic2hotwater", 1).getFluid();
+ mAir = FluidUtils.getFluidStack("air", 1).getFluid();
+ mSulfuricWasteWater = FluidUtils.getFluidStack("sulfuricapatite", 1).getFluid();
+ mAmmonia = MISC_MATERIALS.AMMONIA.getFluid(1).getFluid();
+ mEthylene = FluidUtils.getFluidStack("ethylene", 1).getFluid();
+ mEthanol = FluidUtils.getFluidStack("bioethanol", 1).getFluid();
+ mDilutedSulfuricAcid = FluidUtils.getFluidStack("dilutedsulfuricacid", 1).getFluid();
+ mSulfuricAcid = FluidUtils.getFluidStack("sulfuricacid", 1).getFluid();
+ mFormaldehyde = FluidUtils.getFluidStack("fluid.formaldehyde", 1).getFluid();
+ mMethane = FluidUtils.getFluidStack("methane", 1).getFluid();
+ mBenzene = FluidUtils.getFluidStack("benzene", 1).getFluid();
+ mEthylbenzene = FluidUtils.getFluidStack("fluid.ethylbenzene", 1).getFluid();
+ mStyrene = FluidUtils.getFluidStack("styrene", 1).getFluid();
+ mMethanol = FluidUtils.getFluidStack("methanol", 1).getFluid();
+ mLiquidPlastic = FluidUtils.getWildcardFluidStack("plastic", 1).getFluid();
+ mCarbonDioxide = MISC_MATERIALS.CARBON_DIOXIDE.getFluid(1).getFluid();
+ mCarbonMonoxide = MISC_MATERIALS.CARBON_MONOXIDE.getFluid(1).getFluid();
+ mChlorine = FluidUtils.getFluidStack("chlorine", 1).getFluid();
+ mHydrogen = FluidUtils.getFluidStack("hydrogen", 1).getFluid();
+ mAceticAcid = AgrichemFluids.mAceticAcid;
+ mPropionicAcid = AgrichemFluids.mPropionicAcid;
+ mUrea = AgrichemFluids.mUrea;
+ mLiquidResin = AgrichemFluids.mLiquidResin;
+ mFermentationBase = AgrichemFluids.mFermentationBase;
+ mButanol = AgrichemFluids.mButanol;
+ mAcetone = AgrichemFluids.mAcetone;
+ }
+
+ private static void recipeAlgaeBiomass() {
+
+ // TODO
+ // Add in recipes to get initial Biomass
+
+ recipeGreenAlgae();
+ recipeBrownAlgae();
+ recipeGoldenBrownAlgae();
+ recipeRedAlgae();
+ recipeWoodPellets();
+ recipeWoodBricks();
+ recipeCellulosePulp();
+ recipeCatalystCarrier();
+ recipeAluminiumSilverCatalyst();
+ recipeAceticAcid();
+ recipePropionicAcid();
+ recipeFermentationBase();
+ recipeEthanol();
+ recipeCelluloseFibre();
+ recipeGoldenBrownCelluloseFiber();
+ recipeRedCelluloseFiber();
+ recipeSodiumHydroxide();
+ recipeSodiumCarbonate();
+ recipePelletMold();
+ recipeAluminiumPellet();
+ recipeAlumina();
+ recipeAluminium();
+ recipeCalciumCarbonate();
+ recipeLithiumChloride();
+ recipeAlginicAcid();
+ recipeSulfuricAcid();
+ recipeUrea();
+ recipeRawBioResin();
+ recipeLiquidResin();
+ recipeCompost();
+ recipeMethane();
+ recipeBenzene();
+ recipeStyrene();
+ registerFuels();
+ }
+
+ private static void registerFuels() {
+
+ // Burnables
+ ItemUtils.registerFuel(ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1), 800);
+ ItemUtils.registerFuel(ItemUtils.getSimpleStack(AgriculturalChem.mWoodBrick, 1), 4800);
+
+ // Gas Fuels
+ //GT_Values.RA.addFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellCoalGas", 1), null, 96, 1);
+
+ //Combustion Fuels
+ GT_Values.RA.addFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellButanol", 1), null, 1125, 0);
+
+ }
+ private static void recipeGreenAlgae() {
+ // Compost
+ GT_ModHandler.addPulverisationRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 10),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1));
+
+ // Turn into Cellulose
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ getGreenAlgaeRecipeChip(),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 30)
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 5),
+ 30 * 30,
+ 16);
+
+
+ }
+
+ private static void recipeBrownAlgae() {
+ // Compost
+ GT_ModHandler.addPulverisationRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 10),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1));
+
+ // Alginic acid
+ CORE.RA.addExtractorRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 10),
+ ItemUtils.getSimpleStack(AgriculturalChem.mAlginicAcid, 1),
+ 20 * 15,
+ 30);
+
+ // Lithium Chloride
+ GT_Values.RA.addBlastRecipe(
+ getBrownAlgaeRecipeChip(),
+ ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 20),
+ GT_Values.NF,
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mLithiumChloride, 1),
+ GT_Values.NI,
+ 120,
+ 120,
+ 1200);
+
+ // Sodium Carbonate
+ CORE.RA.addChemicalRecipe(
+ getBrownAlgaeRecipeChip(),
+ ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 20),
+ FluidUtils.getDistilledWater(2000),
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 1),
+ 20 * 30,
+ 30);
+
+ }
+
+ private static void recipeGoldenBrownAlgae() {
+ // Compost
+ GT_ModHandler.addPulverisationRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, 10),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1));
+
+ // Turn into Cellulose
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ getGoldenBrownAlgaeRecipeChip(),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, 30)
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 5),
+ 30 * 30,
+ 120);
+
+ }
+
+ private static void recipeRedAlgae() {
+ // Compost
+ GT_ModHandler.addPulverisationRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 10),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1));
+
+ // Turn into Cellulose
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ getRedAlgaeRecipeChip(),
+ ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 30)
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 5),
+ 30 * 30,
+ 240);
+
+ }
+
+ private static void recipeCelluloseFibre() {
+
+ CORE.RA.addChemicalRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 20),
+ ItemUtils.getSimpleStack(AgriculturalChem.mAlginicAcid, 2),
+ GT_Values.NF,
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 10),
+ 45 * 20,
+ 16);
+
+ // Craft into Wood Pellets
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ getBioChip(2),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 12)
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 2),
+ 20 * 4,
+ 8);
+
+ // Methanol Extraction
+ GT_Values.RA.addFluidExtractionRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 12),
+ GT_Values.NI,
+ FluidUtils.getFluidStack(mMethanol, 50),
+ 10000,
+ 20 * 30,
+ 30);
+
+ // Compost
+ GT_ModHandler.addPulverisationRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 5),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1));
+
+ // Plastic
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(16),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 64),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mAceticAcid, 500),
+ FluidUtils.getFluidStack(BioRecipes.mPropionicAcid, 500),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mLiquidPlastic, (144)),
+ },
+ 120 * 20,
+ 240,
+ 2);
+
+
+ }
+
+ private static void recipeWoodPellets() {
+ // Shapeless Recipe
+ RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1)
+ }, ItemUtils.getSimpleStack(AgriculturalChem.mWoodBrick, 2));
+
+ // Extruder Recipe
+ GT_Values.RA.addExtruderRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 12),
+ ItemUtils.getSimpleStack(AgriculturalChem.mPelletMold, 0),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 3),
+ 20 * 10,
+ 16);
+
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ getBioChip(2),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 8)
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodBrick, 2),
+ 20 * 5,
+ 8);
+
+ // CO2
+ CORE.RA.addFluidExtractionRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
+ FluidUtils.getFluidStack(mCarbonDioxide, 70),
+ 10*20,
+ 30);
+
+
+ // Add Charcoal Recipe
+ if (LoadedMods.Railcraft) {
+ RailcraftUtils.addCokeOvenRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 2),
+ true,
+ true,
+ ItemUtils.getItemStackOfAmountFromOreDict("gemCharcoal", 3),
+ GT_Values.NF,
+ 1200);
+ }
+ CORE.RA.addCokeOvenRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 2),
+ getBioChip(3),
+ null,
+ GT_Values.NF,
+ ItemUtils.getItemStackOfAmountFromOreDict("gemCharcoal", 3),
+ 120,
+ 16);
+
+
+ }
+
+ private static void recipeWoodBricks() {
+
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ getBioChip(3),
+ ItemUtils.getOrePrefixStack(OrePrefixes.dust, Materials.Wood, 50)
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodBrick, 1),
+ 100 * 20,
+ 16);
+ }
+
+ private static void recipeCellulosePulp() {
+
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ getBioChip(2),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 4)
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(Items.paper, 1),
+ 60 * 20,
+ 16);
+ }
+
+ private static void recipeCatalystCarrier() {
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ getBioChip(20),
+ ItemUtils.getItemStackOfAmountFromOreDict("plateSteel", GTNH ? 8 : 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("wireFineCopper", GTNH ? 4 : 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("screwTin", GTNH ? 6 : 3)
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 1),
+ 300 * 20,
+ 16);
+ }
+
+ private static void recipeAluminiumSilverCatalyst() {
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ getBioChip(4),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 10),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSilver", 4)
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 10),
+ 20 * 20,
+ 30);
+ }
+
+ private static void recipeAceticAcid() {
+
+ /* GT_Values.RA.addMixerRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 10),
+ var2,
+ var3, var4,
+ var5, // Fluid in
+ var6, // Fluid out
+ var7, // Item Out
+ var8, // Time
+ var9); // Eu
+ */
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 1)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mMethanol, 700),
+ FluidUtils.getFluidStack(BioRecipes.mCarbonMonoxide, 300),
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 2000),
+ },
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 1)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mAceticAcid, 250),
+ },
+ 120 * 20,
+ 60,
+ 1);
+
+ CORE.RA.addDehydratorRecipe(
+ CI.emptyCells(1),
+ FluidUtils.getFluidStack(mFermentationBase, 4000),
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellAceticAcid", 1)
+ },
+ 60 * 20,
+ 16);
+
+
+ }
+
+
+
+ public final static HashSet<GT_ItemStack> mFruits = new HashSet<GT_ItemStack>();
+ public final static HashSet<GT_ItemStack> mVege = new HashSet<GT_ItemStack>();
+ public final static HashSet<GT_ItemStack> mNuts = new HashSet<GT_ItemStack>();
+ public final static HashSet<GT_ItemStack> mSeeds = new HashSet<GT_ItemStack>();
+
+ public final static AutoMap<ItemStack> mList_Master_FruitVege = new AutoMap<ItemStack>();
+ public final static AutoMap<ItemStack> mList_Master_Seeds = new AutoMap<ItemStack>();
+
+ private static void processFermentationOreDict() {
+ processOreDictEntry("listAllfruit", mFruits);
+ processOreDictEntry("listAllFruit", mFruits);
+ processOreDictEntry("listAllveggie", mVege);
+ processOreDictEntry("listAllVeggie", mVege);
+ processOreDictEntry("listAllnut", mNuts);
+ processOreDictEntry("listAllNut", mNuts);
+ processOreDictEntry("listAllseed", mSeeds);
+ processOreDictEntry("listAllSeed", mSeeds);
+
+ if (!mFruits.isEmpty()) {
+ for (GT_ItemStack g : mFruits) {
+ mList_Master_FruitVege.put(g.toStack());
+ }
+ }
+ if (!mVege.isEmpty()) {
+ for (GT_ItemStack g : mVege) {
+ mList_Master_FruitVege.put(g.toStack());
+ }
+ }
+ if (!mNuts.isEmpty()) {
+ for (GT_ItemStack g : mNuts) {
+ mList_Master_FruitVege.put(g.toStack());
+ }
+ }
+ if (!mSeeds.isEmpty()) {
+ for (GT_ItemStack g : mSeeds) {
+ mList_Master_Seeds.put(g.toStack());
+ }
+ }
+ }
+
+ // Make Fermentation
+ private static void processOreDictEntry(String aOreName, HashSet<GT_ItemStack> mfruits2) {
+ ArrayList<ItemStack> aTemp = OreDictionary.getOres(aOreName);
+ if (!aTemp.isEmpty()) {
+ for (ItemStack stack : aTemp) {
+ mfruits2.add(new GT_ItemStack(stack));
+ }
+ }
+ }
+
+
+ private static void recipeFermentationBase() {
+ processFermentationOreDict();
+ AutoMap<ItemStack> aFruitVege = mList_Master_FruitVege;
+ AutoMap<ItemStack> aSeeds = mList_Master_Seeds;
+ ArrayList<ItemStack> aMap = OreDictionary.getOres("cropSugarbeet");
+ for (ItemStack a : aFruitVege) {
+ if (aMap.contains(a)) {
+ continue;
+ }
+ if (ItemUtils.checkForInvalidItems(a)) {
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(2),
+ ItemUtils.getSimpleStack(a, 10)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 200),
+ },
+ 60 * 20,
+ 2,
+ 1);
+ }
+
+ }
+ for (ItemStack a : aSeeds) {
+ if (ItemUtils.checkForInvalidItems(a)) {
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(3),
+ ItemUtils.getSimpleStack(a, 20)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 50),
+ },
+ 60 * 20,
+ 2,
+ 1);
+ }
+ }
+
+ // Sugar Cane
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(4),
+ ItemUtils.getSimpleStack(Items.reeds, 16)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 75),
+ },
+ 90 * 20,
+ 30,
+ 1);
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(5),
+ ItemUtils.getSimpleStack(Items.reeds, 32),
+ ItemUtils.getSimpleStack(ModItems.dustCalciumCarbonate, 4)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mThermalWater, 2000),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 150),
+ },
+ 120 * 20,
+ 30,
+ 1);
+
+ // Sugar Beet
+ if (OreDictUtils.containsValidEntries("cropSugarbeet")) {
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(4),
+ ItemUtils.getItemStackOfAmountFromOreDict("cropSugarbeet", 8),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 75),
+ },
+ 60 * 20,
+ 30,
+ 1);
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(5),
+ ItemUtils.getItemStackOfAmountFromOreDict("cropSugarbeet", 16),
+ ItemUtils.getSimpleStack(ModItems.dustCalciumCarbonate, 4)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mThermalWater, 2000),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 150),
+ },
+ 90 * 20,
+ 30,
+ 1);
+ }
+
+ // Produce Acetone, Butanol and Ethanol
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(5),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellFermentationBase", 48),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 16),
+ ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 16),
+ },
+ new FluidStack[] {
+
+ },
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellButanol", 6),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellAcetone", 3),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellEthanol", 1),
+ CI.emptyCells(38)
+ },
+ new FluidStack[] {
+
+ },
+ 900 * 20,
+ 32,
+ 2);
+
+
+ }
+
+ private static void recipePropionicAcid() {
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 1)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mEthylene, 500),
+ FluidUtils.getFluidStack(BioRecipes.mCarbonMonoxide, 500),
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 2000),
+ },
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 1)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mPropionicAcid, 250),
+ },
+ 20 * 20,
+ 60,
+ 1);
+ }
+
+ private static void recipeEthanol() {
+
+ CORE.RA.addDistilleryRecipe(
+ BioRecipes.getBioChip(2),
+ FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 1000),
+ FluidUtils.getFluidStack(BioRecipes.mEthanol, 100),
+ null,
+ 20 * 20,
+ 60,
+ false);
+
+ }
+
+ private static void recipeGoldenBrownCelluloseFiber() {
+ CORE.RA.addFluidExtractionRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 20),
+ FluidUtils.getFluidStack(BioRecipes.mAmmonia, 50),
+ 20 * 30,
+ 120);
+ }
+
+ private static void recipeRedCelluloseFiber() {
+ CORE.RA.addExtractorRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 20),
+ ItemUtils.getSimpleStack(ModItems.dustCalciumCarbonate, 5),
+ 20 * 30,
+ 240);
+ }
+
+ private static void recipeSodiumHydroxide() {
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(4)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mSalineWater, 1000),
+ },
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumHydroxide, 1)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mChlorine, 400),
+ FluidUtils.getFluidStack(BioRecipes.mHydrogen, 600),
+ },
+ 300 * 20,
+ 120,
+ 1);
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(5),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSodium", 5)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 5000),
+ },
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumHydroxide, 5)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mHydrogen, 5000),
+ },
+ 60 * 20,
+ 60,
+ 1);
+ }
+
+ private static void recipeSodiumCarbonate() {
+
+ if (OreDictUtils.containsValidEntries("fuelCoke")) {
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(18),
+ ItemUtils.getItemStackOfAmountFromOreDict("fuelCoke", 3),
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 3),
+ ItemUtils.getSimpleStack(AgriculturalChem.mAluminiumPellet, 6)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000),
+ },
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumAluminate, 18)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mHydrogen, 200),
+ FluidUtils.getFluidStack(BioRecipes.mCarbonDioxide, 1600),
+ },
+ 120 * 20,
+ 120,
+ 1);
+
+ }
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(18),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCoal", 6),
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 4),
+ ItemUtils.getSimpleStack(AgriculturalChem.mAluminiumPellet, 6)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000),
+ },
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumAluminate, 16)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mHydrogen, 100),
+ FluidUtils.getFluidStack(BioRecipes.mCarbonDioxide, 1750),
+ },
+ 180 * 20,
+ 120,
+ 1);
+
+ }
+
+ private static void recipePelletMold() {
+ GregtechItemList.Pellet_Mold.set(ItemUtils.getSimpleStack(AgriculturalChem.mPelletMold, 1));
+ GT_Values.RA.addLatheRecipe(
+ ALLOY.TUMBAGA.getBlock(1),
+ GregtechItemList.Pellet_Mold.get(1),
+ null,
+ 20 * 30 * 15,
+ 90);
+ }
+
+ private static void recipeAluminiumPellet() {
+
+ // Ore Names, no prefix
+ AutoMap<String> aOreNames = new AutoMap<String>();
+
+ aOreNames.put("Lazurite");
+ aOreNames.put("Bauxite");
+ aOreNames.put("Grossular");
+ aOreNames.put("Pyrope");
+ aOreNames.put("Sodalite");
+ aOreNames.put("Spodumene");
+ aOreNames.put("Ruby");
+ aOreNames.put("Sapphire");
+ aOreNames.put("GreenSapphire");
+
+ // Voltage
+ HashMap<String, Integer> aOreData1 = new HashMap<String, Integer>();
+ // Input Count
+ HashMap<String, Integer> aOreData2 = new HashMap<String, Integer>();
+ // Output Count
+ HashMap<String, Integer> aOreData3 = new HashMap<String, Integer>();
+
+ aOreData1.put("Lazurite", 120);
+ aOreData1.put("Bauxite", 90);
+ aOreData1.put("Grossular", 90);
+ aOreData1.put("Pyrope", 90);
+ aOreData1.put("Sodalite", 90);
+ aOreData1.put("Spodumene", 90);
+ aOreData1.put("Ruby", 60);
+ aOreData1.put("Sapphire", 30);
+ aOreData1.put("GreenSapphire", 30);
+ aOreData2.put("Lazurite", 14);
+ aOreData2.put("Bauxite", 39);
+ aOreData2.put("Grossular", 20);
+ aOreData2.put("Pyrope", 20);
+ aOreData2.put("Sodalite", 11);
+ aOreData2.put("Spodumene", 10);
+ aOreData2.put("Ruby", 6);
+ aOreData2.put("Sapphire", 5);
+ aOreData2.put("GreenSapphire", 5);
+ aOreData3.put("Lazurite", 3);
+ aOreData3.put("Bauxite", 16);
+ aOreData3.put("Grossular", 2);
+ aOreData3.put("Pyrope", 2);
+ aOreData3.put("Sodalite", 3);
+ aOreData3.put("Spodumene", 1);
+ aOreData3.put("Ruby", 2);
+ aOreData3.put("Sapphire", 2);
+ aOreData3.put("GreenSapphire", 2);
+
+ // Assemble all valid crushed ore types for making pellet mix
+ HashMap<String, ItemStack> aOreCache = new HashMap<String, ItemStack>();
+ for (String aOreName : aOreNames) {
+ String aTemp = aOreName;
+ aOreName = "crushedPurified" + aOreName;
+ if (ItemUtils.doesOreDictHaveEntryFor(aOreName)) {
+ aOreCache.put(aTemp, ItemUtils.getItemStackOfAmountFromOreDict(aOreName, 1));
+ }
+ }
+
+ for (String aOreName : aOreNames) {
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ CI.getNumberedBioCircuit(14),
+ ItemUtils.getSimpleStack(aOreCache.get(aOreName), aOreData2.get(aOreName))
+ },
+ new FluidStack[] {
+ FluidUtils.getSteam(2000 * aOreData2.get(aOreName))
+ },
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mCleanAluminiumMix, (int) (Math.ceil(aOreData3.get(aOreName) * 1.4)))
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(AgriculturalChem.RedMud, 100 * (int) (Math.ceil(aOreData3.get(aOreName) * 1.4)))
+ },
+ 20 * 60,
+ aOreData1.get(aOreName),
+ aOreName.equals("Bauxite") ? 2 : 1);
+ }
+
+ GT_Values.RA.addExtruderRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mCleanAluminiumMix, 3),
+ ItemUtils.getSimpleStack(AgriculturalChem.mPelletMold, 0),
+ ItemUtils.getSimpleStack(AgriculturalChem.mAluminiumPellet, 4),
+ 20 * 30,
+ 64);
+
+
+ }
+
+ private static void recipeAlumina() {
+ GT_Values.RA.addBlastRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumAluminate, 24),
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumHydroxide, 3),
+ FluidUtils.getFluidStack(mCarbonDioxide, 6000),
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mAlumina, 24),
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 2),
+ 20 * 120,
+ 120,
+ 1200);
+ }
+
+ private static void recipeAluminium() {
+ GT_Values.RA.addBlastRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mAlumina, 24),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCarbon", 4),
+ GT_Values.NF,
+ GT_Values.NF,
+ ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 24),
+ null,
+ 20 * 120,
+ 120,
+ 1600);
+ }
+
+ private static void recipeCalciumCarbonate() {
+
+ }
+
+ private static void recipeLithiumChloride() {
+
+ if (OreDictUtils.containsValidEntries("dustRockSalt")) {
+ GT_Values.RA.addElectrolyzerRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustRockSalt", 8),
+ ItemUtils.getSimpleStack(AgriculturalChem.mLithiumChloride, 10),
+ FluidUtils.getFluidStack(BioRecipes.mAir, 4000),
+ FluidUtils.getFluidStack(BioRecipes.mChlorine, 500),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithium", 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallLithium", 3),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallLithium", 3),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyLithium", 5),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustPotassium", 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallPotassium", 5),
+ new int[] {7500, 8000, 8500, 9000, 7500, 8500},
+ 60 * 30,
+ 60);
+ }
+ if (OreDictUtils.containsValidEntries("dustPotash")) {
+ GT_Values.RA.addElectrolyzerRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustPotash", 10),
+ ItemUtils.getSimpleStack(AgriculturalChem.mLithiumChloride, 16),
+ FluidUtils.getFluidStack(BioRecipes.mThermalWater, 2000),
+ FluidUtils.getFluidStack(BioRecipes.mChlorine, 250),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithium", 3),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallLithium", 5),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallLithium", 5),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyLithium", 7),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustAsh", 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustAsh", 2),
+ new int[] {7500, 8000, 8500, 9000, 9000, 9000},
+ 45 * 30,
+ 90);
+ }
+
+ }
+
+ private static void recipeAlginicAcid() {
+
+ /*// Turn into Cellulose Pulp
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ getBioChip(7),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 20),
+ ItemUtils.getSimpleStack(AgriculturalChem.mAlginicAcid, 5)
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 20),
+ 90 * 20,
+ 16);*/
+ }
+
+ private static void recipeSulfuricAcid() {
+
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(7),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 10),
+ ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 30)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 2000),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mSulfuricAcid, 50),
+ },
+ 60 * 20,
+ 60,
+ 1);
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(7),
+ ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 5),
+ ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 30)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 2000),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mSulfuricAcid, 250),
+ },
+ 60 * 20,
+ 120,
+ 2);
+
+ }
+
+ private static void recipeUrea() {
+
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(9),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mAmmonia, 600),
+ FluidUtils.getFluidStack(BioRecipes.mCarbonDioxide, 400),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mUrea, 400),
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 600),
+ },
+ 120 * 20,
+ 30,
+ 1);
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(9),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mUrea, 200),
+ FluidUtils.getFluidStack(BioRecipes.mFormaldehyde, 200),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mLiquidResin, 200)
+ },
+ 120 * 20,
+ 30,
+ 1);
+ }
+
+ private static void recipeRawBioResin() {
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(3),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 10),
+ ItemUtils.getSimpleStack(Blocks.dirt, 20)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000),
+ },
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mRawBioResin, 1),
+ },
+ new FluidStack[] {
+
+ },
+ 60 * 20,
+ 30,
+ 1);
+ }
+
+ private static void recipeLiquidResin() {
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(3),
+ ItemUtils.getSimpleStack(AgriculturalChem.mRawBioResin, 1)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mEthanol, 200),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mLiquidResin, 50),
+ },
+ 60 * 20,
+ 30,
+ 1);
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(3),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 8)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mLiquidResin, 144),
+ },
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(Ic2Items.resin, 1)
+ },
+ new FluidStack[] {
+
+ },
+ 120 * 20,
+ 30,
+ 1);
+
+
+ }
+
+ private static void recipeCompost() {
+ ItemStack aFert;
+ if (LoadedMods.Forestry) {
+ aFert = ItemUtils.getSimpleStack(AgriculturalChem.aFertForestry, 2);
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(11),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 16),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 8)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mUrea, 500),
+ },
+ new ItemStack[] {
+ aFert
+ },
+ new FluidStack[] {
+
+ },
+ 120 * 20,
+ 60,
+ 2);
+ }
+
+ aFert = ItemUtils.getSimpleStack(AgriculturalChem.aFertIC2, 2);
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(12),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 16),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 8)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mUrea, 500),
+ },
+ new ItemStack[] {
+ aFert
+ },
+ new FluidStack[] {
+
+ },
+ 120 * 20,
+ 60,
+ 2);
+
+ }
+
+ private static void recipeMethane() {
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(12),
+ ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, 20)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 500),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mMethane, 20),
+ },
+ 20 * 20,
+ 8,
+ 1);
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(13),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 64),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 48),
+ ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 32)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mMethane, 2000),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mEthylene, 1250),
+ },
+ 60 * 20,
+ 60,
+ 2);
+ }
+
+ private static void recipeBenzene() {
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(19),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 1),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mMethane, 1000),
+ },
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 1),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mBenzene, 500),
+ },
+ 8 * 20,
+ 120,
+ 2);
+ }
+
+ private static void recipeStyrene() {
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(20),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 1),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mEthylbenzene, 100),
+ },
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 1),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mStyrene, 25),
+ },
+ 16 * 20,
+ 480,
+ 3);
+ }
+
+ private static void recipeBioChip() {
+
+ GT_ModHandler.addShapelessCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 0L), 0, new Object[]{OrePrefixes.circuit.get(Materials.Primitive)});
+
+ long bits = 0;
+
+
+
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 1L, new Object[0]), bits,
+ new Object[]{"d ", " P ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 2L, new Object[0]), bits,
+ new Object[]{" d ", " P ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 3L, new Object[0]), bits,
+ new Object[]{" d", " P ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 4L, new Object[0]), bits,
+ new Object[]{" ", " Pd", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 5L, new Object[0]), bits,
+ new Object[]{" ", " P ", " d", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 6L, new Object[0]), bits,
+ new Object[]{" ", " P ", " d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 7L, new Object[0]), bits,
+ new Object[]{" ", " P ", "d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 8L, new Object[0]), bits,
+ new Object[]{" ", "dP ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 9L, new Object[0]), bits,
+ new Object[]{"P d", " ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 10L, new Object[0]), bits,
+ new Object[]{"P ", " d", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 11L, new Object[0]), bits,
+ new Object[]{"P ", " ", " d", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 12L, new Object[0]), bits,
+ new Object[]{"P ", " ", " d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 13L, new Object[0]), bits,
+ new Object[]{" P", " ", " d", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 14L, new Object[0]), bits,
+ new Object[]{" P", " ", " d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 15L, new Object[0]), bits,
+ new Object[]{" P", " ", "d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 16L, new Object[0]), bits,
+ new Object[]{" P", "d ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 17L, new Object[0]), bits,
+ new Object[]{" ", " ", "d P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 18L, new Object[0]), bits,
+ new Object[]{" ", "d ", " P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 19L, new Object[0]), bits,
+ new Object[]{"d ", " ", " P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 20L, new Object[0]), bits,
+ new Object[]{" d ", " ", " P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 21L, new Object[0]), bits,
+ new Object[]{"d ", " ", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 22L, new Object[0]), bits,
+ new Object[]{" d ", " ", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 23L, new Object[0]), bits,
+ new Object[]{" d", " ", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 24L, new Object[0]), bits,
+ new Object[]{" ", " d", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
+ }
+
+ public static boolean addCraftingRecipe(ItemStack aResult, long aBitMask, Object[] aRecipe) {
+ Method mAddRecipe = ReflectionUtils.getMethod(GT_ModHandler.class, "addCraftingRecipe", new Class[] {
+ ItemStack.class, Enchantment[].class, int[].class,
+ boolean.class, boolean.class, boolean.class, boolean.class,
+ boolean.class, boolean.class, boolean.class, boolean.class,
+ boolean.class, boolean.class, boolean.class, boolean.class,
+ boolean.class, Object[].class});
+ boolean didInvoke = false;
+ if (mAddRecipe != null) {
+ try {
+ didInvoke = (boolean) mAddRecipe.invoke(null, aResult,
+ new Enchantment[] {},
+ new int[] {},
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ aRecipe);
+ }
+ catch (IllegalAccessException | IllegalArgumentException
+ | InvocationTargetException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ return didInvoke;
+
+
+ }
+
+
+}
diff --git a/src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java b/src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java
index fd346590d4..4cf31e9335 100644
--- a/src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java
+++ b/src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java
@@ -1,12 +1,24 @@
package gtPlusPlus.plugin.agrichem;
+import java.util.List;
+
import gtPlusPlus.api.interfaces.IPlugin;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.plugin.agrichem.block.AgrichemFluids;
import gtPlusPlus.plugin.agrichem.fluids.FluidLoader;
+import gtPlusPlus.plugin.agrichem.item.algae.ItemAgrichemBase;
+import gtPlusPlus.plugin.agrichem.item.algae.ItemAlgaeBase;
+import gtPlusPlus.plugin.agrichem.item.algae.ItemBioChip;
import gtPlusPlus.plugin.manager.Core_Manager;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.oredict.OreDictionary;
public class Core_Agrichem implements IPlugin {
final static Core_Agrichem mInstance;
+
static {
mInstance = new Core_Agrichem();
@@ -15,18 +27,23 @@ public class Core_Agrichem implements IPlugin {
}
@Override
- public boolean preInit() {
+ public boolean preInit() {
+ mInstance.log("Generating Fluids");
FluidLoader.generate();
+ AgrichemFluids.init();
+ mInstance.log("Generating Items");
return true;
}
@Override
public boolean init() {
+ mInstance.log("Setting Items");
return true;
}
@Override
public boolean postInit() {
+ mInstance.log("Generating Recipes");
return true;
}
diff --git a/src/Java/gtPlusPlus/plugin/agrichem/IAlgalItem.java b/src/Java/gtPlusPlus/plugin/agrichem/IAlgalItem.java
new file mode 100644
index 0000000000..fada07d062
--- /dev/null
+++ b/src/Java/gtPlusPlus/plugin/agrichem/IAlgalItem.java
@@ -0,0 +1,12 @@
+package gtPlusPlus.plugin.agrichem;
+
+import gtPlusPlus.plugin.agrichem.logic.AlgaeGeneticData;
+import net.minecraft.item.ItemStack;
+
+public interface IAlgalItem {
+
+ public abstract AlgaeDefinition getAlgaeType(ItemStack aStack);
+
+ public abstract AlgaeGeneticData getSpeciesData(ItemStack aStack);
+
+}
diff --git a/src/Java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java b/src/Java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java
new file mode 100644
index 0000000000..039dd702da
--- /dev/null
+++ b/src/Java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java
@@ -0,0 +1,88 @@
+package gtPlusPlus.plugin.agrichem.block;
+
+import gtPlusPlus.core.util.minecraft.FluidUtils;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidRegistry;
+
+public class AgrichemFluids {
+
+ /*
+ * Saline Water - saltwater
+ * Sulfuric Waste Water - sulfuricapatite
+ * Methanol - methanol
+ * Hot Water - ic2hotwater
+ * Acetic Acid
+ * Propionic Acid
+ * Fermentation Base
+ * Ethylene - ethylene
+ * Ethanol - bioethanol
+ * Diluted SA - filutedsulfuricacid
+ * Sulfuric Acid - sulfuricacid
+ * Urea
+ * Formaldehyde - fluid.formaldehyde
+ * Liquid Resin
+ * Methane - methane
+ * Benzene - benzene
+ * Ethylbenzene - fluid.ethylbenzene
+ * Styrene - styrene
+ */
+
+ public static Fluid mAceticAcid;
+ public static Fluid mPropionicAcid;
+ public static Fluid mFermentationBase;
+ public static Fluid mUrea;
+ public static Fluid mLiquidResin;
+ public static Fluid mAcetone;
+ public static Fluid mButanol;
+
+
+
+ public static void init() {
+ if (!FluidRegistry.isFluidRegistered("aceticacid")) {
+ mAceticAcid = FluidUtils.generateFluidNoPrefix("aceticacid", "Acetic Acid", 200, new short[] { 97, 168, 96, 100 }, true);
+ }
+ else {
+ mAceticAcid = FluidRegistry.getFluid("aceticacid");
+ }
+ if (!FluidRegistry.isFluidRegistered("propionicacid")) {
+ mPropionicAcid = FluidUtils.generateFluidNoPrefix("propionicacid", "Propionic Acid", 200, new short[] { 198, 209, 148, 100 }, true);
+ }
+ else {
+ mPropionicAcid = FluidRegistry.getFluid("propionicacid");
+ }
+ if (!FluidRegistry.isFluidRegistered("fermentation.base")) {
+ mFermentationBase = FluidUtils.generateFluidNoPrefix("fermentation.base", "Fermentation Base", 200, new short[] { 107, 100, 63, 100 }, true);
+ }
+ else {
+ mFermentationBase = FluidRegistry.getFluid("fermentation.base");
+ }
+ if (!FluidRegistry.isFluidRegistered("ureamix")) {
+ mUrea = FluidUtils.generateFluidNoPrefix("ureamix", "Urea Mix", 200, new short[] { 71, 55, 12, 100 }, true);
+ }
+ else {
+ mUrea = FluidRegistry.getFluid("ureamix");
+ }
+ if (!FluidRegistry.isFluidRegistered("liquidresin")) {
+ mLiquidResin = FluidUtils.generateFluidNoPrefix("liquidresin", "Liquid Resin", 200, new short[] { 59, 58, 56, 100 }, true);
+ }
+ else {
+ mLiquidResin = FluidRegistry.getFluid("liquidresin");
+ }
+
+ if (!FluidRegistry.isFluidRegistered("acetone")) {
+ mAcetone = FluidUtils.generateFluidNoPrefix("acetone", "Acetone", 200, new short[] { 59, 58, 56, 100 }, true);
+ }
+ else {
+ mAcetone = FluidRegistry.getFluid("acetone");
+ }
+ if (!FluidRegistry.isFluidRegistered("butanol")) {
+ mButanol = FluidUtils.generateFluidNoPrefix("butanol", "Butanol", 200, new short[] { 159, 58, 56, 100 }, true);
+ }
+ else {
+ mButanol = FluidRegistry.getFluid("butanol");
+ }
+ }
+
+
+
+}
diff --git a/src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemAgrichemBase.java b/src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemAgrichemBase.java
new file mode 100644
index 0000000000..201da99488
--- /dev/null
+++ b/src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemAgrichemBase.java
@@ -0,0 +1,247 @@
+package gtPlusPlus.plugin.agrichem.item.algae;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.List;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.minecraft.OreDictUtils;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.client.renderer.texture.TextureAtlasSprite;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.World;
+import net.minecraftforge.oredict.OreDictionary;
+
+public class ItemAgrichemBase extends Item {
+
+ final protected IIcon base[];
+
+ /*
+ * 0 - Algae Biomass
+ * 1 - Green Algae Biomass
+ * 2 - Brown Algae Biomass
+ * 3 - Golden-Brown Algae Biomass
+ * 4 - Red Algae Biomass
+ * 5 - Cellulose Fiber
+ * 6 - Golden-Brown Cellulose Fiber
+ * 7 - Red Cellulose Fiber
+ * 8 - Compost
+ * 9 - Wood Pellet
+ * 10 - Wood Brick
+ * 11 - Cellulose Pulp
+ * 12 - Raw Bio Resin
+ * 13 - Catalyst Carrier
+ * 14 - Green Metal Catalyst
+ * 15 - Alginic Acid
+ * 16 - Alumina
+ * 17 - Aluminium Pellet
+ * 18 - Sodium Aluminate
+ * 19 - Sodium Hydroxide // Exists in Newer GT
+ * 20 - Sodium Carbonate
+ * 21 - Lithium Chloride
+ * 22 - Pellet Mold
+ * 23 - Clean Aluminium Mix
+ */
+
+ public ItemAgrichemBase() {
+ this.setHasSubtypes(true);
+ this.setNoRepair();
+ this.setMaxStackSize(64);
+ this.setMaxDamage(0);
+ base = new IIcon[24];
+ this.setUnlocalizedName("BasicAgrichemItem");
+ GameRegistry.registerItem(this, this.getUnlocalizedName());
+ }
+
+ @Override
+ public boolean isDamageable() {
+ return false;
+ }
+
+ @Override
+ public boolean shouldRotateAroundWhenRendering() {
+ return super.shouldRotateAroundWhenRendering();
+ }
+
+ @Override
+ public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
+ super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack aStack) {
+ return super.getItemStackDisplayName(aStack);
+ }
+
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) {
+ try {
+
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ }
+ super.addInformation(aStack, p_77624_2_, aList, p_77624_4_);
+ }
+
+ @Override
+ public EnumRarity getRarity(ItemStack p_77613_1_) {
+ return EnumRarity.common;
+ }
+
+ @Override
+ public boolean requiresMultipleRenderPasses() {
+ return false;
+ }
+
+ private static boolean mHasCheckedForSodiumHydroxide = false;
+ private static boolean mShowSodiumHydroxide = true;
+
+ private static boolean checkSodiumHydroxide() {
+ if (mHasCheckedForSodiumHydroxide) {
+ return mShowSodiumHydroxide;
+ }
+ else {
+ if (OreDictUtils.containsValidEntries("dustSodiumHydroxide_GT5U")
+ || OreDictUtils.containsValidEntries("dustSodiumHydroxide")) {
+ List<ItemStack> aTest = OreDictionary.getOres(
+ "dustSodiumHydroxide", false
+ );
+ if (aTest.isEmpty()) {
+ aTest = OreDictionary.getOres(
+ "dustSodiumHydroxide_GT5U", false
+ );
+ if (!aTest.isEmpty()) {
+ mShowSodiumHydroxide = false;
+ }
+ }
+ else {
+ mShowSodiumHydroxide = false;
+ }
+ }
+ }
+ mHasCheckedForSodiumHydroxide = true;
+ return mShowSodiumHydroxide;
+ }
+
+ @Override
+ public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) {
+ for (int i=0;i<base.length;i++) {
+ if (i == 19) {
+ // Only show if it doesn't exist.
+ if (checkSodiumHydroxide()) {
+ aList.add(ItemUtils.simpleMetaStack(aItem, i, 1));
+ }
+ }
+ else {
+ aList.add(ItemUtils.simpleMetaStack(aItem, i, 1));
+ }
+ }
+ }
+
+ @Override
+ public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
+ return false;
+ }
+
+ @Override
+ public boolean isRepairable() {
+ return false;
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
+ return false;
+ }
+
+ @Override
+ public int getDisplayDamage(ItemStack stack) {
+ return stack.getItemDamage();
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public int getItemEnchantability(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public void registerIcons(final IIconRegister u) {
+ for (int i=0;i<this.base.length;i++) {
+ String aPath = CORE.MODID + ":" + "bioscience/MetaItem1/"+i;
+ this.base[i] = u.registerIcon(aPath);
+ }
+ }
+
+
+ private boolean isTextureValid(String aPath) {
+ if (aPath == null) {
+ return false;
+ }
+ else if (aPath.indexOf(92) == -1) {
+ Constructor aTextureAtlasSprite = ReflectionUtils.getConstructor(
+ TextureAtlasSprite.class, String.class
+ );
+ if (aTextureAtlasSprite != null) {
+ try {
+ TextureAtlasSprite aTestAtlas = (TextureAtlasSprite) aTextureAtlasSprite.newInstance(
+ aPath
+ );
+ if (aTestAtlas != null) {
+ return true;
+ }
+ }
+ catch (InstantiationException | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException e) {
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
+ return this.base[damage];
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int damage) {
+ return this.base[damage];
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
+ return this.base[stack.getItemDamage()];
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack stack, int pass) {
+ return this.base[stack.getItemDamage()];
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack stack) {
+ return super.getUnlocalizedName() + "." + stack.getItemDamage();
+ }
+
+
+}
diff --git a/src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java b/src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java
new file mode 100644
index 0000000000..6b31a42809
--- /dev/null
+++ b/src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java
@@ -0,0 +1,235 @@
+package gtPlusPlus.plugin.agrichem.item.algae;
+
+import java.util.List;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.plugin.agrichem.AlgaeDefinition;
+import gtPlusPlus.plugin.agrichem.IAlgalItem;
+import gtPlusPlus.plugin.agrichem.logic.AlgaeGeneticData;
+import gtPlusPlus.plugin.agrichem.logic.AlgaeGrowthRequirement;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.World;
+
+public class ItemAlgaeBase extends Item implements IAlgalItem {
+
+ protected IIcon base;
+ protected IIcon overlay;
+
+ public ItemAlgaeBase() {
+ this.setHasSubtypes(true);
+ this.setMaxDamage(127);
+ this.setNoRepair();
+ this.setMaxStackSize(32);
+ this.setUnlocalizedName("BasicAlgaeItem");
+ GameRegistry.registerItem(this, this.getUnlocalizedName());
+ }
+
+ @Override
+ public boolean isDamageable() {
+ return false;
+ }
+
+ @Override
+ public boolean shouldRotateAroundWhenRendering() {
+ return super.shouldRotateAroundWhenRendering();
+ }
+
+ @Override
+ public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
+ if (!p_77663_1_.hasTagCompound() || p_77663_1_.getTagCompound().hasNoTags()) {
+ p_77663_1_ = initNBT(p_77663_1_);
+ }
+ super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack aStack) {
+ return EnumChatFormatting.UNDERLINE+super.getItemStackDisplayName(aStack);
+ }
+
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) {
+ int aDam = aStack.getItemDamage();
+ try {
+ aList.add(AlgaeDefinition.getByIndex(aDam).mSimpleName);
+ if (!aStack.hasTagCompound() || aStack.getTagCompound().hasNoTags()) {
+ aStack = initNBT(aStack);
+ }
+ else {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ boolean mRequiresLight = aNBT.getBoolean("mRequiresLight");
+ boolean mSaltWater = aNBT.getBoolean("mSaltWater");
+ boolean mFreshWater = aNBT.getBoolean("mFreshWater");
+ byte mTempTolerance = aNBT.getByte("mTempTolerance");
+ float mFertility = aNBT.getFloat("mFertility");
+ float mProductionSpeed = aNBT.getFloat("mProductionSpeed");
+ byte mLifespan = aNBT.getByte("mLifespan");
+ int mGeneration = aNBT.getInteger("mGeneration");
+
+ aList.add("Requires Light: "+mRequiresLight);
+ aList.add("Salt Water: "+mSaltWater);
+ aList.add("Fresh Water: "+mFreshWater);
+ aList.add("Temp Tolerance: "+mTempTolerance);
+ aList.add("Growth: "+mFertility);
+ aList.add("Production: "+mProductionSpeed);
+ aList.add("Lifespan in days: "+mLifespan);
+ aList.add("Generation: "+mGeneration);
+ }
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ }
+ super.addInformation(aStack, p_77624_2_, aList, p_77624_4_);
+ }
+
+ @Override
+ public EnumRarity getRarity(ItemStack p_77613_1_) {
+ return EnumRarity.uncommon;
+ }
+
+ @Override
+ public boolean requiresMultipleRenderPasses() {
+ return true;
+ }
+
+ @Override
+ public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) {
+ for (int i=0;i<AlgaeDefinition.values().length;i++) {
+ aList.add(ItemUtils.simpleMetaStack(aItem, i, 1));
+ }
+ }
+
+ @Override
+ public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
+ return false;
+ }
+
+ @Override
+ public boolean isRepairable() {
+ return false;
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
+ return false;
+ }
+
+ @Override
+ public int getDisplayDamage(ItemStack stack) {
+ return stack.getItemDamage();
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public int getItemEnchantability(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack aStack, int aMeta) {
+ return AlgaeDefinition.getByIndex(aStack.getItemDamage()).mColour;
+ }
+
+ @Override
+ public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
+ if(pass == 0) {
+ return this.base;
+ }
+ return this.overlay;
+ }
+
+ @Override
+ public void registerIcons(final IIconRegister i) {
+ this.base = i.registerIcon(CORE.MODID + ":" + "bioscience/BasicAlgae");
+ this.overlay = i.registerIcon(CORE.MODID + ":" + "bioscience/BasicAlgae" + "_Overlay");
+ }
+
+ public static ItemStack initNBT(ItemStack aFreshAlgae) {
+ NBTTagCompound aNewTag = new NBTTagCompound();
+ ItemAlgaeBase aItem;
+ if (aFreshAlgae.getItem() instanceof ItemAlgaeBase) {
+ aItem = (ItemAlgaeBase) aFreshAlgae.getItem();
+ if (!aFreshAlgae.hasTagCompound()) {
+ AlgaeGeneticData y = aItem.getSpeciesData(aFreshAlgae);
+ aNewTag = y.writeToNBT();
+ aFreshAlgae.setTagCompound(aNewTag);
+ }
+ else {
+ aNewTag = aFreshAlgae.getTagCompound();
+ }
+ }
+ return aFreshAlgae;
+ }
+
+ @Override
+ public AlgaeDefinition getAlgaeType(ItemStack aStack) {
+ return AlgaeDefinition.getByIndex(aStack != null ? aStack.getItemDamage() : 3);
+ }
+
+ @Override
+ public AlgaeGeneticData getSpeciesData(ItemStack aStack) {
+ NBTTagCompound aTag;
+ if (!aStack.hasTagCompound() || aStack.getTagCompound().hasNoTags()) {
+ aTag = new NBTTagCompound();
+ AlgaeGeneticData aGenes;
+ if (aStack.getItemDamage() < 3 || aStack.getItemDamage() > 5) {
+ aGenes = new AlgaeGeneticData();
+ aTag = aGenes.writeToNBT();
+ }
+ else {
+ byte aTemp, aLifespan;
+ float aFert, aSpeed;
+
+ int aDam = aStack.getItemDamage();
+ aTemp = (byte) (aDam == 3 ? 0 : aDam == 4 ? 2 : 1);
+ aLifespan = (byte) (aDam == 3 ? 1 : aDam == 4 ? 3f : 2f);
+ aFert = (float) (aDam == 3 ? 2f : aDam == 4 ? 1f : 1.75f);
+ aSpeed = (float) (aDam == 3 ? 1f : aDam == 4 ? 1.5f : 2f);
+
+ aGenes = new AlgaeGeneticData(
+ true, true,
+ AlgaeDefinition.getByIndex(aDam).mSaltWater, AlgaeDefinition.getByIndex(aDam).mFreshWater,
+ aTemp,
+ aFert,
+ aSpeed,
+ aLifespan,
+ 0,
+ new AutoMap<AlgaeGrowthRequirement>());
+ aTag = aGenes.writeToNBT();
+ }
+ }
+ else {
+ aTag = aStack.getTagCompound();
+ }
+
+
+
+
+ return new AlgaeGeneticData(aTag);
+ }
+
+
+
+
+}
diff --git a/src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemBioChip.java b/src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemBioChip.java
new file mode 100644
index 0000000000..5ecfbbabe9
--- /dev/null
+++ b/src/Java/gtPlusPlus/plugin/agrichem/item/algae/ItemBioChip.java
@@ -0,0 +1,138 @@
+package gtPlusPlus.plugin.agrichem.item.algae;
+
+import java.util.List;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.World;
+
+public class ItemBioChip extends Item {
+
+ protected IIcon base;
+
+ public ItemBioChip() {
+ this.setHasSubtypes(true);
+ this.setNoRepair();
+ this.setMaxStackSize(64);
+ this.setMaxDamage(0);
+ this.setUnlocalizedName("BioRecipeSelector");
+ GameRegistry.registerItem(this, this.getUnlocalizedName());
+ }
+
+ @Override
+ public boolean isDamageable() {
+ return false;
+ }
+
+ @Override
+ public boolean shouldRotateAroundWhenRendering() {
+ return super.shouldRotateAroundWhenRendering();
+ }
+
+ @Override
+ public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
+ super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack aStack) {
+ return super.getItemStackDisplayName(aStack);
+ }
+
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) {
+ try {
+ aList.add("Configuration == "+aStack.getItemDamage());
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ }
+ super.addInformation(aStack, p_77624_2_, aList, p_77624_4_);
+ }
+
+ @Override
+ public EnumRarity getRarity(ItemStack p_77613_1_) {
+ return EnumRarity.common;
+ }
+
+ @Override
+ public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) {
+ aList.add(ItemUtils.simpleMetaStack(aItem, 0, 1));
+ }
+
+ @Override
+ public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
+ return false;
+ }
+
+ @Override
+ public boolean isRepairable() {
+ return false;
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
+ return false;
+ }
+
+ @Override
+ public int getDisplayDamage(ItemStack stack) {
+ return stack.getItemDamage();
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public int getItemEnchantability(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public void registerIcons(final IIconRegister u) {
+ this.base = u.registerIcon(CORE.MODID + ":" + "bioscience/BioCircuit");
+ }
+
+ @Override
+ public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
+ return this.base;
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int damage) {
+ return this.base;
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
+ return this.base;
+ }
+
+ @Override
+ public IIcon getIcon(ItemStack stack, int pass) {
+ return this.base;
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack stack) {
+ return super.getUnlocalizedName();
+ }
+
+
+}
diff --git a/src/Java/gtPlusPlus/plugin/agrichem/logic/AlgaeGeneticData.java b/src/Java/gtPlusPlus/plugin/agrichem/logic/AlgaeGeneticData.java
new file mode 100644
index 0000000000..dfe0f50b47
--- /dev/null
+++ b/src/Java/gtPlusPlus/plugin/agrichem/logic/AlgaeGeneticData.java
@@ -0,0 +1,130 @@
+package gtPlusPlus.plugin.agrichem.logic;
+
+import gtPlusPlus.api.objects.data.AutoMap;
+import net.minecraft.nbt.NBTTagCompound;
+
+public class AlgaeGeneticData {
+
+ private final int mLifespan;
+
+ private final int mGeneration;
+
+ private final boolean mIsDominant;
+
+ private final boolean mRequiresLight;
+
+ private final boolean mSaltWater;
+
+ private final boolean mFreshWater;
+
+ private final byte mTempTolerance;
+
+ private final float mFertility;
+
+ private final float mProductionSpeed;
+
+ private final AutoMap<AlgaeGrowthRequirement> mSpecialRequirements;
+
+
+ public AlgaeGeneticData() {
+ this(true, true, true, true, (byte) 0, 1f, 1f, (byte) 30, 0, new AutoMap<AlgaeGrowthRequirement>());
+ }
+
+ public AlgaeGeneticData(boolean isDominant, boolean requiresLight, boolean isSalt, boolean isFresh,
+ byte aTempTolerance, float aFertility, float aSpeed, byte aLifespan, int aGeneration, AutoMap<AlgaeGrowthRequirement> aRequirements) {
+ mIsDominant = isDominant;
+ mRequiresLight = requiresLight;
+ mSaltWater = isSalt;
+ mFreshWater = isFresh;
+ mTempTolerance = aTempTolerance;
+ mFertility = aFertility;
+ mProductionSpeed = aSpeed;
+ mLifespan = aLifespan;
+ mGeneration = aGeneration;
+ mSpecialRequirements = aRequirements;
+ }
+
+
+ public AlgaeGeneticData(NBTTagCompound aNBT) {
+ if (aNBT == null || aNBT.hasNoTags()) {
+ mIsDominant = true;
+ mRequiresLight = true;
+ mSaltWater = true;
+ mFreshWater = true;
+ mTempTolerance = 0;
+ mFertility = 1;
+ mProductionSpeed = 1;
+ mLifespan = 30;
+ mGeneration = 0;
+ }
+ else {
+ mIsDominant = aNBT.getBoolean("mIsDominant");
+ mRequiresLight = aNBT.getBoolean("mRequiresLight");
+ mSaltWater = aNBT.getBoolean("mSaltWater");
+ mFreshWater = aNBT.getBoolean("mFreshWater");
+ mTempTolerance = aNBT.getByte("mTempTolerance");
+ mFertility = aNBT.getFloat("mFertility");
+ mProductionSpeed = aNBT.getFloat("mProductionSpeed");
+ mLifespan = aNBT.getByte("mLifespan");
+ mGeneration = aNBT.getInteger("mGeneration");
+ }
+ mSpecialRequirements = new AutoMap<AlgaeGrowthRequirement>();
+ }
+
+ /**
+ * In MC Days
+ */
+ public final int getLifespan() {
+ return this.mLifespan;
+ }
+
+ public final boolean isDominant() {
+ return this.mIsDominant;
+ }
+
+ public final boolean RequiresLight() {
+ return this.mRequiresLight;
+ }
+
+ public final boolean isSaltWater() {
+ return this.mSaltWater;
+ }
+
+ public final boolean isFreshWater() {
+ return this.mFreshWater;
+ }
+
+ public final byte getTempTolerance() {
+ return this.mTempTolerance;
+ }
+
+ public final float getFertility() {
+ return this.mFertility;
+ }
+
+ public final float getProductionSpeed() {
+ return this.mProductionSpeed;
+ }
+
+ public final int getGeneration() {
+ return this.mGeneration;
+ }
+
+ public final AutoMap<AlgaeGrowthRequirement> getSpecialRequirements() {
+ return this.mSpecialRequirements;
+ }
+
+ public NBTTagCompound writeToNBT() {
+ NBTTagCompound aGenes = new NBTTagCompound();
+ aGenes.setBoolean("mIsDominant", this.mIsDominant);
+ aGenes.setBoolean("mRequiresLight", this.mRequiresLight);
+ aGenes.setBoolean("mSaltWater", this.mSaltWater);
+ aGenes.setBoolean("mFreshWater", this.mFreshWater);
+ aGenes.setInteger("mLifespan", this.mLifespan);
+ aGenes.setInteger("mGeneration", this.mGeneration);
+ aGenes.setByte("mTempTolerance", this.mTempTolerance);
+ aGenes.setFloat("mFertility", this.mFertility);
+ aGenes.setFloat("mProductionSpeed", this.mProductionSpeed);
+ return aGenes;
+ }
+}
diff --git a/src/Java/gtPlusPlus/plugin/agrichem/logic/AlgaeGrowthRequirement.java b/src/Java/gtPlusPlus/plugin/agrichem/logic/AlgaeGrowthRequirement.java
new file mode 100644
index 0000000000..6bddc9d085
--- /dev/null
+++ b/src/Java/gtPlusPlus/plugin/agrichem/logic/AlgaeGrowthRequirement.java
@@ -0,0 +1,5 @@
+package gtPlusPlus.plugin.agrichem.logic;
+
+public class AlgaeGrowthRequirement {
+
+}
diff --git a/src/Java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java b/src/Java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java
index 5f3b1d8abd..f33cc71fc6 100644
--- a/src/Java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java
+++ b/src/Java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java
@@ -23,7 +23,7 @@ public class VanillaBedHeightFix implements IBugFix {
mParent = minstance;
if (DevHelper.isValidHelperObject()) {
Method m;
- if (DevHelper.IsObfuscatedEnvironment()) {
+ if (DevHelper.isObfuscatedEnvironment()) {
m = ReflectionUtils.getMethod(EntityPlayer.class, "func_71018_a", int.class, int.class, int.class);
}
else {
diff --git a/src/Java/gtPlusPlus/plugin/villagers/entity/EntityBaseVillager.java b/src/Java/gtPlusPlus/plugin/villagers/entity/EntityBaseVillager.java
index 4dc5a15b4b..c29aadb16b 100644
--- a/src/Java/gtPlusPlus/plugin/villagers/entity/EntityBaseVillager.java
+++ b/src/Java/gtPlusPlus/plugin/villagers/entity/EntityBaseVillager.java
@@ -70,7 +70,7 @@ public class EntityBaseVillager extends EntityVillager {
@Override
public void readEntityFromNBT(NBTTagCompound aNBT) {
if (aNBT.hasKey("aCustomName")) {
- if (this.getCustomNameTag() != aNBT.getString("aCustomName")) {
+ if (!this.getCustomNameTag().equals(aNBT.getString("aCustomName"))) {
this.setCustomNameTag(aNBT.getString("aCustomName"));
}
}
@@ -202,9 +202,10 @@ public class EntityBaseVillager extends EntityVillager {
protected MerchantRecipeList getBuyingList() {
Field v82191;
- MerchantRecipeList o;
+ MerchantRecipeList o = null;
v82191 = ReflectionUtils.getField(getClass(), "buyingList");
try {
+ if (v82191 != null)
o = (MerchantRecipeList) v82191.get(this);
Logger.WARNING("Is BuyingList Valid? " + (v82191 != null));
return v82191 != null ? o : null;
diff --git a/src/Java/gtPlusPlus/plugin/villagers/entity/EntityNativeAustralian.java b/src/Java/gtPlusPlus/plugin/villagers/entity/EntityNativeAustralian.java
index 967647cff6..4f9e2954a4 100644
--- a/src/Java/gtPlusPlus/plugin/villagers/entity/EntityNativeAustralian.java
+++ b/src/Java/gtPlusPlus/plugin/villagers/entity/EntityNativeAustralian.java
@@ -79,7 +79,7 @@ public class EntityNativeAustralian extends EntityVillager {
@Override
public void readEntityFromNBT(NBTTagCompound aNBT) {
if (aNBT.hasKey("aCustomName")) {
- if (this.getCustomNameTag() != aNBT.getString("aCustomName")) {
+ if (!this.getCustomNameTag().equals(aNBT.getString("aCustomName"))) {
this.setCustomNameTag(aNBT.getString("aCustomName"));
}
}
@@ -105,7 +105,7 @@ public class EntityNativeAustralian extends EntityVillager {
@Override
public void setProfession(int p_70938_1_) {
- super.setProfession(mRoleID);
+ super.setProfession(7738);
}
@Override
@@ -190,9 +190,10 @@ public class EntityNativeAustralian extends EntityVillager {
protected MerchantRecipeList getBuyingList() {
Field v82191;
- MerchantRecipeList o;
+ MerchantRecipeList o = null;
v82191 = ReflectionUtils.getField(getClass(), "buyingList");
try {
+ if (v82191 != null)
o = (MerchantRecipeList) v82191.get(this);
Logger.WARNING("Is BuyingList Valid? " + (v82191 != null));
return v82191 != null ? o : null;
diff --git a/src/Java/gtPlusPlus/preloader/DevHelper.java b/src/Java/gtPlusPlus/preloader/DevHelper.java
index d942de503a..81d36d591b 100644
--- a/src/Java/gtPlusPlus/preloader/DevHelper.java
+++ b/src/Java/gtPlusPlus/preloader/DevHelper.java
@@ -32,7 +32,7 @@ public class DevHelper {
- public static boolean IsObfuscatedEnvironment() {
+ public static boolean isObfuscatedEnvironment() {
// Are we in a 'decompiled' environment?
boolean deobfuscatedEnvironment = false;
byte[] bs;
diff --git a/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_CharcoalPit.java b/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_CharcoalPit.java
new file mode 100644
index 0000000000..9c79db265d
--- /dev/null
+++ b/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_CharcoalPit.java
@@ -0,0 +1,142 @@
+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 java.util.ArrayList;
+
+import org.apache.logging.log4j.Level;
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
+
+import cpw.mods.fml.relauncher.FMLRelaunchLog;
+import gregtech.api.enums.OrePrefixes;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.oredict.OreDictionary;
+
+public class ClassTransformer_GT_CharcoalPit {
+
+ private final boolean isValid;
+ private final ClassReader reader;
+ 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;
+ }
+ 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;
+ 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 {
+ isValid = false;
+ }
+ FMLRelaunchLog.log("[GT++ ASM] GT Charcoal Pit Fix", Level.INFO,
+ "Valid? " + isValid + ".");
+ reader = aTempReader;
+ writer = aTempWriter;
+ }
+
+ public boolean isValidTransformer() {
+ return isValid;
+ }
+
+ public ClassReader getReader() {
+ return reader;
+ }
+
+ public ClassWriter getWriter() {
+ return writer;
+ }
+
+ public boolean injectMethod(String aMethodName, boolean obfuscated, ClassWriter cw) {
+ 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")) {
+ 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.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_CharcoalPit", "isWoodLog", "(L"+aBlockClassName+";)Z", false);
+ mv.visitInsn(IRETURN);
+ Label l1 = new Label();
+ mv.visitLabel(l1);
+ mv.visitLocalVariable("this", "Lgregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit;", null, l0, l1, 0);
+ mv.visitLocalVariable("log", "L"+aBlockClassName+";", null, l0, l1, 1);
+ mv.visitMaxs(1, 2);
+ 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 AddFieldAdapter(ClassVisitor cv) {
+ super(ASM5, cv);
+ this.cv = cv;
+ }
+
+ private final String[] aMethodsToStrip = new String[] { "isWoodLog" };
+
+ @Override
+ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+ MethodVisitor methodVisitor;
+ boolean found = false;
+
+ for (String s : aMethodsToStrip) {
+ if (name.equals(s)) {
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
+ } else {
+ methodVisitor = null;
+ }
+ if (found) {
+ FMLRelaunchLog.log("[GT++ ASM] GT Charcoal Pit Fix", Level.INFO, "Found method " + name + ", removing.");
+ }
+ return methodVisitor;
+ }
+
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TC_ItemWispEssence.java b/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TC_ItemWispEssence.java
index 06759429b9..8f65709478 100644
--- a/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TC_ItemWispEssence.java
+++ b/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TC_ItemWispEssence.java
@@ -1,6 +1,36 @@
package gtPlusPlus.preloader.asm.transformers;
-import static org.objectweb.asm.Opcodes.*;
+import static org.objectweb.asm.Opcodes.AALOAD;
+import static org.objectweb.asm.Opcodes.ACC_PUBLIC;
+import static org.objectweb.asm.Opcodes.ACONST_NULL;
+import static org.objectweb.asm.Opcodes.ALOAD;
+import static org.objectweb.asm.Opcodes.ARETURN;
+import static org.objectweb.asm.Opcodes.ARRAYLENGTH;
+import static org.objectweb.asm.Opcodes.ASM5;
+import static org.objectweb.asm.Opcodes.ASTORE;
+import static org.objectweb.asm.Opcodes.DUP;
+import static org.objectweb.asm.Opcodes.F_APPEND;
+import static org.objectweb.asm.Opcodes.F_CHOP;
+import static org.objectweb.asm.Opcodes.F_SAME;
+import static org.objectweb.asm.Opcodes.F_SAME1;
+import static org.objectweb.asm.Opcodes.GETSTATIC;
+import static org.objectweb.asm.Opcodes.GOTO;
+import static org.objectweb.asm.Opcodes.I2L;
+import static org.objectweb.asm.Opcodes.ICONST_0;
+import static org.objectweb.asm.Opcodes.IFEQ;
+import static org.objectweb.asm.Opcodes.IFLE;
+import static org.objectweb.asm.Opcodes.IFNONNULL;
+import static org.objectweb.asm.Opcodes.IFNULL;
+import static org.objectweb.asm.Opcodes.ILOAD;
+import static org.objectweb.asm.Opcodes.INVOKESPECIAL;
+import static org.objectweb.asm.Opcodes.INVOKESTATIC;
+import static org.objectweb.asm.Opcodes.INVOKEVIRTUAL;
+import static org.objectweb.asm.Opcodes.IRETURN;
+import static org.objectweb.asm.Opcodes.ISTORE;
+import static org.objectweb.asm.Opcodes.L2I;
+import static org.objectweb.asm.Opcodes.LDIV;
+import static org.objectweb.asm.Opcodes.LREM;
+import static org.objectweb.asm.Opcodes.NEW;
import org.apache.logging.log4j.Level;
import org.objectweb.asm.AnnotationVisitor;
@@ -11,12 +41,7 @@ import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
import cpw.mods.fml.relauncher.FMLRelaunchLog;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.preloader.DevHelper;
-import net.minecraft.item.ItemStack;
-import thaumcraft.api.aspects.Aspect;
-import thaumcraft.api.aspects.AspectList;
public class ClassTransformer_TC_ItemWispEssence {
@@ -246,30 +271,6 @@ public class ClassTransformer_TC_ItemWispEssence {
}
}
- static Aspect[] displayAspects;
-
- @SideOnly(Side.CLIENT)
- public int getColorFromItemStack(ItemStack stack, int par2) {
- if (stack == null) {
- return 0;
- }
- if (this.getAspects(stack) != null) {
- return this.getAspects(stack).getAspects()[0].getColor();
- } else {
- int idx = (int) (System.currentTimeMillis() / 500L % (long) displayAspects.length);
- return displayAspects[idx].getColor();
- }
- }
-
- public AspectList getAspects(ItemStack itemstack) {
- if (itemstack.hasTagCompound()) {
- AspectList aspects = new AspectList();
- aspects.readFromNBT(itemstack.getTagCompound());
- return aspects.size() > 0 ? aspects : null;
- } else {
- return null;
- }
- }
diff --git a/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer2.java b/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer2.java
index 390289d162..507e2cf974 100644
--- a/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer2.java
+++ b/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_ClassTransformer2.java
@@ -329,8 +329,6 @@ public class Preloader_ClassTransformer2 {
Logger.REFLECTION("mItemStorageNBT: "+(mItemStorageNBT != null));
//mItemStorageNBT
-
- ItemStack rStack = new ItemStack(GregTech_API.sBlockMachines, 1, tID);
NBTTagCompound tNBT = new NBTTagCompound();
if (tRecipeStuff != null && !tRecipeStuff.hasNoTags()) tNBT.setTag("GT.CraftingComponents", tRecipeStuff);
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 0e06b360b1..c269e9463e 100644
--- a/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java
+++ b/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java
@@ -167,6 +167,12 @@ public class Preloader_Transformer_Handler implements IClassTransformer {
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")) {
+ FMLRelaunchLog.log("[GT++ ASM] GT Charcoal Pit Fix", Level.INFO, "Transforming %s", transformedName);
+ return new ClassTransformer_GT_CharcoalPit(basicClass, obfuscated).getWriter().toByteArray();
+ }
+
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 92e626cea0..f5e1d429f7 100644
--- a/src/Java/gtPlusPlus/xmod/bop/blocks/BOP_Block_Registrator.java
+++ b/src/Java/gtPlusPlus/xmod/bop/blocks/BOP_Block_Registrator.java
@@ -10,9 +10,11 @@ import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
+import gtPlusPlus.api.helpers.MaterialHelper;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.minecraft.MaterialUtils;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
import gtPlusPlus.xmod.bop.blocks.rainforest.LeavesRainforestTree;
import gtPlusPlus.xmod.bop.blocks.rainforest.LogRainforestTree;
@@ -48,7 +50,7 @@ public class BOP_Block_Registrator {
public static final void recipes() {
//Rainforest Oak
addLogRecipes(ItemUtils.getSimpleStack(log_Rainforest));
- addSaplingRecipes(ItemUtils.getSimpleStack(log_Rainforest));
+ addSaplingRecipes(ItemUtils.getSimpleStack(sapling_Rainforest));
}
@@ -136,17 +138,41 @@ public class BOP_Block_Registrator {
}
public static void addPyrolyeOvenRecipes(final ItemStack logStack) {
- GT_Values.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), GT_Values.NF, 1, Materials.Charcoal.getGems(20), Materials.Creosote.getFluid(4000L), 640, 64);
- GT_Values.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), Materials.Nitrogen.getGas(1000L), 2, Materials.Charcoal.getGems(20), Materials.Creosote.getFluid(4000L), 320, 96);
- GT_Values.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), GT_Values.NF, 3, Materials.Ash.getDust(4), Materials.OilHeavy.getFluid(200L), 320, 192);
- GT_Values.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), GT_Values.NF, 3, Materials.Charcoal.getGems(20), Materials.CharcoalByproducts.getGas(4000L), 640, 64);
- GT_Values.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), Materials.Nitrogen.getGas(1000L), 4, Materials.Charcoal.getGems(20), Materials.CharcoalByproducts.getGas(4000L), 320, 96);
- GT_Values.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), GT_Values.NF, 5, Materials.Charcoal.getGems(20), Materials.WoodGas.getGas(1500L), 640, 64);
- GT_Values.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), Materials.Nitrogen.getGas(1000L), 6, Materials.Charcoal.getGems(20), Materials.WoodGas.getGas(1500L), 320, 96);
- GT_Values.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), GT_Values.NF, 7, Materials.Charcoal.getGems(20), Materials.WoodVinegar.getFluid(3000L), 640, 64);
- GT_Values.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), Materials.Nitrogen.getGas(1000L), 8, Materials.Charcoal.getGems(20), Materials.WoodVinegar.getFluid(3000L), 320, 96);
- GT_Values.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), GT_Values.NF, 9, Materials.Charcoal.getGems(20), Materials.WoodTar.getFluid(1500L), 640, 64);
- GT_Values.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), Materials.Nitrogen.getGas(1000L), 10, Materials.Charcoal.getGems(20), Materials.WoodTar.getFluid(1500L), 320, 96);
+
+ Materials aOilHeavy = MaterialUtils.getMaterial("OilHeavy");
+ Materials aCharcoalByproducts = MaterialUtils.getMaterial("CharcoalByproducts");
+ Materials aWoodGas = MaterialUtils.getMaterial("WoodGas");
+ Materials aWoodVinegar = MaterialUtils.getMaterial("WoodVinegar");
+ Materials aWoodTar = MaterialUtils.getMaterial("WoodTar");
+
+
+ CORE.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), GT_Values.NF, 1, MaterialHelper.getGems(Materials.Charcoal, 20), Materials.Creosote.getFluid(4000L), 640, 64);
+ CORE.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), Materials.Nitrogen.getGas(1000L), 2, MaterialHelper.getGems(Materials.Charcoal, 20), Materials.Creosote.getFluid(4000L), 320, 96);
+
+ if (aOilHeavy != null) {
+ CORE.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), GT_Values.NF, 3, MaterialHelper.getDust(Materials.Ash, 4), aOilHeavy.getFluid(200L), 320, 192);
+
+ }
+ if (aCharcoalByproducts != null) {
+ CORE.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), GT_Values.NF, 3, MaterialHelper.getGems(Materials.Charcoal, 20), aCharcoalByproducts.getGas(4000L), 640, 64);
+ CORE.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), Materials.Nitrogen.getGas(1000L), 4, MaterialHelper.getGems(Materials.Charcoal, 20), aCharcoalByproducts.getGas(4000L), 320, 96);
+
+ }
+ if (aWoodGas != null) {
+ CORE.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), GT_Values.NF, 5, MaterialHelper.getGems(Materials.Charcoal, 20), aWoodGas.getGas(1500L), 640, 64);
+ CORE.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), Materials.Nitrogen.getGas(1000L), 6, MaterialHelper.getGems(Materials.Charcoal, 20), aWoodGas.getGas(1500L), 320, 96);
+
+ }
+ if (aWoodVinegar != null) {
+ CORE.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), GT_Values.NF, 7, MaterialHelper.getGems(Materials.Charcoal, 20), aWoodVinegar.getFluid(3000L), 640, 64);
+ CORE.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), Materials.Nitrogen.getGas(1000L), 8, MaterialHelper.getGems(Materials.Charcoal, 20), aWoodVinegar.getFluid(3000L), 320, 96);
+
+ }
+ if (aWoodTar != null) {
+ CORE.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), GT_Values.NF, 9, MaterialHelper.getGems(Materials.Charcoal, 20), aWoodTar.getFluid(1500L), 640, 64);
+ CORE.RA.addPyrolyseRecipe(GT_Utility.copyAmount(16L, logStack), Materials.Nitrogen.getGas(1000L), 10, MaterialHelper.getGems(Materials.Charcoal, 20), aWoodTar.getFluid(1500L), 320, 96);
+
+ }
}
}
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java b/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java
index fd83cc707d..49b8da0d1b 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java
@@ -109,9 +109,7 @@ public class GTPP_Bees {
private void addExtractorRecipe(ItemStack input, FluidStack output){
CORE.RA.addFluidExtractionRecipe(
input,
- null,
output,
- 0,
30,
8);
}
diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java b/src/Java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java
index 64f1cfbe23..3b59b58cab 100644
--- a/src/Java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java
+++ b/src/Java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java
@@ -21,6 +21,10 @@ public class HandlerTooltip_GC {
private static Class<?> oMainClass;
private static Class<?> oFuelLoaderClass;
private static HashMap <Integer, String> mFuelNames;
+
+ static {
+ mFuelNames = new LinkedHashMap<Integer, String>();
+ }
@SubscribeEvent
public void onItemTooltip(ItemTooltipEvent event) {
@@ -38,7 +42,7 @@ public class HandlerTooltip_GC {
oFuelLoaderClass = GCFuelLoader;
}
- Field aField = ReflectionUtils.getField(GCBlocks, "fuelLoader");
+ Field aField = ReflectionUtils.getField(oMainClass, "fuelLoader");
if (aField != null) {
Block aBlock = (Block) aField.get(null);
if (aBlock != null) {
@@ -49,10 +53,12 @@ public class HandlerTooltip_GC {
}
} catch (Throwable t) {
}
- }
+ }
+ if (mFuelNames == null) {
+ mFuelNames = new LinkedHashMap<Integer, String>();
+ }
- if (mFuelNames == null || mFuelNames.isEmpty()) {
- mFuelNames = new LinkedHashMap<Integer, String>();
+ if (mFuelNames.isEmpty()) {
for (int aMapKey : RocketFuels.mValidRocketFuels.keySet()) {
Fluid aFuel = RocketFuels.mValidRocketFuels.get(aMapKey);
if (aFuel != null) {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
index 0143c9096f..80839f0f64 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
@@ -19,9 +19,11 @@ import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
+import gtPlusPlus.api.helpers.GregtechPlusPlus_API.Multiblock_API;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.data.Pair;
+import gtPlusPlus.api.objects.minecraft.multi.NoOutputBonusMultiBehaviour;
import gtPlusPlus.australia.gen.gt.WorldGen_GT_Australia;
import gtPlusPlus.core.handler.COMPAT_HANDLER;
import gtPlusPlus.core.handler.OldCircuitHandler;
@@ -30,12 +32,15 @@ import gtPlusPlus.core.lib.CORE.ConfigSwitches;
import gtPlusPlus.core.material.ELEMENT;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.minecraft.MaterialUtils;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
import gtPlusPlus.core.util.reflect.AddGregtechRecipe;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.everglades.gen.gt.WorldGen_GT;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
import gtPlusPlus.xmod.gregtech.api.util.GTPP_Config;
import gtPlusPlus.xmod.gregtech.api.world.GTPP_Worldgen;
+import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
import gtPlusPlus.xmod.gregtech.common.StaticFields59;
import gtPlusPlus.xmod.gregtech.common.blocks.fluid.GregtechFluidHandler;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
@@ -45,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.recipe.RecipeLoader_AlgaeFarm;
import gtPlusPlus.xmod.gregtech.recipes.RecipesToRemove;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechConduits;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechNitroDieselFix;
@@ -59,6 +65,7 @@ public class HANDLER_GT {
public static final List<WorldGen_GT> sWorldgenListEverglades = new ArrayList<WorldGen_GT>();
public static final List<WorldGen_GT_Australia> sWorldgenListAustralia = new ArrayList<WorldGen_GT_Australia>();
public static final List<GTPP_Worldgen> sCustomWorldgenList = new ArrayList<GTPP_Worldgen>();
+ public static GT_MetaGenerated_Tool sMetaGeneratedToolInstance;
public static void preInit(){
@@ -88,7 +95,7 @@ public class HANDLER_GT {
//Only loads if the config option is true (default: true)
if (CORE.ConfigSwitches.enableSkookumChoochers){
- new MetaGeneratedGregtechTools();
+ sMetaGeneratedToolInstance= MetaGeneratedGregtechTools.getInstance();
}
if (ConfigSwitches.enableOldGTcircuits && !CORE.GTNH){
@@ -121,6 +128,9 @@ public class HANDLER_GT {
}
+ // Register the No-Bonus Special Behaviour.
+ Multiblock_API.registerSpecialMultiBehaviour(new NoOutputBonusMultiBehaviour());
+
//Register some custom recipe maps for any enabled multiblocks.
//MultiblockRecipeMapHandler.run();
}
@@ -133,17 +143,23 @@ public class HANDLER_GT {
}
RecipesToRemove.go();
convertPyroToCokeOven();
+ Meta_GT_Proxy.fixIC2FluidNames();
+ RecipeLoader_AlgaeFarm.generateRecipes();
}
private static void convertPyroToCokeOven() {
- int aCount = 0;
- for (GT_Recipe g : GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.mRecipeList) {
- if (AddGregtechRecipe.importPyroRecipe(g)) {
- aCount++;
+ if (ReflectionUtils.doesFieldExist(GT_Recipe.GT_Recipe_Map.class, "sPyrolyseRecipes")) {
+ int aCount = 0;
+ GT_Recipe_Map aMap = StaticFields59.getPyrolyseRecipeMap();
+ if (aMap != null) {
+ for (GT_Recipe g : aMap.mRecipeList) {
+ if (AddGregtechRecipe.importPyroRecipe(g)) {
+ aCount++;
+ }
+ }
+ Logger.INFO("Converted "+aCount+" Pyrolyse recipes into Industrial Coke Oven recipes.");
}
- }
- Logger.INFO("Converted "+aCount+" Pyrolyse recipes into Industrial Coke Oven recipes.");
-
+ }
}
private static GT_Recipe replaceItemInRecipeWithAnother(GT_Recipe aRecipe, ItemStack aExisting, ItemStack aNewItem) {
@@ -346,6 +362,10 @@ public class HANDLER_GT {
OrePrefixes.wireGt01.get(Materials.Superconductor)});*/
}
else {
+
+
+ Materials aPolytetrafluoroethylene = MaterialUtils.getMaterial("Polytetrafluoroethylene", "Plastic");
+
Logger.INFO("Adding new hard Shaped recipes for Hulls.");
GT_ModHandler.addCraftingRecipe(ItemList.Hull_LuV.get(1),
RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED,
@@ -357,13 +377,13 @@ public class HANDLER_GT {
new Object[]{"PHP", "CMC", 'M', ItemList.Casing_ZPM, 'C',
OrePrefixes.cableGt01.get(Materials.Naquadah), 'H',
CI.getPlate(aTier_ZPM, 1), 'P',
- OrePrefixes.plate.get(Materials.Polytetrafluoroethylene)});
+ OrePrefixes.plate.get(aPolytetrafluoroethylene)});
GT_ModHandler.addCraftingRecipe(ItemList.Hull_UV.get(1),
RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED,
new Object[]{"PHP", "CMC", 'M', ItemList.Casing_UV, 'C',
OrePrefixes.wireGt04.get(Materials.NaquadahAlloy), 'H',
CI.getPlate(aTier_UV, 1), 'P',
- OrePrefixes.plate.get(Materials.Polytetrafluoroethylene)});
+ OrePrefixes.plate.get(aPolytetrafluoroethylene)});
/*GT_ModHandler.addCraftingRecipe(ItemList.Hull_MAX.get(1),
RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED,
new Object[]{"PHP", "CMC", 'M', ItemList.Casing_MAX, 'C',
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
index 726fc1869d..7c395392a3 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
@@ -39,6 +39,9 @@ public enum GregtechItemList implements GregtechItemContainer {
Emitter_ULV,
Sensor_ULV,
+ //Recipe Circuit
+ Circuit_BioRecipeSelector,
+
//Circuits
Old_Circuit_Primitive, Old_Circuit_Basic, Old_Circuit_Good,
Old_Circuit_Advanced, Old_Circuit_Data, Old_Circuit_Elite,
@@ -110,6 +113,9 @@ public enum GregtechItemList implements GregtechItemContainer {
Bomb_Cast_Set, Bomb_Cast_Broken,
Bomb_Cast_Mold,
+ // Pellet Mold
+ Pellet_Mold,
+
//Charged Items for Tree Farms
Farm_Processor_EV,
Farm_Processor_IV,
@@ -225,7 +231,12 @@ public enum GregtechItemList implements GregtechItemContainer {
//Fish Pond
Industrial_FishingPond,
Casing_FishPond,
-
+
+ //Algae
+ AlgaeFarm_Controller,
+
+ //Chemical Plant
+ ChemicalPlant_Controller,
//GT4 autoCrafter
GT4_Multi_Crafter,
@@ -340,6 +351,9 @@ public enum GregtechItemList implements GregtechItemContainer {
//XL Turbine Rotor Hatch
Hatch_Turbine_Rotor,
+ //Standard Turbine Rotor Hatch
+ Hatch_Input_TurbineHousing,
+
//Control Core
Hatch_Control_Core,
@@ -475,6 +489,10 @@ public enum GregtechItemList implements GregtechItemContainer {
Machine_ZPM_Component_Maker,
Machine_UV_Component_Maker,
+ // Fluid Reactor
+ FluidReactor_LV, FluidReactor_HV,
+ FluidReactor_IV, FluidReactor_ZPM,
+
//Breakers
BreakerBox_ULV, BreakerBox_LV, BreakerBox_MV,
BreakerBox_HV, BreakerBox_EV, BreakerBox_IV,
@@ -598,7 +616,7 @@ 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,
//----------------------------------------------------------------------------
@@ -611,7 +629,6 @@ public enum GregtechItemList implements GregtechItemContainer {
private ItemStack mStack;
private boolean mHasNotBeenSet = true;
- public static Fluid sOilExtraHeavy, sOilHeavy, sOilMedium, sOilLight, sNaturalGas;
@Override
public GregtechItemList set(final Item aItem) {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java
index d3e22875ae..88b9661c95 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java
@@ -101,32 +101,32 @@ public class CONTAINER_MultiMachine extends GT_ContainerMetaTile_Machine {
//crafters = ReflectionUtils.getField(getClass(), "crafters");
}
if (timer != null && crafters != null && mControllerSet) {
- Logger.INFO("Trying to update clientside GUI data");
+ //Logger.INFO("Trying to update clientside GUI data");
try {
- Logger.INFO("0");
+ //Logger.INFO("0");
int aTimer = (int) ReflectionUtils.getFieldValue(timer, this);
//List crafters1List = (List) crafters1;
List<ICrafting> crafters2 = new ArrayList<ICrafting>();
- Logger.INFO("1");
+ //Logger.INFO("1");
for (Object o : crafters) {
if (o instanceof ICrafting) {
crafters2.add((ICrafting) o);
}
}
- Logger.INFO("2");
+ //Logger.INFO("2");
if (!crafters2.isEmpty()) {
- Logger.INFO("3");
+ //Logger.INFO("3");
handleInitialFieldSetting();
try {
- Logger.INFO("4");
+ //Logger.INFO("4");
for (final ICrafting var3 : crafters2) {
handleCraftingEvent(aTimer, var3);
}
- Logger.INFO("5");
+ //Logger.INFO("5");
handleInternalFieldSetting();
- Logger.INFO("6");
+ //Logger.INFO("6");
} catch (Throwable t) {
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java
new file mode 100644
index 0000000000..cdca065e60
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java
@@ -0,0 +1,184 @@
+package gtPlusPlus.xmod.gregtech.api.gui.fluidreactor;
+
+import java.util.Iterator;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.gui.GT_Container_BasicMachine;
+import gregtech.api.gui.GT_Slot_Render;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.slots.SlotChemicalPlantInput;
+import gtPlusPlus.core.slots.SlotNoInput;
+import gtPlusPlus.core.slots.SlotNoInputLogging;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaTileEntity_ChemicalReactor;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.ICrafting;
+import net.minecraft.item.ItemStack;
+
+public class Container_FluidReactor extends GT_Container_BasicMachine {
+
+ public boolean mFluidTransfer_1 = false;
+ public boolean mFluidTransfer_2 = false;
+ public boolean oFluidTransfer_1 = false;
+ public boolean oFluidTransfer_2 = false;
+
+ public Container_FluidReactor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ @Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+
+ // Gui Buttons
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, 0, 8, 63)); // Fluid 1
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, 1, 44, 63));
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, 2, 26, 63)); // Fluid 2
+
+ int tStartIndex = 3;
+ // Input Slots
+ this.addSlotToContainer(new SlotChemicalPlantInput(this.mTileEntity, tStartIndex++, 8, 7));
+ this.addSlotToContainer(new SlotChemicalPlantInput(this.mTileEntity, tStartIndex++, 26, 7));
+ this.addSlotToContainer(new SlotChemicalPlantInput(this.mTileEntity, tStartIndex++, 44, 7));
+ this.addSlotToContainer(new SlotChemicalPlantInput(this.mTileEntity, tStartIndex++, 62, 7));
+
+ // Output Slots
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 107, 16));
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 125, 16));
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 107, 34));
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 125, 34));
+
+ // Cell Collector Slot
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 116, 63));
+
+
+ // Inputs Fluids
+ this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 8, 42));
+ this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 26, 42));
+ this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 44, 42));
+ this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 62, 42));
+
+ // Output Fluids
+ this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 143, 16));
+ this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 143, 34));
+
+
+
+
+ }
+
+ public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
+ if (aSlotIndex == 0 || aSlotIndex == 2) {
+ if (this.mTileEntity != null && this.mTileEntity.isServerSide()) {
+ try {
+ final IMetaTileEntity aMetaTileEntity = this.mTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return null;
+ }
+ if (aMetaTileEntity instanceof GregtechMetaTileEntity_ChemicalReactor) {
+ //Set Tile
+ if (aSlotIndex == 0) {
+ ((GregtechMetaTileEntity_ChemicalReactor)aMetaTileEntity).mFluidTransfer_1 = !((GregtechMetaTileEntity_ChemicalReactor)aMetaTileEntity).mFluidTransfer_1;
+ }
+ else if (aSlotIndex == 2) {
+ ((GregtechMetaTileEntity_ChemicalReactor)aMetaTileEntity).mFluidTransfer_2 = !((GregtechMetaTileEntity_ChemicalReactor)aMetaTileEntity).mFluidTransfer_2;
+ }
+ return null;
+ }
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+ }
+ //Logger.INFO("Clicked slot "+aSlotIndex);
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if (this.mTileEntity != null && this.mTileEntity.isServerSide()) {
+ try {
+ Iterator var2 = this.crafters.iterator();
+ final IMetaTileEntity aMetaTileEntity = this.mTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ Logger.INFO("bad");
+ return;
+ }
+ if (aMetaTileEntity instanceof GregtechMetaTileEntity_ChemicalReactor) {
+ //Read from Tile
+ this.mFluidTransfer_1 = ((GregtechMetaTileEntity_ChemicalReactor)aMetaTileEntity).mFluidTransfer_1;
+ this.mFluidTransfer_2 = ((GregtechMetaTileEntity_ChemicalReactor)aMetaTileEntity).mFluidTransfer_2;
+ int mTimer;
+ mTimer = (int) ReflectionUtils.getField(this.getClass(), "mTimer").get(this);
+ while (true) {
+ ICrafting var1;
+ do {
+ if (!var2.hasNext()) {
+ this.oFluidTransfer_1 = this.mFluidTransfer_1;
+ this.oFluidTransfer_2 = this.mFluidTransfer_2;
+ return;
+ }
+ var1 = (ICrafting) var2.next();
+ if (mTimer % 500 == 10 || this.oFluidTransfer_1 != this.mFluidTransfer_1) {
+ var1.sendProgressBarUpdate(this, -50, this.mFluidTransfer_1 ? 1 : 0);
+ }
+ if (mTimer % 500 == 10 || this.oFluidTransfer_2 != this.mFluidTransfer_2) {
+ var1.sendProgressBarUpdate(this, -51, this.mFluidTransfer_2 ? 1 : 0);
+ }
+ } while (mTimer % 500 != 10);
+ }
+ }
+ else {
+ Logger.INFO("bad cast");
+ }
+ }
+ catch (IllegalArgumentException | IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ }
+
+ }
+
+ public void addCraftingToCrafters(ICrafting par1ICrafting) {
+ super.addCraftingToCrafters(par1ICrafting);
+ }
+
+ @SideOnly(Side.CLIENT)
+ public void updateProgressBar(int par1, int par2) {
+ if (par1 > 0) {
+ super.updateProgressBar(par1, par2);
+ }
+ else {
+ switch (par1) {
+ case -50 :
+ this.mFluidTransfer_1 = par2 != 0;
+ break;
+ case -51 :
+ this.mFluidTransfer_2 = par2 != 0;
+ break;
+ default :
+ break;
+ }
+ }
+ }
+
+ public int getSlotStartIndex() {
+ return 3;
+ }
+
+ public int getShiftClickStartIndex() {
+ return 3;
+ }
+
+ public int getSlotCount() {
+ return this.getShiftClickSlotCount() + 5 + 2;
+ }
+
+ public int getShiftClickSlotCount() {
+ return 4;
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java
new file mode 100644
index 0000000000..1be79b40cc
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java
@@ -0,0 +1,122 @@
+package gtPlusPlus.xmod.gregtech.api.gui.fluidreactor;
+
+import gregtech.api.gui.GT_Container_BasicMachine;
+import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gtPlusPlus.core.lib.CORE;
+
+import java.util.ArrayList;
+import java.util.List;
+import net.minecraft.entity.player.InventoryPlayer;
+
+public class GUI_FluidReactor extends GT_GUIContainerMetaTile_Machine {
+ public final String mName;
+ public final String mNEI;
+ public final byte mProgressBarDirection;
+ public final byte mProgressBarAmount;
+
+ public GUI_FluidReactor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName,
+ String aTextureFile, String aNEI) {
+ this(aInventoryPlayer, aTileEntity, aName, aTextureFile, aNEI, (byte) 0, (byte) 1);
+ }
+
+ public GUI_FluidReactor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName,
+ String aTextureFile, String aNEI, byte aProgressBarDirection, byte aProgressBarAmount) {
+ super(new Container_FluidReactor(aInventoryPlayer, aTileEntity), CORE.MODID+":textures/gui/FluidReactor.png");
+ this.mProgressBarDirection = aProgressBarDirection;
+ this.mProgressBarAmount = (byte) Math.max(1, aProgressBarAmount);
+ this.mName = aName;
+ this.mNEI = aNEI;
+ }
+
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ this.fontRendererObj.drawString(this.mName, 82, 5, 4210752);
+ this.drawTooltip(par1, par2);
+ }
+
+ private void drawTooltip(int x2, int y2) {
+ int xStart = (this.width - this.xSize) / 2;
+ int yStart = (this.height - this.ySize) / 2;
+ int x = x2 - xStart;
+ int y = y2 - yStart + 5;
+ List<String> list = new ArrayList();
+ if (y >= 67 && y <= 84) {
+ if (x >= 7 && x <= 24) {
+ list.add("Fluid 1 Auto-Output");
+ }
+ if (x >= 25 && x <= 42) {
+ list.add("Fluid 2 Auto-Output");
+ }
+ if (x >= 43 && x <= 61) {
+ list.add("Item Auto-Output");
+ }
+ }
+
+ if (!list.isEmpty()) {
+ this.drawHoveringText(list, x, y, this.fontRendererObj);
+ }
+
+ }
+
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (this.width - this.xSize) / 2;
+ int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ if (this.mContainer != null) {
+ if (((Container_FluidReactor) this.mContainer).mFluidTransfer_1) {
+ this.drawTexturedModalRect(x + 7, y + 62, 176, 18, 18, 18);
+ }
+ if (((Container_FluidReactor) this.mContainer).mFluidTransfer_2) {
+ this.drawTexturedModalRect(x + 25, y + 62, 194, 18, 18, 18);
+ }
+ if (((GT_Container_BasicMachine) this.mContainer).mItemTransfer) {
+ this.drawTexturedModalRect(x + 43, y + 62, 176, 36, 18, 18);
+ }
+
+ if (((GT_Container_BasicMachine) this.mContainer).mStuttering) {
+ this.drawTexturedModalRect(x + 79, y + 44, 176, 54, 18, 18);
+ }
+
+ if (this.mContainer.mMaxProgressTime > 0) {
+ int tSize = this.mProgressBarDirection < 2 ? 20 : 18;
+ int tProgress = Math
+ .max(1, Math
+ .min(tSize * this.mProgressBarAmount,
+ (this.mContainer.mProgressTime > 0 ? 1 : 0) + this.mContainer.mProgressTime
+ * tSize * this.mProgressBarAmount / this.mContainer.mMaxProgressTime))
+ % (tSize + 1);
+ switch (this.mProgressBarDirection) {
+ case 0 :
+ this.drawTexturedModalRect(x + 82, y + 24, 176, 0, tProgress, 18);
+ break;
+ case 1 :
+ this.drawTexturedModalRect(x + 82 + 20 - tProgress, y + 24, 196 - tProgress, 0, tProgress, 18);
+ break;
+ case 2 :
+ this.drawTexturedModalRect(x + 82, y + 24, 176, 0, 20, tProgress);
+ break;
+ case 3 :
+ this.drawTexturedModalRect(x + 82, y + 24 + 18 - tProgress, 176, 18 - tProgress, 20, tProgress);
+ break;
+ case 4 :
+ tProgress = 20 - tProgress;
+ this.drawTexturedModalRect(x + 82, y + 24, 176, 0, tProgress, 18);
+ break;
+ case 5 :
+ tProgress = 20 - tProgress;
+ this.drawTexturedModalRect(x + 82 + 20 - tProgress, y + 24, 196 - tProgress, 0, tProgress, 18);
+ break;
+ case 6 :
+ tProgress = 18 - tProgress;
+ this.drawTexturedModalRect(x + 82, y + 24, 176, 0, 20, tProgress);
+ break;
+ case 7 :
+ tProgress = 18 - tProgress;
+ this.drawTexturedModalRect(x + 82, y + 24 + 18 - tProgress, 176, 18 - tProgress, 20, tProgress);
+ }
+ }
+ }
+
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java
index d4d2fcacd7..e6203823b6 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java
@@ -36,11 +36,11 @@ public class CONTAINER_1by1_Turbine extends GT_Container_1by1 {
}
@Override
public boolean isItemValid(final ItemStack itemstack) {
- /*if (itemstack.getItem() instanceof GT_MetaGenerated_Tool) {
+ if (itemstack.getItem() instanceof GT_MetaGenerated_Tool) {
if (itemstack.getItemDamage() >= 170 && itemstack.getItemDamage() <= 176) {
return true;
}
- }*/
+ }
return false;
}
@Override
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 94adb5a92c..83f052a983 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
@@ -216,10 +216,16 @@ public interface IGregtech_RecipeAdder {
public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aDust, ItemStack aOutput);
- public boolean addFluidExtractionRecipe(ItemStack input, ItemStack input2, FluidStack output, int aTime, int aEu, int aSpecial);
+ public boolean addFluidExtractionRecipe(ItemStack input, FluidStack output, int aTime, int aEu);
+
+ public boolean addFluidExtractionRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidOut, int aTime, int aEu);
+
+ public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn);
public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn, FluidStack rFluidOut);
+ public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn, FluidStack rFluidOut, int aTime, int aEu);
+
/**
* Adds a Fusion reactor Recipe
*
@@ -265,4 +271,17 @@ 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 addBlastRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int time, long eu, int aHeat);
+
+ public boolean addPyrolyseRecipe(ItemStack aInput, FluidStack aFluidInput, int intCircuit, ItemStack aOutput, FluidStack aFluidOutput, int aDuration, int aEUt);
+
+ public boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt);
+
+ public boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden);
+
+ public boolean addPulverisationRecipe(final ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, final ItemStack aOutput3);
+
+
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java
index f6bec1f402..6967c8eb33 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java
@@ -1,7 +1,9 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity;
+import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Random;
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
@@ -9,19 +11,39 @@ import gregtech.api.enums.GT_Values;
import gregtech.api.metatileentity.BaseMetaTileEntity;
import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_Utility;
-import gregtech.common.GT_Pollution;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
+import gtPlusPlus.xmod.gregtech.common.StaticFields59;
import ic2.api.Direction;
+import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public class BaseCustomTileEntity extends BaseMetaTileEntity {
protected NBTTagCompound mRecipeStuff2;
+ private static final Field ENTITY_ITEM_HEALTH_FIELD_2;
+
+ static {
+ Field f = null;
+ try {
+ f = EntityItem.class.getDeclaredField("field_70291_e");
+ f.setAccessible(true);
+ } catch (Exception var4) {
+ try {
+ f = EntityItem.class.getDeclaredField("health");
+ f.setAccessible(true);
+ } catch (Exception var3) {
+ var4.printStackTrace();
+ var3.printStackTrace();
+ }
+ }
+
+ ENTITY_ITEM_HEALTH_FIELD_2 = f;
+ }
public BaseCustomTileEntity() {
super();
@@ -74,7 +96,14 @@ public class BaseCustomTileEntity extends BaseMetaTileEntity {
this.mReleaseEnergy = false;
this.mMetaTileEntity.onExplosion();
int i;
- if (GT_Mod.gregtechproxy.mExplosionItemDrop) {
+
+ boolean aExplosionDropItem = false;
+ Object aProxyField = StaticFields59.getFieldFromGregtechProxy(false, "mExplosionItemDrop");
+ if (boolean.class.isInstance(aProxyField) || Boolean.class.isInstance(aProxyField)) {
+ aExplosionDropItem = (boolean) aProxyField;
+ }
+
+ if (aExplosionDropItem) {
for (i = 0; i < this.getSizeInventory(); ++i) {
ItemStack tItem = this.getStackInSlot(i);
if (tItem != null && tItem.stackSize > 0 && this.isValidSlot(i)) {
@@ -95,6 +124,38 @@ public class BaseCustomTileEntity extends BaseMetaTileEntity {
}
}
+
+
+ public void dropItems(ItemStack tItem) {
+ if (tItem != null) {
+ Random tRandom = new Random();
+ EntityItem tItemEntity = new EntityItem(this.worldObj,
+ (double) ((float) this.xCoord + tRandom.nextFloat() * 0.8F + 0.1F),
+ (double) ((float) this.yCoord + tRandom.nextFloat() * 0.8F + 0.1F),
+ (double) ((float) this.zCoord + tRandom.nextFloat() * 0.8F + 0.1F),
+ new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage()));
+ if (tItem.hasTagCompound()) {
+ tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) tItem.getTagCompound().copy());
+ }
+
+ tItemEntity.motionX = tRandom.nextGaussian() * 0.0500000007450581D;
+ tItemEntity.motionY = tRandom.nextGaussian() * 0.0500000007450581D + 0.2000000029802322D;
+ tItemEntity.motionZ = tRandom.nextGaussian() * 0.0500000007450581D;
+ tItemEntity.hurtResistantTime = 999999;
+ tItemEntity.lifespan = 60000;
+
+ try {
+ if (ENTITY_ITEM_HEALTH_FIELD_2 != null) {
+ ENTITY_ITEM_HEALTH_FIELD_2.setInt(tItemEntity, 99999999);
+ }
+ } catch (Exception var5) {
+ ;
+ }
+
+ this.worldObj.spawnEntityInWorld(tItemEntity);
+ tItem.stackSize = 0;
+ }
+ }
public ArrayList<ItemStack> getDrops() {
ArrayList<ItemStack> aDrops = new ArrayList<ItemStack>();
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java
index 1ce7fc49d3..e1b329c07f 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java
@@ -247,9 +247,9 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank
public int getFuelValue(FluidStack aLiquid) {
if (aLiquid != null && this.getRecipes() != null) {
Collection<GT_Recipe> tRecipeList = this.getRecipes().mRecipeList;
- Logger.WARNING("Fuels: "+tRecipeList.size());
if (tRecipeList != null) {
- Iterator var4 = tRecipeList.iterator();
+ Logger.WARNING("Fuels: "+tRecipeList.size());
+ Iterator<GT_Recipe> var4 = tRecipeList.iterator();
while (var4.hasNext()) {
GT_Recipe tFuel = (GT_Recipe) var4.next();
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java
index 19ba932a02..2eb1d36791 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java
@@ -11,11 +11,11 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_ItemStack;
import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.objects.XSTR;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
+import gtPlusPlus.api.objects.random.XSTR;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java
index 9b730c84a3..5fef0f1088 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java
@@ -34,14 +34,17 @@ public class GT_MetaTileEntity_Hatch_DynamoBuffer extends GT_MetaTileEntity_Hatc
return new ITexture[]{aBaseTexture, TexturesGtBlock.OVERLAYS_ENERGY_OUT_MULTI_BUFFER[this.mTier]};
}
+ @Override
public long getMinimumStoredEU() {
return 0L;
}
+ @Override
public long maxEUStore() {
return 512L + GT_Values.V[this.mTier + 1] * 2048L;
}
+ @Override
public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
return (MetaTileEntity) new GT_MetaTileEntity_Hatch_DynamoBuffer(this.mName, this.mTier, this.mDescription, this.mTextures);
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java
new file mode 100644
index 0000000000..752321506d
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java
@@ -0,0 +1,212 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
+
+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.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus;
+import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeTurbine;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import gtPlusPlus.core.util.sys.KeyboardUtils;
+import gtPlusPlus.xmod.gregtech.api.gui.hatches.CONTAINER_1by1_Turbine;
+import gtPlusPlus.xmod.gregtech.api.gui.hatches.GUI_1by1_Turbine;
+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.world.World;
+import net.minecraft.world.chunk.Chunk;
+
+public class GT_MetaTileEntity_Hatch_TurbineProvider extends GT_MetaTileEntity_Hatch_InputBus {
+
+ public GT_MetaTileEntity_Hatch_TurbineProvider(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier);
+ }
+
+ public GT_MetaTileEntity_Hatch_TurbineProvider(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ public GT_MetaTileEntity_Hatch_TurbineProvider(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription[0], aTextures);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Hatch_TurbineProvider(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_1by1_Turbine(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_1by1_Turbine(aPlayerInventory, aBaseMetaTileEntity, "Turbine Housing");
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{
+ "An automation port for Large Turbines", "Will attempt once per 1200 ticks to fill the turbine slot of it's parent turbine", "You may adjust this with a screwdriver", "Hold shift to adjust in finer amounts", "Hold control to adjust direction", "Left Click with Screwdriver to reset", "This module assumes the entire turbine is in the same Chunk"};
+ }
+
+
+ private GT_MetaTileEntity_LargeTurbine mParent = null;
+
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ super.onPostTick(aBaseMetaTileEntity, aTimer);
+ if (aTimer % mRefreshTime == 0 && this.getBaseMetaTileEntity().isServerSide()) {
+ tryRefillTurbine();
+ }
+ }
+
+ private final void tryFindParentTurbine() {
+ Logger.INFO("This turbine housing has no parent, searching world.");
+ IGregTechTileEntity T = this.getBaseMetaTileEntity();
+ World W = T.getWorld();
+ Chunk C = W.getChunkFromBlockCoords(T.getXCoord(), T.getZCoord());
+ for (Object o : C.chunkTileEntityMap.values()) {
+ if (o instanceof IGregTechTileEntity) {
+ IGregTechTileEntity G = (IGregTechTileEntity) o;
+ final IMetaTileEntity aMetaTileEntity = G.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ continue;
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_LargeTurbine) {
+ GT_MetaTileEntity_LargeTurbine aTurb = (GT_MetaTileEntity_LargeTurbine) aMetaTileEntity;
+ for (GT_MetaTileEntity_Hatch_InputBus ee : aTurb.mInputBusses) {
+ if (ee.equals(this)) {
+ mParent = aTurb;
+ Logger.INFO("Found a Parent to attach to this housing.");
+ return;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private final void tryRefillTurbine() {
+ if (mParent == null) {
+ tryFindParentTurbine();
+ }
+ if (mParent != null && mParent.mInventory[1] == null) {
+ for (ItemStack aStack : this.mInventory) {
+ if (isItemStackTurbine(aStack)) {
+ setGUIItemStack(aStack);
+ }
+ }
+ }
+ }
+
+ protected boolean setGUIItemStack(ItemStack aNewGuiSlotContents) {
+ boolean result = false;
+ if (mParent.mInventory[1] == null) {
+ mParent.mInventory[1] = aNewGuiSlotContents != null ? aNewGuiSlotContents.copy() : null;
+ mParent.depleteInput(aNewGuiSlotContents);
+ mParent.updateSlots();
+ this.updateSlots();
+ result = true;
+ }
+ return result;
+ }
+
+ public boolean isItemStackTurbine(ItemStack aStack) {
+ if (aStack.getItem() instanceof GT_MetaGenerated_Tool) {
+ if (aStack.getItemDamage() >= 170 && aStack.getItemDamage() <= 176) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean isItemStackScrewdriver(ItemStack aStack) {
+ if (aStack.getItem() instanceof GT_MetaGenerated_Tool) {
+ if (aStack.getItemDamage() == 22 || aStack.getItemDamage() == 150) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return isItemStackTurbine(aStack);
+ }
+
+ private int mRefreshTime = 1200;
+ private boolean mDescending = true;
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setInteger("mRefreshTime", mRefreshTime);
+ aNBT.setBoolean("mDescending", mDescending);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ mRefreshTime = aNBT.getInteger("mRefreshTime");
+ mDescending = aNBT.getBoolean("mDescending");
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (aPlayer != null) {
+ if (KeyboardUtils.isCtrlKeyDown()) {
+ mDescending = Utils.invertBoolean(mDescending);
+ PlayerUtils.messagePlayer(aPlayer, "Direction: "+(mDescending ? "DOWN" : "UP"));
+ }
+ else {
+ int aAmount = 0;
+ if (KeyboardUtils.isShiftKeyDown()) {
+ aAmount = 10;
+ }
+ else {
+ aAmount = 100;
+ }
+ if (mDescending) {
+ mRefreshTime -= aAmount;
+ if (mRefreshTime < 0) {
+ mRefreshTime = 1200;
+ }
+ }
+ else {
+ mRefreshTime += aAmount;
+ if (mRefreshTime > 1200) {
+ mRefreshTime = 0;
+ }
+ }
+ PlayerUtils.messagePlayer(aPlayer, "Set check time to be every "+mRefreshTime+" ticks.");
+ }
+ }
+ }
+
+ @Override
+ public void onLeftclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ boolean aDidScrewdriver = false;
+ if (aPlayer != null) {
+ if (aPlayer.getHeldItem() != null) {
+ if (isItemStackScrewdriver(aPlayer.getHeldItem())) {
+ aDidScrewdriver = true;
+ mRefreshTime = 1200;
+ PlayerUtils.messagePlayer(aPlayer, "Reset check time to "+mRefreshTime+" ticks.");
+ }
+ }
+ }
+ if (!aDidScrewdriver) {
+ super.onLeftclick(aBaseMetaTileEntity, aPlayer);
+ }
+ }
+
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java
index e0844bb071..4c60d9a932 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java
@@ -9,7 +9,6 @@ import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
@@ -17,7 +16,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public class GT_MetaTileEntity_SuperBus_Input extends GT_MetaTileEntity_Hatch_InputBus {
- public GT_Recipe_Map mRecipeMap = null;
public GT_MetaTileEntity_SuperBus_Input(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier);
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java
index 3afa3312b1..cca5a39de3 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java
@@ -58,7 +58,7 @@ public class GT_MetaTileEntity_SuperBus_Output extends GT_MetaTileEntity_Hatch_O
if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.hasInventoryBeenModified()) {
this.fillStacksIntoFirstSlots();
}
-
+ super.onPostTick(aBaseMetaTileEntity, aTimer);
}
public void updateSlots() {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java
index 839fb3a14a..c9b98a6a64 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java
@@ -102,7 +102,7 @@ public class GT_MetaTileEntity_Hatch_CustomFluidBase extends GT_MetaTileEntity_H
String[] s2 = new String[]{
"Fluid Input for Multiblocks",
"Capacity: " + getCapacity()+"L",
- "Accepted Fluid: " + mTempMod + mLockedStack.getLocalizedName()
+ "Accepted Fluid: " + mTempMod + mLockedStack != null ? mLockedStack.getLocalizedName() : "Empty"
};
return s2;
}
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 c16f62866f..3869adb7ab 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
@@ -6,6 +6,7 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.TimeUnit;
@@ -40,15 +41,22 @@ import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.GTplusplus;
import gtPlusPlus.GTplusplus.INIT_PHASE;
+import gtPlusPlus.api.helpers.GregtechPlusPlus_API.Multiblock_API;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.api.objects.data.ConcurrentHashSet;
+import gtPlusPlus.api.objects.data.ConcurrentSet;
+import gtPlusPlus.api.objects.data.FlexiblePair;
+import gtPlusPlus.api.objects.data.Triplet;
import gtPlusPlus.api.objects.minecraft.BlockPos;
+import gtPlusPlus.api.objects.minecraft.multi.SpecialMultiBehaviour;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import gtPlusPlus.preloader.asm.AsmConfig;
import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_MultiMachine;
import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_MultiMachine_NoPlayerInventory;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine;
@@ -71,14 +79,10 @@ import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidStack;
-public abstract class GregtechMeta_MultiBlockBase
-extends
-GT_MetaTileEntity_MultiBlockBase {
-
+public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_MultiBlockBase {
public static final boolean DEBUG_DISABLE_CORES_TEMPORARILY = true;
-
static {
Method a08 = findRecipe08 = ReflectionUtils.getMethod(GT_Recipe_Map.class, "findRecipe", IHasWorldObjectAndCoords.class, GT_Recipe.class, boolean.class, long.class, FluidStack[].class, ItemStack.class, ItemStack[].class);
@@ -86,8 +90,19 @@ GT_MetaTileEntity_MultiBlockBase {
Logger.MACHINE_INFO("Found .08 findRecipe method? "+(a08 != null));
Logger.MACHINE_INFO("Found .09 findRecipe method? "+(a09 != null));
- //gregtech.api.util.GT_Recipe.GT_Recipe_Map.findRecipe(IHasWorldObjectAndCoords, GT_Recipe, boolean, long, FluidStack[], ItemStack, ItemStack...)
+ if (CORE.DEBUG) {
+ aLogger = ReflectionUtils.getMethod(Logger.class, "INFO", String.class);
+ }
+ else {
+ aLogger = ReflectionUtils.getMethod(Logger.class, "MACHINE_INFO", String.class);
+ }
+ try {
+ calculatePollutionReduction = GT_MetaTileEntity_Hatch_Muffler.class.getDeclaredMethod("calculatePollutionReduction", int.class);
+ } catch (NoSuchMethodException | SecurityException e) {}
+
+ mCustomBehviours = new HashMap<String, SpecialMultiBehaviour>();
+
}
//Find Recipe Methods
@@ -105,6 +120,10 @@ GT_MetaTileEntity_MultiBlockBase {
public ArrayList<GT_MetaTileEntity_Hatch_InputBattery> mChargeHatches = new ArrayList<GT_MetaTileEntity_Hatch_InputBattery>();
public ArrayList<GT_MetaTileEntity_Hatch_OutputBattery> mDischargeHatches = new ArrayList<GT_MetaTileEntity_Hatch_OutputBattery>();
+ // Custom Behaviour Map
+ private static final HashMap<String, SpecialMultiBehaviour> mCustomBehviours;
+
+
public GregtechMeta_MultiBlockBase(final int aID, final String aName,
final String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -123,7 +142,7 @@ GT_MetaTileEntity_MultiBlockBase {
}
public abstract boolean hasSlotInGUI();
-
+
public long getTotalRuntimeInTicks() {
return this.mTotalRunTime;
}
@@ -264,7 +283,7 @@ GT_MetaTileEntity_MultiBlockBase {
}
-
+
public int getPollutionReductionForAllMufflers() {
int mPollutionReduction=0;
for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
@@ -274,7 +293,7 @@ GT_MetaTileEntity_MultiBlockBase {
}
return mPollutionReduction;
}
-
+
public long getStoredEnergyInAllEnergyHatches() {
long storedEnergy=0;
for(GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) {
@@ -284,7 +303,7 @@ GT_MetaTileEntity_MultiBlockBase {
}
return storedEnergy;
}
-
+
public long getMaxEnergyStorageOfAllEnergyHatches() {
long maxEnergy=0;
for(GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) {
@@ -329,7 +348,7 @@ GT_MetaTileEntity_MultiBlockBase {
}*/
String aRequiresMuffler = "1x Muffler Hatch";
- String aRequiresCoreModule = "1x Core Module";
+ //String aRequiresCoreModule = "1x Core Module";
String aRequiresMaint = "1x Maintanence Hatch";
String[] x = getTooltip();
@@ -396,8 +415,11 @@ GT_MetaTileEntity_MultiBlockBase {
String[] aToolTip = new String[(a2 + a3)];
aToolTip = ArrayUtils.addAll(aToolTip, x);
aToolTip = ArrayUtils.addAll(aToolTip, z);
- aCachedToolTip = aToolTip;
- return aToolTip;
+
+ if (aCachedToolTip == null || aCachedToolTip.length <= 0) {
+ aCachedToolTip = aToolTip;
+ }
+ return aCachedToolTip;
}
public abstract String[] getTooltip();
@@ -449,67 +471,316 @@ GT_MetaTileEntity_MultiBlockBase {
public String getSound() { return ""; }
+
public boolean canBufferOutputs(final GT_Recipe aRecipe, int aParallelRecipes) {
- if (aRecipe.mOutputs.length > 16) {
- // Gendustry custom comb with a billion centrifuge outputs? Do it anyway.
- return true;
- }
+ return canBufferOutputs(aRecipe, aParallelRecipes, true);
+ }
+
+ public boolean canBufferOutputs(final GT_Recipe aRecipe, int aParallelRecipes, boolean aAllow16SlotWithoutCheck) {
- // Count slots available in output buses
- ArrayList<ItemStack> tBusStacks = new ArrayList<>();
+ Logger.INFO("Determining if we have space to buffer outputs. Parallel: "+aParallelRecipes);
- int tEmptySlots = 0;
- for (final GT_MetaTileEntity_Hatch_OutputBus tBus : this.mOutputBusses) {
- if (!isValidMetaTileEntity(tBus)) {
- continue;
+ // Null recipe or a recipe with lots of outputs?
+ // E.G. Gendustry custom comb with a billion centrifuge outputs?
+ // 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;
}
- final IInventory tBusInv = tBus.getBaseMetaTileEntity();
- for (int i = 0; i < tBusInv.getSizeInventory(); i++) {
- if (tBus.getStackInSlot(i) == null) {
- tEmptySlots++;
+ else if (aRecipe.mOutputs.length > 16) {
+ if (aAllow16SlotWithoutCheck) {
+ return true;
}
else {
- tBusStacks.add(tBus.getStackInSlot(i));
+ // Do nothing, we want to check this recipe properly.
}
- }
- }
+ }
+ }
- int slotsNeeded = aRecipe.mOutputs.length;
- for (final ItemStack tRecipeOutput: aRecipe.mOutputs) {
- 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;
+ // Do we even need to check for item outputs?
+ boolean aDoesOutputItems = aRecipe.mOutputs.length > 0;
+ // Do we even need to check for fluid outputs?
+ boolean aDoesOutputFluids = aRecipe.mFluidOutputs.length > 0;
+
+
+
+ /* ========================================
+ * Item Management
+ * ========================================
+ */
+
+ if (aDoesOutputItems) {
+ Logger.INFO("We have items to output.");
+
+ // How many slots are free across all the output buses?
+ int aInputBusSlotsFree = 0;
+
+ /*
+ * Create Variables for Item Output
+ */
+
+ AutoMap<FlexiblePair<ItemStack, Integer>> aItemMap = new AutoMap<FlexiblePair<ItemStack, Integer>>();
+ AutoMap<ItemStack> aOutputs = new AutoMap<ItemStack>(aRecipe.mOutputs);
+
+ 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) {
+ aInputBusSlotsFree++;
}
+ else {
+ ItemStack aT = tBus.getStackInSlot(i);
+ int aSize = aT.stackSize;
+ aT = aT.copy();
+ aT.stackSize = 0;
+ aItemMap.put(new FlexiblePair<ItemStack, Integer>(aT, aSize));
+ }
+ }
+ }
+
+ // Count the slots we need, later we can check if any are able to merge with existing stacks
+ int aRecipeSlotsRequired = 0;
+
+ // A map to hold the items we will be 'inputting' into the output buses. These itemstacks are actually the recipe outputs.
+ ConcurrentSet<FlexiblePair<ItemStack, Integer>> aInputMap = new ConcurrentHashSet<FlexiblePair<ItemStack, Integer>>();
+
+ // Iterate over the outputs, calculating require stack spacing they will require.
+ for (int i=0;i<aOutputs.size();i++) {
+ ItemStack aY = aOutputs.get(i);
+ if (aY == null) {
+ continue;
}
+ else {
+ int aStackSize = aY.stackSize * aParallelRecipes;
+ if (aStackSize > 64) {
+ int aSlotsNeedsForThisStack = (int) Math.ceil((double) ((float) aStackSize / 64f));
+ // Should round up and add as many stacks as required nicely.
+ aRecipeSlotsRequired += aSlotsNeedsForThisStack;
+ for (int o=0;o<aRecipeSlotsRequired;o++) {
+ int aStackToRemove = (aStackSize -= 64) > 64 ? 64 : aStackSize;
+ aY = aY.copy();
+ aY.stackSize = 0;
+ aInputMap.add(new FlexiblePair<ItemStack, Integer>(aY, aStackToRemove));
+ }
+ }
+ else {
+ // Only requires one slot
+ aRecipeSlotsRequired++;
+ aY = aY.copy();
+ aY.stackSize = 0;
+ aInputMap.add(new FlexiblePair<ItemStack, Integer>(aY, aStackSize));
+ }
+ }
+ }
+
+ // We have items to add to the output buses. See if any are not full stacks and see if we can make them full.
+ if (aInputMap.size() > 0) {
+ // Iterate over the current stored items in the Output busses, if any match and are not full, we can try account for merging.
+ busItems: for (FlexiblePair<ItemStack, Integer> y : aItemMap) {
+ // Iterate over the 'inputs', we can safely remove these as we go.
+ outputItems: for (FlexiblePair<ItemStack, Integer> u : aInputMap) {
+ // Create local vars for readability.
+ ItemStack aOutputBusStack = y.getKey();
+ ItemStack aOutputStack = u.getKey();
+ // Stacks match, including NBT.
+ if (GT_Utility.areStacksEqual(aOutputBusStack, aOutputStack, false)) {
+ // Stack Matches, but it's full, continue.
+ if (aOutputBusStack.stackSize >= 64) {
+ // This stack is full, no point checking it.
+ continue busItems;
+ }
+ else {
+ // We can merge these two stacks without any hassle.
+ if ((aOutputBusStack.stackSize + aOutputStack.stackSize) <= 64) {
+ // Update the stack size in the bus storage map.
+ y.setValue(aOutputBusStack.stackSize + aOutputStack.stackSize);
+ // Remove the 'input' stack from the recipe outputs, so we don't try count it again.
+ aInputMap.remove(u);
+ continue outputItems;
+ }
+ // Stack merging is too much, so we fill this stack, leave the remainder.
+ else {
+ int aRemainder = (aOutputBusStack.stackSize + aOutputStack.stackSize) - 64;
+ // Update the stack size in the bus storage map.
+ y.setValue(64);
+ // Create a new object to iterate over later, with the remainder data;
+ FlexiblePair<ItemStack, Integer> t = new FlexiblePair<ItemStack, Integer>(u.getKey(), aRemainder);
+ // Remove the 'input' stack from the recipe outputs, so we don't try count it again.
+ aInputMap.remove(u);
+ // Add the remainder stack.
+ aInputMap.add(t);
+ continue outputItems;
+ }
+ }
+ }
+ else {
+ continue outputItems;
+ }
+ }
+ }
}
+
+ // We have stacks that did not merge, do we have space for them?
+ if (aInputMap.size() > 0) {
+ if (aInputMap.size() > aInputBusSlotsFree) {
+ // 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;
+ }
+ }
+
+ /*
+ * End Item Management
+ */
+
}
- // Enough open slots?
- if (tEmptySlots < slotsNeeded) return false;
- // For each output fluid, make sure an output hatch can accept it.
- for (FluidStack tRecipeFluid: aRecipe.mFluidOutputs) {
- if (tRecipeFluid == null) continue;
- boolean tCanBufferFluid = false;
- int tRecipeAmount = tRecipeFluid.amount;
- for (final GT_MetaTileEntity_Hatch_Output tHatch : this.mOutputHatches) {
- FluidStack tHatchFluid = tHatch.getFluid();
- if (tHatchFluid == null) {
- if(tHatch.getCapacity() > tRecipeAmount) {
- tCanBufferFluid = true;
- break;
- }
+
+
+
+
+ /* ========================================
+ * Fluid Management
+ * ========================================
+ */
+
+
+
+ if (aDoesOutputFluids) {
+ Logger.INFO("We have Fluids to output.");
+ // How many slots are free across all the output buses?
+ int aFluidHatches = 0;
+ 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>>();
+ for (final GT_MetaTileEntity_Hatch_Output tBus : this.mOutputHatches) {
+ if (!isValidMetaTileEntity(tBus)) {
+ continue;
}
- else if (tHatchFluid.isFluidEqual(tRecipeFluid) && tHatch.getCapacity() - tHatchFluid.amount > tRecipeAmount) {
- tCanBufferFluid = true;
- break;
+ aFluidHatches++;
+ // Map the Hatch with the space left for easy checking later.
+ if (tBus.getFluid() == null) {
+ aOutputHatches.add(new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(tBus, null, tBus.getCapacity()));
+ }
+ else {
+ int aSpaceLeft = tBus.getCapacity() - tBus.getFluidAmount();
+ aOutputHatches.add(new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(tBus, tBus.getFluid(), aSpaceLeft));
+ }
+ }
+ // Create a map of all the fluids we would like to output, we can iterate over this and see how many we can merge into existing hatch stacks.
+ ConcurrentHashSet<FluidStack> aOutputFluids = new ConcurrentHashSet<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) {
+ // The Hatch Itself
+ GT_MetaTileEntity_Hatch_Output aHatch = aHatchData.getValue_1();
+ // Fluid in the Hatch
+ FluidStack aHatchStack = aHatchData.getValue_2();
+ // Space left in Hatch
+ int aSpaceLeftInHatch = aHatch.getCapacity() - aHatch.getFluidAmount();
+ // Hatch is full,
+ if (aSpaceLeftInHatch <= 0) {
+ aFullFluidHatches++;
+ aOutputHatches.remove(aHatchData);
+ continue aHatchIterator;
+ }
+ // Hatch has space
+ else {
+ // Check if any fluids match
+ aFluidMatch: for (FluidStack aOutputStack : aOutputFluids) {
+ if (GT_Utility.areFluidsEqual(aHatchStack, aOutputStack)) {
+ int aFluidToPutIntoHatch = aOutputStack.amount;
+ // 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) {
+ // Copy existing Hatch Stack
+ FluidStack aNewHatchStack = aHatchStack.copy();
+ aNewHatchStack.amount = 0;
+ // Copy existing Hatch Stack again
+ FluidStack aNewOutputStack = aHatchStack.copy();
+ aNewOutputStack.amount = 0;
+ // How much fluid do we have left after we fill the hatch?
+ int aFluidLeftAfterInsert = aFluidToPutIntoHatch - aSpaceLeftInHatch;
+ // Set new stacks to appropriate values
+ aNewHatchStack.amount = aHatch.getCapacity();
+ aNewOutputStack.amount = aFluidLeftAfterInsert;
+ // Remove fluid from output list, merge success
+ aOutputFluids.remove(aOutputStack);
+ // Remove hatch from hatch list, data is now invalid.
+ aOutputHatches.remove(aHatchData);
+ // 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;
+ }
+ // 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;
+ // Remove fluid from output list, merge success
+ aOutputFluids.remove(aOutputStack);
+ // Remove hatch from hatch list, data is now invalid.
+ aOutputHatches.remove(aHatchData);
+ // 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;
+ }
+ // We have more space than we need to merge, so we remove the stack from the output list and update the hatch list.
+ else {
+ // Copy Old Stack
+ FluidStack aNewHatchStack = aHatchStack.copy();
+ // Add in amount from output stack
+ aNewHatchStack.amount += aOutputStack.amount;
+ // Remove fluid from output list, merge success
+ aOutputFluids.remove(aOutputStack);
+ // Remove hatch from hatch list, data is now invalid.
+ aOutputHatches.remove(aHatchData);
+ // 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;
+ }
+
+ }
+ else {
+ continue aFluidMatch;
+ }
+ }
+ }
+ }
+
+ for (Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aFreeHatchCheck : aOutputHatches) {
+ // Free Hatch
+ if (aFreeHatchCheck.getValue_2() == null || aFreeHatchCheck.getValue_3() == 0 || aFreeHatchCheck.getValue_1().getFluid() == null) {
+ aEmptyFluidHatches++;
+ }
+ }
+
+ // We have Fluid Stacks we did not merge. Do we have space?
+ 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;
}
}
- if (!tCanBufferFluid) return false;
+
+ /*
+ * End Fluid Management
+ */
}
+
return true;
}
@@ -519,21 +790,26 @@ GT_MetaTileEntity_MultiBlockBase {
public static Method aLogger = null;
public void log(String s) {
-
- boolean isDebugLogging = CORE.DEBUG;
boolean reset = true;
-
- if (aLogger == null || reset) {
- if (isDebugLogging) {
- aLogger = ReflectionUtils.getMethod(Logger.class, "INFO", String.class);
+ if (reset || aLogger == null) {
+ if (!AsmConfig.disableAllLogging) {
+ aLogger = ReflectionUtils.getMethod(
+ Logger.class, "INFO", String.class
+ );
}
else {
- aLogger = ReflectionUtils.getMethod(Logger.class, "MACHINE_INFO", String.class);
+ aLogger = ReflectionUtils.getMethod(
+ Logger.class, "MACHINE_INFO", String.class
+ );
}
}
try {
aLogger.invoke(null, s);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {}
+ }
+ catch (IllegalAccessException | IllegalArgumentException
+ | InvocationTargetException e) {
+ e.printStackTrace();
+ }
}
@@ -717,8 +993,7 @@ GT_MetaTileEntity_MultiBlockBase {
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.
-
+ // Based on the Processing Array. A bit overkill, but very flexible.
// Reset outputs and progress stats
this.mEUt = 0;
@@ -729,12 +1004,11 @@ GT_MetaTileEntity_MultiBlockBase {
long tVoltage = getMaxInputVoltage();
byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
log("Running checkRecipeGeneric(0)");
-
-
+
GT_Recipe tRecipe = findRecipe(
getBaseMetaTileEntity(), mLastRecipe, false,
- gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
-
+ gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
+
log("Running checkRecipeGeneric(1)");
// Remember last recipe - an optimization for findRecipe()
this.mLastRecipe = tRecipe;
@@ -743,6 +1017,50 @@ GT_MetaTileEntity_MultiBlockBase {
log("BAD RETURN - 1");
return false;
}
+
+
+ /*
+ * Check for Special Behaviours
+ */
+
+ // First populate the map if we need to.
+ if (mCustomBehviours == null || mCustomBehviours.isEmpty()) {
+ mCustomBehviours.putAll(Multiblock_API.getSpecialBehaviourItemMap());
+ }
+
+ // We have a special slot object in the recipe
+ if (tRecipe.mSpecialItems != null) {
+ // The special slot is an item
+ if (tRecipe.mSpecialItems instanceof ItemStack) {
+ // Make an Itemstack instance of this.
+ ItemStack aSpecialStack = (ItemStack) tRecipe.mSpecialItems;
+ // Check if this item is in an input bus.
+ boolean aDidFindMatch = false;
+ for (ItemStack aInputItemsToCheck : aItemInputs) {
+ // If we find a matching stack, continue.
+ if (GT_Utility.areStacksEqual(aSpecialStack, aInputItemsToCheck, false)) {
+ // Iterate all special behaviour items, to see if we need to utilise one.
+ aDidFindMatch = true;
+ break;
+ }
+ }
+ // Try prevent needless iteration loops if we don't have the required inputs at all.
+ if (aDidFindMatch) {
+ // Iterate all special behaviour items, to see if we need to utilise one.
+ for (SpecialMultiBehaviour aBehaviours : mCustomBehviours.values()) {
+ // Found a match, let's adjust this recipe now.
+ if (aBehaviours.isTriggerItem(aSpecialStack)) {
+ // Adjust this recipe to suit special item
+ aMaxParallelRecipes = aBehaviours.getMaxParallelRecipes();
+ aEUPercent = aBehaviours.getEUPercent();
+ aSpeedBonusPercent = aBehaviours.getSpeedBonusPercent();
+ aOutputChanceRoll = aBehaviours.getOutputChanceRoll();
+ break;
+ }
+ }
+ }
+ }
+ }
if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) {
log("BAD RETURN - 2");
@@ -778,6 +1096,7 @@ GT_MetaTileEntity_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.
aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
@@ -1293,7 +1612,7 @@ GT_MetaTileEntity_MultiBlockBase {
boolean result = false;
if (this.mInventory[1] == null) {
this.mInventory[1] = aNewGuiSlotContents != null ? aNewGuiSlotContents.copy() : null;
- aNewGuiSlotContents = null;
+ this.depleteInput(aNewGuiSlotContents);
this.updateSlots();
result = true;
}
@@ -1361,36 +1680,36 @@ GT_MetaTileEntity_MultiBlockBase {
public boolean causeMaintenanceIssue() {
boolean b = false;
switch (this.getBaseMetaTileEntity().getRandomNumber(6)) {
- case 0 : {
- this.mWrench = false;
- b = true;
- break;
- }
- case 1 : {
- this.mScrewdriver = false;
- b = true;
- break;
- }
- case 2 : {
- this.mSoftHammer = false;
- b = true;
- break;
- }
- case 3 : {
- this.mHardHammer = false;
- b = true;
- break;
- }
- case 4 : {
- this.mSolderingTool = false;
- b = true;
- break;
- }
- case 5 : {
- this.mCrowbar = false;
- b = true;
- break;
- }
+ case 0 : {
+ this.mWrench = false;
+ b = true;
+ break;
+ }
+ case 1 : {
+ this.mScrewdriver = false;
+ b = true;
+ break;
+ }
+ case 2 : {
+ this.mSoftHammer = false;
+ b = true;
+ break;
+ }
+ case 3 : {
+ this.mHardHammer = false;
+ b = true;
+ break;
+ }
+ case 4 : {
+ this.mSolderingTool = false;
+ b = true;
+ break;
+ }
+ case 5 : {
+ this.mCrowbar = false;
+ b = true;
+ break;
+ }
}
return b;
}
@@ -1432,13 +1751,15 @@ GT_MetaTileEntity_MultiBlockBase {
boolean aExists = false;
for (E m : aList) {
IGregTechTileEntity b = ((IMetaTileEntity) m).getBaseMetaTileEntity();
- BlockPos aPos = new BlockPos(b);
- if (b != null && aPos != null) {
- if (aCurPos.equals(aPos)) {
- if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) {
- log("Found Duplicate "+b.getInventoryName()+" at " + aPos.getLocationString());
+ if (b != null) {
+ BlockPos aPos = new BlockPos(b);
+ if (aPos != null) {
+ if (aCurPos.equals(aPos)) {
+ if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) {
+ log("Found Duplicate "+b.getInventoryName()+" at " + aPos.getLocationString());
+ }
+ return false;
}
- return false;
}
}
}
@@ -1825,7 +2146,7 @@ GT_MetaTileEntity_MultiBlockBase {
@SuppressWarnings("rawtypes")
public boolean isThisHatchMultiDynamo(Object aMetaTileEntity){
- Class mDynamoClass;
+ Class<?> mDynamoClass;
mDynamoClass = ReflectionUtils.getClass("com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti");
if (mDynamoClass != null){
if (mDynamoClass.isInstance(aMetaTileEntity)){
@@ -1864,20 +2185,16 @@ GT_MetaTileEntity_MultiBlockBase {
}
}
- private static Method calculatePollutionReduction;
+ private static Method calculatePollutionReduction = null;
public int calculatePollutionReductionForHatch(GT_MetaTileEntity_Hatch_Muffler i , int g) {
- if (calculatePollutionReduction == null) {
+ if (calculatePollutionReduction != null) {
try {
- calculatePollutionReduction = i.getClass().getDeclaredMethod("calculatePollutionReduction", int.class);
- } catch (NoSuchMethodException | SecurityException e) {
- calculatePollutionReduction = null;
+ return (int) calculatePollutionReduction.invoke(i, g);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+
}
- }
- try {
- return (int) calculatePollutionReduction.invoke(i, g);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- return 0;
}
+ return 0;
}
@Override
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java b/src/Java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java
new file mode 100644
index 0000000000..74655fb744
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java
@@ -0,0 +1,35 @@
+package gtPlusPlus.xmod.gregtech.api.util;
+
+import java.util.HashMap;
+
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraftforge.event.entity.player.ItemTooltipEvent;
+
+public class SpecialBehaviourTooltipHandler {
+
+ private static final HashMap<ItemStack, String> mTooltipCache = new HashMap<ItemStack, String>();
+
+ public static void addTooltipForItem(ItemStack aStack, String aTooltip) {
+ mTooltipCache.put(aStack, aTooltip);
+ }
+
+ @SubscribeEvent
+ public void onItemTooltip(ItemTooltipEvent event){
+ if (event != null) {
+ if (event.itemStack != null) {
+ for (ItemStack aKey : mTooltipCache.keySet()) {
+ if (GT_Utility.areStacksEqual(aKey, event.itemStack, false)) {
+ String s = mTooltipCache.get(aKey);
+ if (s != null && s.length() > 0) {
+ event.toolTip.add(EnumChatFormatting.RED+s);
+ }
+ }
+ }
+ }
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Boulder.java b/src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Boulder.java
index c8a7b5119d..ca78a72e04 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Boulder.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Boulder.java
@@ -3,6 +3,7 @@ package gtPlusPlus.xmod.gregtech.api.world;
import java.util.Collection;
import java.util.Random;
+import gtPlusPlus.core.lib.CORE;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.util.MathHelper;
@@ -21,7 +22,7 @@ public class GTPP_Worldgen_Boulder extends GTPP_Worldgen_Ore {
int tX = aChunkX + aRandom.nextInt(16), tY = mMinY + aRandom.nextInt(mMaxY - mMinY), tZ = aChunkZ + aRandom.nextInt(16);
Block tBlock = aWorld.getBlock(tX, tY - 7, tZ);
if (tBlock != null && tBlock.isOpaqueCube() && aWorld.getBlock(tX, tY - 6, tZ).isAir(aWorld, tX, tY - 6, tZ)) {
- float math_pi = 3.141593F;
+ float math_pi = CORE.PI;
float var6 = aRandom.nextFloat() * math_pi;
float var1b = mSize / 8.0F;
float var3b = MathHelper.sin(var6) * var1b; float var4b = MathHelper.cos(var6) * var1b;
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore_Normal.java b/src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore_Normal.java
index 9d7eb5a020..e66106ad4a 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore_Normal.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore_Normal.java
@@ -3,6 +3,7 @@ package gtPlusPlus.xmod.gregtech.api.world;
import java.util.Collection;
import java.util.Random;
+import gtPlusPlus.core.lib.CORE;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.util.MathHelper;
@@ -20,7 +21,7 @@ public class GTPP_Worldgen_Ore_Normal extends GTPP_Worldgen_Ore {
for (int i = 0; i < mAmount; i++) {
int tX = aChunkX + aRandom.nextInt(16), tY = mMinY + aRandom.nextInt(mMaxY - mMinY), tZ = aChunkZ + aRandom.nextInt(16);
if (mAllowToGenerateinVoid || aWorld.getBlock(tX, tY, tZ).isAir(aWorld, tX, tY, tZ)) {
- float math_pi = 3.141593F;float var1b = mSize / 8.0F;
+ float math_pi = CORE.PI;float var1b = mSize / 8.0F;
float var6 = aRandom.nextFloat() * math_pi;
float var3b = MathHelper.sin(var6) * var1b; float var4b = MathHelper.cos(var6) * var1b;
float var8b = -2*var3b;float var9b = -2*var4b;
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 629c584f70..430ae44d64 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java
@@ -13,10 +13,12 @@ import java.util.Timer;
import java.util.TimerTask;
import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.BaseMetaTileEntity;
@@ -32,13 +34,17 @@ import gtPlusPlus.api.objects.minecraft.FormattedTooltipString;
import gtPlusPlus.core.handler.AchievementHandler;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.ELEMENT;
-import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.FluidUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.minecraft.LangUtils;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
+import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.BaseCustomTileEntity;
import gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power.BaseCustomPower_MTE;
import gtPlusPlus.xmod.gregtech.common.covers.CoverManager;
+import ic2.core.init.BlocksItems;
+import ic2.core.init.InternalName;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
@@ -46,84 +52,172 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumChatFormatting;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
public class Meta_GT_Proxy {
static {
- instance = new Meta_GT_Proxy();
Logger.INFO("GT_PROXY - initialized.");
}
-
- public static final Meta_GT_Proxy instance;
-
+
public static List<Runnable> GT_BlockIconload = new ArrayList<>();
public static List<Runnable> GT_ItemIconload = new ArrayList<>();
-
+
public static AutoMap<Integer> GT_ValidHeatingCoilMetas = new AutoMap<Integer>();
- private static Class sBaseMetaTileEntityClass;
- private static Class sBaseMetaTileEntityClass2;
-
+ private static Class<BaseCustomTileEntity> sBaseMetaTileEntityClass;
+ private static Class<BaseCustomPower_MTE> sBaseMetaTileEntityClass2;
+
public static AchievementHandler mAssemblyAchievements;
-
+
public static final Map<String, FormattedTooltipString> mCustomGregtechMetaTooltips = new LinkedHashMap<String, FormattedTooltipString>();
-
+
@SideOnly(Side.CLIENT)
public static IIconRegister sBlockIcons, sItemIcons;
public Meta_GT_Proxy() {
-
+
}
-
+
public static Block sBlockMachines;
-
- public void preInit() {
-
+
+ public static void preInit() {
+
//New GT++ Block, yay! (Progress)
//sBlockMachines = new GTPP_Block_Machines();
-
- GT_Log.out.println("GT++ Mod: Register TileEntities.");
- BaseMetaTileEntity tBaseMetaTileEntity = constructBaseMetaTileEntity();
- BaseMetaTileEntity tBaseMetaTileEntity2 = constructBaseMetaTileEntityCustomPower();
-
- GT_Log.out.println("GT++ Mod: Testing BaseMetaTileEntity.");
- if (tBaseMetaTileEntity == null || tBaseMetaTileEntity2 == null) {
- GT_Log.out.println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
- throw new RuntimeException("");
- }
-
- //Gotta set it here so that we don't try call gregtech too early.
- //Must set on the correct side
-
- if (ReflectionUtils.doesFieldExist(GT_Proxy.class, "gt6Pipe")) {
- StaticFields59.mGT6StylePipes = (boolean) StaticFields59.getFieldFromGregtechProxy("gt6Pipe");
- }
- else {
- StaticFields59.mGT6StylePipes = false;
- }
-
- GT_Log.out.println("GT++ Mod: Registering the BaseMetaTileEntity.");
- GameRegistry.registerTileEntity(tBaseMetaTileEntity.getClass(), "BaseMetaTileEntity_GTPP");
- GameRegistry.registerTileEntity(tBaseMetaTileEntity2.getClass(), "BaseMetaTileEntity_GTPP2");
- CoverManager.generateCustomCovers();
+ fixIC2FluidNames();
+
+ GT_Log.out.println("GT++ Mod: Register TileEntities.");
+ BaseMetaTileEntity tBaseMetaTileEntity = constructBaseMetaTileEntity();
+ BaseMetaTileEntity tBaseMetaTileEntity2 = constructBaseMetaTileEntityCustomPower();
+
+ GT_Log.out.println("GT++ Mod: Testing BaseMetaTileEntity.");
+ if (tBaseMetaTileEntity == null || tBaseMetaTileEntity2 == null) {
+ GT_Log.out.println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
+ throw new RuntimeException("");
+ }
+
+ //Gotta set it here so that we don't try call gregtech too early.
+ //Must set on the correct side
+
+ if (ReflectionUtils.doesFieldExist(GT_Proxy.class, "gt6Pipe")) {
+ StaticFields59.mGT6StylePipes = (boolean) StaticFields59.getFieldFromGregtechProxy("gt6Pipe");
+ }
+ else {
+ StaticFields59.mGT6StylePipes = false;
+ }
+
+ GT_Log.out.println("GT++ Mod: Registering the BaseMetaTileEntity.");
+ GameRegistry.registerTileEntity(tBaseMetaTileEntity.getClass(), "BaseMetaTileEntity_GTPP");
+ GameRegistry.registerTileEntity(tBaseMetaTileEntity2.getClass(), "BaseMetaTileEntity_GTPP2");
+ CoverManager.generateCustomCovers();
}
-
- public void init() {
+
+ public static void init() {
scheduleCoverMapCleaner();
setValidHeatingCoilMetas();
+ PollutionUtils.setPollutionFluids();
+ fixIC2FluidNames();
+ }
+
+ public static void postInit() {
+ mAssemblyAchievements = new AchievementHandler();
+ fixIC2FluidNames();
}
-
- public void postInit() {
- mAssemblyAchievements = new AchievementHandler();
+
+ @SuppressWarnings("deprecation")
+ public static void fixIC2FluidNames() {
+ //Fix IC2 Hot Water name
+ try {
+ String aNewHeatedWaterName = "Heated Water";
+ Logger.INFO("Renaming [IC2 Hotspring Water] --> ["+aNewHeatedWaterName+"].");LanguageRegistry.instance().addStringLocalization("fluidHotWater", "Heated Water");
+ LanguageRegistry.instance().addStringLocalization("fluidHotWater", aNewHeatedWaterName);
+ LanguageRegistry.instance().addStringLocalization("ic2.fluidHotWater", aNewHeatedWaterName);
+ GT_LanguageManager.addStringLocalization("fluidHotWater", aNewHeatedWaterName);
+ GT_LanguageManager.addStringLocalization("ic2.fluidHotWater", aNewHeatedWaterName);
+
+ Block b = BlocksItems.getFluidBlock(InternalName.fluidHotWater);
+ if (b != null) {
+ LanguageRegistry.addName(ItemUtils.getSimpleStack(b), aNewHeatedWaterName);
+ LanguageRegistry.instance().addStringLocalization(b.getUnlocalizedName(), aNewHeatedWaterName);
+ GT_LanguageManager.addStringLocalization(b.getUnlocalizedName(), aNewHeatedWaterName);
+ }
+ Fluid f = BlocksItems.getFluid(InternalName.fluidHotWater);
+ if (f != null) {
+ LanguageRegistry.instance().addStringLocalization(f.getUnlocalizedName(), aNewHeatedWaterName);
+ GT_LanguageManager.addStringLocalization(f.getUnlocalizedName(), aNewHeatedWaterName);
+ int aDam = FluidRegistry.getFluidID(f);
+ ItemStack s = ItemList.Display_Fluid.getWithDamage(1, aDam);
+ if (s != null) {
+ LanguageRegistry.addName(s, aNewHeatedWaterName);
+ }
+ }
+
+ String[] aLangs = new String[] {
+ "de_DE",
+ "en_US",
+ "en_GB",
+ "en_IC",
+ "es_AR",
+ "es_ES",
+ "es_MX",
+ "es_UY",
+ "es_VE",
+ "fr_CA",
+ "fr_FR",
+ "it_IT",
+ "ko_KR",
+ "pt_BR",
+ "pt_PT",
+ "ru_RU",
+ "sv_SE",
+ "tr_TR",
+ "zh_CN",
+ "zh_TW",
+ };
+ String[] aLangValues = new String[] {
+ "Erhitztes Wasser",
+ "Heated Water",
+ "Heated Water",
+ "Heated Water",
+ "Agua caliente",
+ "Agua caliente",
+ "Agua caliente",
+ "Agua caliente",
+ "Agua caliente",
+ "Eau chauffée",
+ "Eau chauffée",
+ "Acqua riscaldata",
+ "온수",
+ "Água aquecida",
+ "Água aquecida",
+ "Вода с подогревом",
+ "Uppvärmt vatten",
+ "Isıtılmış Su",
+ "热水",
+ "热水",
+
+ };
+ for (int i=0;i<aLangs.length;i++) {
+ Logger.REFLECTION("Trying to inject new lang data for "+aLangs[i]+", using value: "+aLangValues[i]);
+ LangUtils.rewriteEntryForLanguageRegistry(aLangs[i], "fluidHotWater", aLangValues[i]);
+ LangUtils.rewriteEntryForLanguageRegistry(aLangs[i], "ic2.fluidHotWater", aLangValues[i]);
+ }
+ }
+
+ catch (Throwable t) {
+
+ }
}
-
+
public static boolean generatePlasmaRecipesForAdvVacFreezer() {
-
+
AutoMap<Recipe_GT> aFreezerMapRebaked = new AutoMap<Recipe_GT>();
AutoMap<Recipe_GT> aRemovedRecipes = new AutoMap<Recipe_GT>();
-
+
//Find recipes containing Plasma and map them
for (Recipe_GT y : Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList) {
if (y.mFluidInputs.length > 0) {
@@ -136,20 +230,20 @@ public class Meta_GT_Proxy {
aFreezerMapRebaked.put(y);
}
}
-
+
AutoMap<Recipe_GT> aNewRecipes = new AutoMap<Recipe_GT>();
int aAtomicMass = 0;
int aAtomicTier = 0;
-
+
final FluidStack NULL_PLASMA = Materials._NULL.getPlasma(1);
-
+
for (String s : ELEMENT.NAMES) {
-
+
aAtomicMass++;
aAtomicTier = (aAtomicMass/30)+1;
FluidStack aMoltenFluid = null;
FluidStack aPlasma = null;
-
+
//Try Get Material via Gregtech
Materials aGregMaterial = MaterialUtils.getMaterial(s);
if (aGregMaterial != null) {
@@ -165,7 +259,7 @@ public class Meta_GT_Proxy {
}
aPlasma = aGregMaterial.getPlasma(100);
}
-
+
//Just wildcard values
if (aMoltenFluid == null || aPlasma == null) {
if (aMoltenFluid == null) {
@@ -175,7 +269,7 @@ public class Meta_GT_Proxy {
aPlasma = FluidUtils.getFluidStack("plasma."+s.toLowerCase(), 1);
}
}
-
+
//Skip this material
if (aMoltenFluid == null || aPlasma == null || aPlasma.isFluidEqual(NULL_PLASMA)) {
Logger.INFO("Could not generate Advanced Vacuum Freezer recipe. Cooling "+s+" plasma. Molten Form Exists? "+(aMoltenFluid != null)+" | Plasma Exists? "+(aPlasma != null));
@@ -190,49 +284,49 @@ public class Meta_GT_Proxy {
null,
new int[] {10000},
new FluidStack[] {
- aPlasma,
- FluidUtils.getFluidStack("cryotheum", aTotalTickTime)
- },
+ aPlasma,
+ FluidUtils.getFluidStack("cryotheum", aTotalTickTime)
+ },
new FluidStack[] {
- aMoltenFluid
- },
+ aMoltenFluid
+ },
aTotalTickTime,
(int) GT_Values.V[4+aAtomicTier],
aAtomicMass);
-
+
//Add it to the map if it's valid
if (aTempRecipe != null) {
aNewRecipes.put(aTempRecipe);
}
}
-
+
}
-
+
//Add the new recipes to the map we will rebake over the original
for (Recipe_GT w : aNewRecipes) {
aFreezerMapRebaked.put(w);
}
-
+
//Best not touch the original map if we don't have a valid map to override it with.
if (aFreezerMapRebaked.size() > 0) {
-
+
int aOriginalCount = Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList.size();
-
+
//Empty the original map
Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList.clear();
-
+
//Rebake the real map
for (Recipe_GT w : aFreezerMapRebaked) {
Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList.add(w);
}
-
+
return Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList.size() >= aOriginalCount;
}
-
+
return false;
}
-
+
public static TileEntity constructCustomGregtechMetaTileEntityByMeta(int aMeta) {
if (aMeta == 12) {
return Meta_GT_Proxy.constructBaseMetaTileEntityCustomPower();
@@ -241,7 +335,7 @@ public class Meta_GT_Proxy {
return Meta_GT_Proxy.constructBaseMetaTileEntity();
}
}
-
+
public static BaseCustomTileEntity constructBaseMetaTileEntity() {
if (sBaseMetaTileEntityClass == null) {
try {
@@ -268,7 +362,7 @@ public class Meta_GT_Proxy {
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException
| InvocationTargetException | SecurityException e) {
GT_Log.err
- .println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
+ .println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
e.printStackTrace(GT_Log.err);
throw new RuntimeException(e);
}
@@ -303,21 +397,21 @@ public class Meta_GT_Proxy {
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException
| InvocationTargetException | SecurityException e) {
GT_Log.err
- .println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
+ .println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
e.printStackTrace(GT_Log.err);
throw new RuntimeException(e);
}
}
}
-
-
-
-
-
-
-
-
- public void setValidHeatingCoilMetas() {
+
+
+
+
+
+
+
+
+ public static void setValidHeatingCoilMetas() {
for (int i = 0; i <= 6; i++ ) {
GT_ValidHeatingCoilMetas.put(i);
}
@@ -340,26 +434,27 @@ public class Meta_GT_Proxy {
return false;
}
}
-
-
- public 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 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");
@@ -379,57 +474,57 @@ public class Meta_GT_Proxy {
}
return aRemoved;
}
-
-
+
+
static GT_Proxy[] mProxies = new GT_Proxy[2];
/**
* @deprecated Use {@link StaticFields59#getFieldFromGregtechProxy(boolean,String)} instead
*/
public static Object getFieldFromGregtechProxy(boolean client, String fieldName) {
- return StaticFields59.getFieldFromGregtechProxy(fieldName);
+ return StaticFields59.getFieldFromGregtechProxy(client, fieldName);
}
-
- public void setCustomGregtechTooltip(String aNbtTagName, FormattedTooltipString aData) {
+
+ public static void setCustomGregtechTooltip(String aNbtTagName, FormattedTooltipString aData) {
mCustomGregtechMetaTooltips.put(aNbtTagName, aData);
}
-
- public static void conStructGtTileBlockTooltip(ItemStack aStack, EntityPlayer aPlayer, List<Object> aList, boolean par4) {
- try {
- int tDamage = aStack.getItemDamage();
- if ((tDamage <= 0) || (tDamage >= GregTech_API.METATILEENTITIES.length)) {
- return;
- }
-
- if (GregTech_API.METATILEENTITIES[tDamage] != null) {
- IGregTechTileEntity tTileEntity = GregTech_API.METATILEENTITIES[tDamage].getBaseMetaTileEntity();
- if (tTileEntity.getDescription() != null) {
- int i = 0;
- for (String tDescription : tTileEntity.getDescription()) {
- if (GT_Utility.isStringValid(tDescription)) {
- if(tDescription.contains("%%%")){
- String[] tString = tDescription.split("%%%");
- if(tString.length>=2){
- StringBuffer tBuffer = new StringBuffer();
- Object tRep[] = new String[tString.length / 2];
- for (int j = 0; j < tString.length; j++)
- if (j % 2 == 0) tBuffer.append(tString[j]);
- else {tBuffer.append(" %s"); tRep[j / 2] = tString[j];}
- aList.add(String.format(GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tBuffer.toString(), !GregTech_API.sPostloadFinished), tRep));
- }
- }else{String tTranslated = GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tDescription, !GregTech_API.sPostloadFinished );
- aList.add(tTranslated.equals("") ? tDescription : tTranslated);}
- }else i++;
- }
- }
-
+
+ public static void conStructGtTileBlockTooltip(ItemStack aStack, EntityPlayer aPlayer, List<Object> aList, boolean par4) {
+ try {
+ int tDamage = aStack.getItemDamage();
+ if ((tDamage <= 0) || (tDamage >= GregTech_API.METATILEENTITIES.length)) {
+ return;
+ }
+
+ if (GregTech_API.METATILEENTITIES[tDamage] != null) {
+ IGregTechTileEntity tTileEntity = GregTech_API.METATILEENTITIES[tDamage].getBaseMetaTileEntity();
+ if (tTileEntity.getDescription() != null) {
+ int i = 0;
+ for (String tDescription : tTileEntity.getDescription()) {
+ if (GT_Utility.isStringValid(tDescription)) {
+ if(tDescription.contains("%%%")){
+ String[] tString = tDescription.split("%%%");
+ if(tString.length>=2){
+ StringBuffer tBuffer = new StringBuffer();
+ Object tRep[] = new String[tString.length / 2];
+ for (int j = 0; j < tString.length; j++)
+ if (j % 2 == 0) tBuffer.append(tString[j]);
+ else {tBuffer.append(" %s"); tRep[j / 2] = tString[j];}
+ aList.add(String.format(GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tBuffer.toString(), !GregTech_API.sPostloadFinished), tRep));
+ }
+ }else{String tTranslated = GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tDescription, !GregTech_API.sPostloadFinished );
+ aList.add(tTranslated.equals("") ? tDescription : tTranslated);}
+ }else i++;
+ }
+ }
+
if (tTileEntity.getEUCapacity() > 0L) {
final long tVoltage = tTileEntity.getInputVoltage();
byte tTier = (byte) ((byte) Math.max(1, GT_Utility.getTier(tVoltage)));
-
+
//Custom handling
if (tDamage < 30500 && tDamage >= 30400) {
int aOffset = tDamage - 30400;
@@ -442,13 +537,13 @@ public class Meta_GT_Proxy {
aList.add(GT_LanguageManager.addStringLocalization("TileEntity_Breaker_Loss", "Breaker Loss: "+EnumChatFormatting.RED+""+(GT_Values.V[Math.max(tTier-1, 0)]/10)+EnumChatFormatting.GRAY+" EU/t", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY);
}
-
+
aList.add(GT_LanguageManager.addStringLocalization("TileEntity_Special_Power_1", EnumChatFormatting.RED+"Special Power Handling, please read manual", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY);
//aList.add(GT_LanguageManager.addStringLocalization("TileEntity_BreakerBox_2", EnumChatFormatting.RED+"Special Power Handling, please read manual", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY);
//aList.add(GT_LanguageManager.addStringLocalization("TileEntity_BreakerBox_3", EnumChatFormatting.RED+"Special Power Handling, please read manual", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY);
}
-
-
+
+
if (tTileEntity.getInputVoltage() > 0L) {
String inA = "0";
if (tTileEntity.getInputAmperage() >= 1L) {
@@ -476,20 +571,20 @@ public class Meta_GT_Proxy {
+ EnumChatFormatting.GRAY + outA;
aList.add(a1);
}
-
+
if (tTileEntity.getOutputVoltage() > 0L) {
aList.add(GT_LanguageManager.addStringLocalization("TileEntity_Lossess_EU", "Transmission Loss: "+EnumChatFormatting.DARK_BLUE+""+(tDamage < 30500 && tDamage >= 30400 ? 0 : 1), !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY);
}
-
+
if (tTileEntity.getEUCapacity() > 0) {
aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE2",
"Internal Capacity: ", !GregTech_API.sPostloadFinished) + EnumChatFormatting.BLUE
+ tTileEntity.getEUCapacity() + EnumChatFormatting.GRAY + " EU");
}
}
-
- /*if (tTileEntity.getEUCapacity() > 0L) {
+
+ /*if (tTileEntity.getEUCapacity() > 0L) {
if (tTileEntity.getInputVoltage() > 0L) {
aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_IN", "Voltage IN: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + tTileEntity.getInputVoltage() + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getInputVoltage())] + ")" + EnumChatFormatting.GRAY);
}
@@ -501,42 +596,42 @@ public class Meta_GT_Proxy {
}
aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE", "Capacity: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.BLUE + tTileEntity.getEUCapacity() + EnumChatFormatting.GRAY);
}*/
-
- }
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- if (aNBT.getBoolean("mMuffler")) {
- aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_MUFFLER", "has Muffler Upgrade", !GregTech_API.sPostloadFinished ));
- }
- if (aNBT.getBoolean("mSteamConverter")) {
- aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMCONVERTER", "has Steam Upgrade", !GregTech_API.sPostloadFinished ));
- }
- int tAmount = 0;
- if ((tAmount = aNBT.getByte("mSteamTanks")) > 0) {
- aList.add(tAmount + " " + GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMTANKS", "Steam Tank Upgrades", !GregTech_API.sPostloadFinished ));
- }
-
- FluidStack afluid = net.minecraftforge.fluids.FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"));
- if (afluid != null) {
- int tFluidAmount = afluid.amount;
- if (tFluidAmount > 0) {
- aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_FLUIDTANK", "Tank Fluid: "+tFluidAmount+"L "+afluid.getLocalizedName()+"", !GregTech_API.sPostloadFinished ));
- }
- }
-
- }
-
- //Add Custom Here
-
- //Add Custom Tooltips
- for (String s : mCustomGregtechMetaTooltips.keySet()) {
- if (aNBT.hasKey(s)) {
- String aTip = mCustomGregtechMetaTooltips.get(s).getTooltip(aNBT.getString(s));
- aList.add(aTip);
- }
- }
-
- //Add GT++ Stuff
+
+ }
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ if (aNBT.getBoolean("mMuffler")) {
+ aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_MUFFLER", "has Muffler Upgrade", !GregTech_API.sPostloadFinished ));
+ }
+ if (aNBT.getBoolean("mSteamConverter")) {
+ aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMCONVERTER", "has Steam Upgrade", !GregTech_API.sPostloadFinished ));
+ }
+ int tAmount = 0;
+ if ((tAmount = aNBT.getByte("mSteamTanks")) > 0) {
+ aList.add(tAmount + " " + GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMTANKS", "Steam Tank Upgrades", !GregTech_API.sPostloadFinished ));
+ }
+
+ FluidStack afluid = net.minecraftforge.fluids.FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"));
+ if (afluid != null) {
+ int tFluidAmount = afluid.amount;
+ if (tFluidAmount > 0) {
+ aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_FLUIDTANK", "Tank Fluid: "+tFluidAmount+"L "+afluid.getLocalizedName()+"", !GregTech_API.sPostloadFinished ));
+ }
+ }
+
+ }
+
+ //Add Custom Here
+
+ //Add Custom Tooltips
+ for (String s : mCustomGregtechMetaTooltips.keySet()) {
+ if (aNBT.hasKey(s)) {
+ String aTip = mCustomGregtechMetaTooltips.get(s).getTooltip(aNBT.getString(s));
+ aList.add(aTip);
+ }
+ }
+
+ //Add GT++ Stuff
if (tDamage >= 30400 && tDamage < 30500) {
aList.add(EnumChatFormatting.UNDERLINE+"Special GT++ Machine");
@@ -544,11 +639,11 @@ public class Meta_GT_Proxy {
if ((tDamage >= 750 && tDamage < 1000) || (tDamage >= 30000 && tDamage < 31000)) {
aList.add(CORE.GT_Tooltip);
}
-
-
- } catch (Throwable e) {
- e.printStackTrace(GT_Log.err);
- }
- }
+
+
+ } catch (Throwable e) {
+ e.printStackTrace(GT_Log.err);
+ }
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java b/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java
index 9c552db3ad..814ed589f0 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java
@@ -18,6 +18,7 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.common.GT_Proxy;
import gtPlusPlus.api.objects.Logger;
@@ -37,6 +38,7 @@ public class StaticFields59 {
public static final Field mPreventableComponents;
public static final Field mDisabledItems;
public static final Field mMultiblockChemicalRecipes;
+ public static final Field mPyrolyseRecipes;
public static final Field mDescriptionArray;
public static final Field mCasingTexturePages;
public static final Field mAssLineVisualMapNEI;
@@ -79,8 +81,16 @@ public class StaticFields59 {
}
sAssemblylineVisualRecipes = aTemp;
+
mMultiblockChemicalRecipes = getField(GT_Recipe_Map.class, "sMultiblockChemicalRecipes");
- Logger.INFO("[SH] Got Field: sMultiblockChemicalRecipes");
+ Logger.INFO("[SH] Got Field: sMultiblockChemicalRecipes");
+ if (ReflectionUtils.doesFieldExist(GT_Recipe.GT_Recipe_Map.class, "sPyrolyseRecipes")) {
+ mPyrolyseRecipes = getField(GT_Recipe_Map.class, "sPyrolyseRecipes");
+ Logger.INFO("[SH] Got Field: sPyrolyseRecipes");
+ }
+ else {
+ mPyrolyseRecipes = null;
+ }
mCalculatePollutionReduction = getMethod(GT_MetaTileEntity_Hatch_Muffler.class, "calculatePollutionReduction",
int.class);
@@ -148,6 +158,14 @@ public class StaticFields59 {
}
}
+ public static synchronized final GT_Recipe_Map getPyrolyseRecipeMap() {
+ try {
+ return mPyrolyseRecipes != null ? (GT_Recipe_Map) mPyrolyseRecipes.get(null) : null;
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ return null;
+ }
+ }
+
public static Materials getMaterial(String aMaterialName) {
Materials m = mMaterialCache.get(aMaterialName);
if (m != null) {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java
index c62d47e904..01f655c355 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java
@@ -15,13 +15,13 @@ import gregtech.api.items.GT_Generic_Block;
import gregtech.api.metatileentity.BaseMetaPipeEntity;
import gregtech.api.metatileentity.BaseMetaTileEntity;
import gregtech.api.metatileentity.BaseTileEntity;
-import gregtech.api.objects.XSTR;
import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_Utility;
import gregtech.common.blocks.GT_Item_Machines;
import gregtech.common.blocks.GT_Material_Machines;
import gregtech.common.render.GT_Renderer_Block;
import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.random.XSTR;
import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
import gtPlusPlus.xmod.gregtech.common.render.GTPP_Render_MachineBlock;
import net.minecraft.block.Block;
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java
index 4c534eb7bb..8e6a55c9c5 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java
@@ -66,6 +66,7 @@ extends GregtechMetaCasingBlocksAbstract {
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Volcanus Casing");
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "Fusion Machine Casing MK III");
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Advanced Fusion Coil");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", "Unnamed");
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Containment Casing");
GregtechItemList.Casing_FishPond.set(new ItemStack(this, 1, 0));
GregtechItemList.Casing_Extruder.set(new ItemStack(this, 1, 1));
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java
index 321ab43134..b624649789 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java
@@ -138,7 +138,7 @@ extends GregtechMetaCasingBlocksAbstract {
return TexturesGtBlock.Casing_Material_RedSteel.getIcon();
case 15:
default:
- return TexturesGtBlock.Overlay_UU_Matter.getIcon();
+ return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon();
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java
index 09f3f2d1f5..6cac1fddea 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java
@@ -350,8 +350,13 @@ public class TexturesGtBlock {
private static final CustomIcon Internal_Overlay_Machine_Controller_Advanced_Active = new CustomIcon("iconsets/OVERLAY_FRONT_ADVANCED_MULTIBLOCK_ANIMATED_ACTIVE");
public static final CustomIcon Overlay_Machine_Controller_Advanced_Active = Internal_Overlay_Machine_Controller_Advanced_Active;
-
-
+ //Fluid Reactor Overlays
+ public static final CustomIcon Overlay_FluidReactor_Front = new CustomIcon("TileEntities/FluidReactor/OVERLAY_FRONT");
+ public static final CustomIcon Overlay_FluidReactor_Side = new CustomIcon("TileEntities/FluidReactor/OVERLAY_SIDE");
+ public static final CustomIcon Overlay_FluidReactor_Top = new CustomIcon("TileEntities/FluidReactor/OVERLAY_TOP");
+ public static final CustomIcon Overlay_FluidReactor_Front_Active = new CustomIcon("TileEntities/FluidReactor/OVERLAY_FRONT_ACTIVE");
+ public static final CustomIcon Overlay_FluidReactor_Side_Active = new CustomIcon("TileEntities/FluidReactor/OVERLAY_SIDE_ACTIVE");
+ public static final CustomIcon Overlay_FluidReactor_Top_Active = new CustomIcon("TileEntities/FluidReactor/OVERLAY_TOP_ACTIVE");
//Crafting Overlays
private static final CustomIcon Internal_Overlay_Crafting_Bronze = new CustomIcon("TileEntities/bronze_top_crafting");
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java b/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java
index 561da54ceb..65b59ce151 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java
@@ -9,6 +9,7 @@ import gregtech.api.util.GT_CoverBehavior;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.minecraft.BlockPos;
import gtPlusPlus.api.objects.random.XSTR;
+import gtPlusPlus.core.util.minecraft.LangUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -37,7 +38,7 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior {
public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
EntityPlayer aPlayer, float aX, float aY, float aZ) {
- PlayerUtils.messagePlayer(aPlayer, this.trans("756", "Connectable: ") + getConnectionState(aCoverVariable));
+ PlayerUtils.messagePlayer(aPlayer, LangUtils.trans("756", "Connectable: ") + getConnectionState(aCoverVariable));
return super.onCoverRightclick(aSide, aCoverID, aCoverVariable, aTileEntity, aPlayer, aX, aY, aZ);
}
@@ -71,7 +72,7 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior {
}
public String getDescription(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return this.trans("756", "Connectable: ") + getConnectionState(aCoverVariable);
+ return LangUtils.trans("756", "Connectable: ") + getConnectionState(aCoverVariable);
}
public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/GT_MethodHelper.java b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/GT_MethodHelper.java
new file mode 100644
index 0000000000..d51107bbf0
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/GT_MethodHelper.java
@@ -0,0 +1,80 @@
+package gtPlusPlus.xmod.gregtech.common.helpers;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.metatileentity.BaseMetaTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import net.minecraft.block.Block;
+import net.minecraft.tileentity.TileEntity;
+
+public class GT_MethodHelper {
+
+ private static final Method mGetTexture;
+ private static final Class mITexturedTileEntity;
+
+ static {
+ Class clazz = null;
+ Method aMeth = null;
+ if (ReflectionUtils.doesClassExist("gregtech.api.interfaces.tileentity.ITexturedTileEntity")) {
+ clazz = ReflectionUtils.getClass("gregtech.api.interfaces.tileentity.ITexturedTileEntity");
+ aMeth = ReflectionUtils.getMethod(clazz, "getTexture", Block.class, byte.class);
+ }
+ mITexturedTileEntity = clazz;
+ mGetTexture = aMeth;
+ }
+
+
+ public static ITexture[] getTexture(TileEntity tTileEntity, Block aBlock, byte aSide) {
+
+ if (mITexturedTileEntity.isInstance(tTileEntity)) {
+
+ if (mGetTexture != null) {
+ try {
+ mGetTexture.invoke(tTileEntity, aBlock, aSide);
+ }
+ catch (IllegalAccessException | IllegalArgumentException
+ | InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
+ else {
+ if (tTileEntity instanceof BaseMetaTileEntity) {
+ try {
+ BaseMetaTileEntity aTile = (BaseMetaTileEntity) tTileEntity;
+ ITexture rIcon = aTile.getCoverTexture(aSide);
+ Field aFacing = ReflectionUtils.getField(BaseMetaTileEntity.class, "mFacing");
+ Field aColor = ReflectionUtils.getField(BaseMetaTileEntity.class, "mColor");
+ Field aActive = ReflectionUtils.getField(BaseMetaTileEntity.class, "mActive");
+ Field aMetaTile = ReflectionUtils.getField(BaseMetaTileEntity.class, "mMetaTileEntity");
+ Method aHasValidTile = ReflectionUtils.getMethod(BaseMetaTileEntity.class, "hasValidMetaTileEntity", new Class[] {});
+
+ boolean hasValidTileObj = (boolean) aHasValidTile.invoke(aTile, new Object[] {});
+ boolean aActiveObj = aActive.getBoolean(aTile);
+ byte aFacingObj = aFacing.getByte(aTile);
+ byte aColorObj = aColor.getByte(aTile);;
+ MetaTileEntity aMetaTileObj = (MetaTileEntity) aMetaTile.get(aTile);
+
+ if (rIcon != null) {
+ return new ITexture[]{rIcon};
+ } else {
+ return hasValidTileObj
+ ? aMetaTileObj.getTexture(aTile, aSide, aFacingObj, (byte) (aColorObj - 1), aActiveObj,
+ aTile.getOutputRedstoneSignal(aSide) > 0)
+ : BlockIcons.ERROR_RENDERING;
+ }
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+ }
+ }
+ return BlockIcons.ERROR_RENDERING;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java
index 4038d5bdf4..8b3fb9a42f 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java
@@ -297,7 +297,7 @@ public class TreeFarmHelper {
return true;
}
else if (aStack.getUnlocalizedName().toLowerCase().contains("mu-metaitem")) {
- String[] aData = aStack.getUnlocalizedName().toLowerCase().split(".");
+ String[] aData = aStack.getUnlocalizedName().toLowerCase().split("//.");
if (aData != null && aData.length > 0) {
for (String s : aData) {
if (s.contains("32120")) {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java
index 8add5d5a6e..bc11cb6a11 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java
@@ -1,10 +1,14 @@
package gtPlusPlus.xmod.gregtech.common.items;
+import java.lang.reflect.Field;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.TC_Aspects;
import gregtech.api.enums.ToolDictNames;
import gregtech.api.items.GT_MetaGenerated_Tool;
-import gregtech.common.tools.GT_Tool_WireCutter;
+import gregtech.api.objects.GT_HashSet;
+import gregtech.api.objects.GT_ItemStack;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechToolDictNames;
import gtPlusPlus.xmod.gregtech.common.tools.TOOL_Gregtech_AngelGrinder;
import gtPlusPlus.xmod.gregtech.common.tools.TOOL_Gregtech_Choocher;
@@ -20,10 +24,18 @@ public class MetaGeneratedGregtechTools extends GT_MetaGenerated_Tool {
public static final short ANGLE_GRINDER = 7834;
public static final short ELECTRIC_SNIPS = 7934;
public static GT_MetaGenerated_Tool INSTANCE;
+
+ static {
+ INSTANCE = new MetaGeneratedGregtechTools();
+ }
+
+ public static GT_MetaGenerated_Tool getInstance() {
+ return INSTANCE;
+ }
+
- public MetaGeneratedGregtechTools() {
+ private MetaGeneratedGregtechTools() {
super("plusplus.metatool.01");
- INSTANCE = this;
// Skookum Choocher
GregTech_API.registerTool(this.addTool(SKOOKUM_CHOOCHER, "Skookum Choocher",
"Can Really Chooch. Does a Skookum job at Hammering and Wrenching stuff.", new TOOL_Gregtech_Choocher(),
@@ -41,6 +53,23 @@ public class MetaGeneratedGregtechTools extends GT_MetaGenerated_Tool {
new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L),
new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L) });
+ GT_HashSet<GT_ItemStack> aWireCutterList = new GT_HashSet<GT_ItemStack>();
+ //Does not exist prior to 5.09.32, use an empty field if we can't find the existing one.
+ if (ReflectionUtils.doesFieldExist(GregTech_API.class, "sWireCutterList")) {
+ Field sWireCutterList = ReflectionUtils.getField(GregTech_API.class, "sWireCutterList");
+ try {
+ if (sWireCutterList != null) {
+ Object val = sWireCutterList.get(null);
+ if (val != null && val instanceof GT_HashSet) {
+ aWireCutterList = (GT_HashSet<GT_ItemStack>) val;
+ }
+ }
+
+ }
+ catch (IllegalArgumentException | IllegalAccessException e) {
+ // Not found, so it's GT 5.09.31 or earlier.
+ }
+ }
// Electric Wire Cutter
GregTech_API.registerTool(
@@ -49,7 +78,7 @@ public class MetaGeneratedGregtechTools extends GT_MetaGenerated_Tool {
new Object[] { GregtechToolDictNames.craftingToolElectricSnips, ToolDictNames.craftingToolWireCutter,
new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 4L),
new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 4L),
- new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 4L) }), GregTech_API.sWireCutterList);
+ new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 4L) }), aWireCutterList);
// Electric Lighter
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java
index 763a4a129d..6201a782de 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java
@@ -63,7 +63,6 @@ public class GTPP_CapeRenderer extends RenderPlayer {
private final ArrayList<String> mData;
public GTPP_CapeRenderer() {
- setRenderManager(RenderManager.instance);
downloadCapeList();
ArrayList<String> aTemp = new ArrayList<String>();
try {
@@ -76,10 +75,19 @@ public class GTPP_CapeRenderer extends RenderPlayer {
}
private static boolean hasResourceChecked = false;
+ private static boolean hasSetRenderer = false;
private boolean hasCape = false;
private ResourceLocation tResource = null;
public synchronized void receiveRenderSpecialsEvent(RenderPlayerEvent.Specials.Pre aEvent) {
+ if (this.renderManager == null) {
+ hasSetRenderer = false;
+ }
+ if (!hasSetRenderer) {
+ if (RenderManager.instance != null) {
+ setRenderManager(RenderManager.instance);
+ }
+ }
AbstractClientPlayer aPlayer = (AbstractClientPlayer) aEvent.entityPlayer;
if (!ConfigSwitches.enableCustomCapes) {
aEvent.setCanceled(true);
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java
index c884114b79..35d78008c5 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java
@@ -10,10 +10,9 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.interfaces.tileentity.IPipeRenderedTileEntity;
import gregtech.api.interfaces.tileentity.ITexturedTileEntity;
import gregtech.common.blocks.GT_Block_Machines;
-import gregtech.common.blocks.GT_Block_Ores_Abstract;
-import gregtech.common.blocks.GT_TileEntity_Ores;
import gregtech.common.render.GT_Renderer_Block;
import gtPlusPlus.xmod.gregtech.common.blocks.GTPP_Block_Machines;
+import gtPlusPlus.xmod.gregtech.common.helpers.GT_MethodHelper;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
@@ -134,14 +133,15 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block {
public static boolean renderStandardBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock,
RenderBlocks aRenderer) {
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+
return tTileEntity instanceof ITexturedTileEntity
? renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer,
- new ITexture[][]{((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 0),
- ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 1),
- ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 2),
- ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 3),
- ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 4),
- ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 5)})
+ new ITexture[][]{GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 0),
+ GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 1),
+ GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 2),
+ GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 3),
+ GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 4),
+ GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 5)})
: false;
}
@@ -190,7 +190,7 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block {
ITexture[][] tCovers = new ITexture[6][];
for (byte i = 0; i < 6; ++i) {
- tCovers[i] = aTileEntity.getTexture(aBlock, i);
+ tCovers[i] = GT_MethodHelper.getTexture((TileEntity) aTileEntity, aBlock, i);
arg15[i] = aTileEntity.getTextureUncovered(i);
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java
index 1ee27afbf0..2f00600af6 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java
@@ -22,6 +22,7 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import gtPlusPlus.core.util.sys.KeyboardUtils;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon;
import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GregtechMetaEnergyBuffer;
@@ -48,7 +49,7 @@ public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer {
@Override
public String[] getDescription() {
- return new String[] {this.mDescription, "Use Screwdriver to change voltage", EnumChatFormatting.GREEN+"CREATIVE MACHINE"};
+ return new String[] {this.mDescription, "Use Screwdriver to change voltage", "Hold Shift while using Screwdriver to change amperage", EnumChatFormatting.GREEN+"CREATIVE MACHINE"};
}
/*
@@ -177,43 +178,48 @@ public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer {
}
@Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (this.mTier < 9) {
- this.mTier++;
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (KeyboardUtils.isShiftKeyDown()) {
+ super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
}
else {
- this.mTier = 0;
- }
- this.markDirty();
- try {
- Field field = ReflectionUtils.getField(this.getClass(), "mTextures");
- field.setAccessible(true);
- Field modifiersField = Field.class.getDeclaredField("modifiers");
- modifiersField.setAccessible(true);
- modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);
- ITexture[][][] V = getTextureSet(null);
- if (V != null) {
- Logger.REFLECTION("Got Valid Textures.");
- if (this.getBaseMetaTileEntity().isClientSide()) {
- Logger.REFLECTION("Clientside Call.");
- Logger.REFLECTION("Refreshing Textures on buffer.");
- field.set(this, V);
- Logger.REFLECTION("Refreshed Textures on buffer.");
+ if (this.mTier < (CORE.GTNH ? GT_Values.V.length : 9)) {
+ this.mTier++;
+ }
+ else {
+ this.mTier = 0;
+ }
+ this.markDirty();
+ try {
+ Field field = ReflectionUtils.getField(this.getClass(), "mTextures");
+ field.setAccessible(true);
+ Field modifiersField = Field.class.getDeclaredField("modifiers");
+ modifiersField.setAccessible(true);
+ modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);
+ ITexture[][][] V = getTextureSet(null);
+ if (V != null) {
+ Logger.REFLECTION("Got Valid Textures.");
+ if (this.getBaseMetaTileEntity().isClientSide()) {
+ Logger.REFLECTION("Clientside Call.");
+ Logger.REFLECTION("Refreshing Textures on buffer.");
+ field.set(this, V);
+ Logger.REFLECTION("Refreshed Textures on buffer.");
+ }
+ else {
+ Logger.REFLECTION("Serverside Call.");
+ }
}
else {
- Logger.REFLECTION("Serverside Call.");
- }
+ Logger.REFLECTION("Bad mTextures setter.");
+ }
}
- else {
- Logger.REFLECTION("Bad mTextures setter.");
- }
- }
- catch (Throwable t) {
- //Bad refresh.
- t.printStackTrace();
- Logger.REFLECTION("Bad mTextures setter.");
- }
- PlayerUtils.messagePlayer(aPlayer, "Now running at "+GT_Values.VOLTAGE_NAMES[this.mTier]+". ["+MathUtils.isNumberEven(this.mTier)+"]");
- super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
+ catch (Throwable t) {
+ //Bad refresh.
+ t.printStackTrace();
+ Logger.REFLECTION("Bad mTextures setter.");
+ }
+ PlayerUtils.messagePlayer(aPlayer, "Now running at "+GT_Values.VOLTAGE_NAMES[this.mTier]+".");
+ }
+
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java
index 4795b0d0b9..10a1f96be7 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java
@@ -710,8 +710,17 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi
catch (Throwable t) {
aTooltipSuper.put("Maximum pollution removed per second: "+mPollutionReduction);
}
- aTooltipSuper.put("Air Sides: "+mAirSides);
- return aTooltipSuper.toArray();
+ aTooltipSuper.put("Air Sides: "+mAirSides);
+
+ String[] mBuiltOutput = new String[aTooltipSuper.size()];
+ int aIndex = 0;
+ for (String i : aTooltipSuper) {
+ mBuiltOutput[aIndex++] = i;
+ }
+
+
+
+ return mBuiltOutput;
}
@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
new file mode 100644
index 0000000000..b7e4618e07
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java
@@ -0,0 +1,688 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic;
+
+import static gregtech.api.enums.GT_Values.E;
+
+import java.util.HashSet;
+import java.util.List;
+
+import cpw.mods.fml.common.registry.LanguageRegistry;
+import gregtech.GT_Mod;
+import gregtech.api.GregTech_API;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.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 gtPlusPlus.api.objects.random.XSTR;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.slots.SlotChemicalPlantInput;
+import gtPlusPlus.xmod.gregtech.api.gui.fluidreactor.Container_FluidReactor;
+import gtPlusPlus.xmod.gregtech.api.gui.fluidreactor.GUI_FluidReactor;
+import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
+import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.FluidTankInfo;
+import net.minecraftforge.fluids.IFluidHandler;
+
+public class GregtechMetaTileEntity_ChemicalReactor extends GT_MetaTileEntity_BasicMachine {
+
+ public boolean mFluidTransfer_1 = false;
+ public boolean mFluidTransfer_2 = false;
+
+ 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", "",
+ new ITexture[]{
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Side_Active),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Side),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Front_Active),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Front),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top_Active),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top_Active),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top)
+ }
+ );
+ }
+
+ public GregtechMetaTileEntity_ChemicalReactor(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
+ }
+
+ /*public GregtechMetaTileEntity_BasicWasher(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
+ }*/
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{this.mDescription, "Because why not?", };
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ try {
+ GregtechMetaTileEntity_ChemicalReactor y = new GregtechMetaTileEntity_ChemicalReactor(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ return y;
+ }
+ catch(Throwable t) {
+ t.printStackTrace();
+ }
+ return null;
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ try {
+ Container_FluidReactor y = new Container_FluidReactor(aPlayerInventory, aBaseMetaTileEntity);
+ return y;
+ }
+ catch(Throwable t) {
+ t.printStackTrace();
+ }
+ return null;
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_FluidReactor(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(),
+ this.mGUIName,
+ GT_Utility.isStringValid(this.mNEIName)
+ ? this.mNEIName
+ : (this.getRecipeList() != null ? this.getRecipeList().mUnlocalizedName : ""));
+ }
+
+ @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;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack));
+ }
+
+ @Override
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return (super.isFluidInputAllowed(aFluid));
+ }
+
+ @Override
+ public int getCapacity() {
+ return 32000 * Math.max(1, this.mTier) / 4;
+ }
+
+ @Override
+ public int getInputSlot() {
+ return 3;
+ }
+
+ @Override
+ public boolean isLiquidInput(byte aSide) {
+ return aSide > 1;
+ }
+
+ @Override
+ public boolean isLiquidOutput(byte aSide) {
+ return aSide < 2;
+ }
+
+ @Override
+ public int getOutputSlot() {
+ return super.getOutputSlot();
+ }
+
+ @Override
+ public int getStackDisplaySlot() {
+ return super.getStackDisplaySlot();
+ }
+
+ @Override
+ public boolean doesEmptyContainers() {
+ return true;
+ }
+
+ @Override
+ public boolean canTankBeFilled() {
+ return super.canTankBeFilled();
+ }
+
+ @Override
+ public boolean canTankBeEmptied() {
+ return super.canTankBeEmptied();
+ }
+
+ @Override
+ public FluidStack getDisplayedFluid() {
+ return super.getDisplayedFluid();
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setBoolean("mFluidTransfer_1", mFluidTransfer_1);
+ aNBT.setBoolean("mFluidTransfer_2", mFluidTransfer_2);
+ for (int i=0;i<4;i++) {
+ if (this.mInputFluids[i] != null) {
+ aNBT.setTag("mInputFluid"+i, this.mInputFluids[i].writeToNBT(new NBTTagCompound()));
+ }
+ }
+ for (int i=0;i<2;i++) {
+ if (this.mOutputFluids[i] != null) {
+ aNBT.setTag("mOutputFluid"+i, this.mOutputFluids[i].writeToNBT(new NBTTagCompound()));
+ }
+ }
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ mFluidTransfer_1 = aNBT.getBoolean("mFluidTransfer_1");
+ mFluidTransfer_2 = aNBT.getBoolean("mFluidTransfer_2");
+ for (int i=0;i<4;i++) {
+ if (this.mInputFluids[i] == null) {
+ this.mInputFluids[i] = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mInputFluid"+i));
+ }
+ }
+ for (int i=0;i<2;i++) {
+ if (this.mOutputFluids[i] == null) {
+ this.mOutputFluids[i] = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mOutputFluid"+i));
+ }
+ }
+ }
+
+ /*
+ * Custom Fluid Handling - TODO
+ */
+
+ public FluidStack getFillableStack() {
+ return this.mFluid;
+ }
+
+ public FluidStack setFillableStack(FluidStack aFluid) {
+ this.mFluid = aFluid;
+ return this.mFluid;
+ }
+
+ public FluidStack getDrainableStack() {
+ return this.mFluid;
+ }
+
+ public FluidStack setDrainableStack(FluidStack aFluid) {
+ this.mFluid = aFluid;
+ return this.mFluid;
+ }
+
+
+
+
+
+
+
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ // Re-implement basic machine logic from the ground up.=
+
+ if (aBaseMetaTileEntity.isServerSide()) {
+ this.mCharge = aBaseMetaTileEntity.getStoredEU() / 2L > aBaseMetaTileEntity.getEUCapacity() / 3L;
+ this.mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3L;
+ this.doDisplayThings();
+ boolean tSucceeded = false;
+ int i;
+ if (this.mMaxProgresstime > 0 && (this.mProgresstime >= 0 || aBaseMetaTileEntity.isAllowedToWork())) {
+ aBaseMetaTileEntity.setActive(true);
+ if (this.mProgresstime >= 0 && !this.drainEnergyForProcess((long) this.mEUt)) {
+ if (!this.mStuttering) {
+ this.stutterProcess();
+ if (this.canHaveInsufficientEnergy()) {
+ this.mProgresstime = -100;
+ }
+
+ this.mStuttering = true;
+ }
+ } else {
+ if (++this.mProgresstime >= this.mMaxProgresstime) {
+ for (i = 0; i < this.mOutputItems.length; ++i) {
+ for (i = 0; i < this.mOutputItems.length && !aBaseMetaTileEntity.addStackToSlot(
+ this.getOutputSlot() + (i + i) % this.mOutputItems.length,
+ this.mOutputItems[i]); ++i) {
+ ;
+ }
+ }
+
+ if (this.mOutputFluid != null) {
+ if (this.getDrainableStack() == null) {
+ this.setDrainableStack(this.mOutputFluid.copy());
+ } else if (this.mOutputFluid.isFluidEqual(this.getDrainableStack())) {
+ FluidStack var10000 = this.getDrainableStack();
+ var10000.amount += this.mOutputFluid.amount;
+ }
+ }
+
+ for (i = 0; i < this.mOutputItems.length; ++i) {
+ this.mOutputItems[i] = null;
+ }
+
+ this.mOutputFluid = null;
+ this.mEUt = 0;
+ this.mProgresstime = 0;
+ this.mMaxProgresstime = 0;
+ this.mStuttering = false;
+ tSucceeded = true;
+ this.endProcess();
+ }
+
+ if (this.mProgresstime > 5) {
+ this.mStuttering = false;
+ }
+ }
+ } else {
+ aBaseMetaTileEntity.setActive(false);
+ }
+
+ boolean tRemovedOutputFluid = false;
+ if (this.doesAutoOutputFluids() && this.getDrainableStack() != null
+ && aBaseMetaTileEntity.getFrontFacing() != this.mMainFacing && (tSucceeded || aTick % 20L == 0L)) {
+ IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide(aBaseMetaTileEntity.getFrontFacing());
+ if (tTank != null) {
+ FluidStack tDrained = this.drain(1000, false);
+ if (tDrained != null) {
+ int tFilledAmount = tTank.fill(
+ ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tDrained, false);
+ if (tFilledAmount > 0) {
+ tTank.fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()),
+ this.drain(tFilledAmount, true), true);
+ }
+ }
+ }
+
+ if (this.getDrainableStack() == null) {
+ tRemovedOutputFluid = true;
+ }
+ }
+
+ int j;
+ if (this.doesAutoOutput() && !this.isOutputEmpty()
+ && aBaseMetaTileEntity.getFrontFacing() != this.mMainFacing
+ && (tSucceeded || this.mOutputBlocked % 300 == 1 || aBaseMetaTileEntity.hasInventoryBeenModified()
+ || aTick % 600L == 0L)) {
+ TileEntity tTileEntity2 = aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getFrontFacing());
+ j = 0;
+
+ for (byte tCosts = 1; j < this.mOutputItems.length && tCosts > 0
+ && aBaseMetaTileEntity.isUniversalEnergyStored(128L); ++j) {
+ tCosts = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, tTileEntity2,
+ aBaseMetaTileEntity.getFrontFacing(), aBaseMetaTileEntity.getBackFacing(), (List) null,
+ false, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
+ if (tCosts > 0) {
+ aBaseMetaTileEntity.decreaseStoredEnergyUnits((long) tCosts, true);
+ }
+ }
+ }
+
+ if (this.mOutputBlocked != 0) {
+ if (this.isOutputEmpty()) {
+ this.mOutputBlocked = 0;
+ } else {
+ ++this.mOutputBlocked;
+ }
+ }
+
+ if (this.allowToCheckRecipe()) {
+ if (this.mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork()
+ && (tRemovedOutputFluid || tSucceeded || aBaseMetaTileEntity.hasInventoryBeenModified()
+ || aTick % 600L == 0L || aBaseMetaTileEntity.hasWorkJustBeenEnabled())
+ && this.hasEnoughEnergyToCheckRecipe()) {
+ if (this.checkRecipe() == 2) {
+ if (this.mInventory[3] != null && this.mInventory[3].stackSize <= 0) {
+ this.mInventory[3] = null;
+ }
+
+ i = this.getInputSlot();
+
+ for (j = i + this.mInputSlotCount; i < j; ++i) {
+ if (this.mInventory[i] != null && this.mInventory[i].stackSize <= 0) {
+ this.mInventory[i] = null;
+ }
+ }
+
+ for (i = 0; i < this.mOutputItems.length; ++i) {
+ this.mOutputItems[i] = GT_Utility.copy(new Object[]{this.mOutputItems[i]});
+ if (this.mOutputItems[i] != null && this.mOutputItems[i].stackSize > 64) {
+ this.mOutputItems[i].stackSize = 64;
+ }
+
+ this.mOutputItems[i] = GT_OreDictUnificator.get(true, this.mOutputItems[i]);
+ }
+
+ if (this.mFluid != null && this.mFluid.amount <= 0) {
+ this.mFluid = null;
+ }
+
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ if (GT_Utility.isDebugItem(this.mInventory[this.dechargerSlotStartIndex()])) {
+ this.mEUt = this.mMaxProgresstime = 1;
+ }
+
+ this.startProcess();
+ } else {
+ this.mMaxProgresstime = 0;
+
+ for (i = 0; i < this.mOutputItems.length; ++i) {
+ this.mOutputItems[i] = null;
+ }
+
+ this.mOutputFluid = null;
+ }
+ }
+ } else if (!this.mStuttering) {
+ this.stutterProcess();
+ this.mStuttering = true;
+ }
+ }
+
+
+
+ }
+
+ @Override
+ protected void doDisplayThings() {
+ // TODO Auto-generated method stub
+ super.doDisplayThings();
+ }
+
+ @Override
+ protected ItemStack getSpecialSlot() {
+ // TODO Auto-generated method stub
+ return super.getSpecialSlot();
+ }
+
+ @Override
+ protected ItemStack getOutputAt(int aIndex) {
+ // TODO Auto-generated method stub
+ return super.getOutputAt(aIndex);
+ }
+
+ @Override
+ protected ItemStack[] getAllOutputs() {
+ // TODO Auto-generated method stub
+ return super.getAllOutputs();
+ }
+
+ @Override
+ protected ItemStack getInputAt(int aIndex) {
+ // TODO Auto-generated method stub
+ return super.getInputAt(aIndex);
+ }
+
+ @Override
+ protected ItemStack[] getAllInputs() {
+ // TODO Auto-generated method stub
+ return super.getAllInputs();
+ }
+
+ @Override
+ protected boolean displaysInputFluid() {
+ return true;
+ }
+
+ @Override
+ protected boolean displaysOutputFluid() {
+ return true;
+ }
+
+ @Override
+ public boolean doesAutoOutput() {
+ return super.doesAutoOutput();
+ }
+
+ @Override
+ public boolean doesAutoOutputFluids() {
+ return this.mFluidTransfer_1 && this.mFluidTransfer_2;
+ }
+
+ @Override
+ public void startProcess() {
+ super.startProcess();
+ }
+
+ @Override
+ public void endProcess() {
+ super.endProcess();
+ }
+
+ @Override
+ public String[] getInfoData() {
+ return super.getInfoData();
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return super.allowPullStack(aBaseMetaTileEntity, aIndex, aSide, aStack);
+ }
+
+ @Override
+ public int checkRecipe() {
+ return super.checkRecipe();
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+
+ /* if (aBaseMetaTileEntity != null) {
+ if (!aBaseMetaTileEntity.getWorld().isRemote) {
+ itemslots : for (int i=3;i<7;i++) {
+ ItemStack aStack = aBaseMetaTileEntity.getStackInSlot(i);
+ if (aStack != null) {
+ if (FluidContainerRegistry.isContainer(aStack)) {
+ if (this.isItemValidForSlot(i, aStack)) {
+ // Add Fluid
+ FluidStack aContainerFluid = FluidContainerRegistry.getFluidForFilledItem(aStack);
+ if (aContainerFluid != null) {
+ fluidslots : for (FluidStack u : mInputFluids) {
+ if (u != null && u.isFluidEqual(aContainerFluid)) {
+ if (u.amount <= (this.getCapacity() - aContainerFluid.amount)) {
+
+ // Matching, not full, let's fill, then continue
+ u.amount += aContainerFluid.amount;
+
+ // Update stack size
+ if (aStack.stackSize > 1) {
+ aStack.stackSize--;
+ }
+ else {
+ aStack = null;
+ }
+
+ // Add Output container
+ // TODO
+
+ continue itemslots;
+ }
+ else {
+ // Too full
+ break fluidslots;
+ }
+ }
+ else {
+ if (u == null ) {
+
+ // Empty, let's fill, then continue
+ u = aContainerFluid.copy();
+
+ // Update stack size
+ if (aStack.stackSize > 1) {
+ aStack.stackSize--;
+ }
+ else {
+ aStack = null;
+ }
+
+ // Add Output container
+ // TODO
+
+ continue itemslots;
+
+ }
+ else {
+ // Not empty, doesn't match, check next slot.
+ continue fluidslots;
+ }
+ }
+ }
+
+
+
+ }
+ // Eat Input
+
+ // Add Container to Output
+ }
+ }
+ }
+ }
+ }
+ }*/
+
+ }
+
+ @Override
+ public FluidStack getFluid() {
+ return super.getFluid();
+ }
+
+ @Override
+ public int getFluidAmount() {
+ return super.getFluidAmount();
+ }
+
+ @Override
+ public int fill(FluidStack aFluid, boolean doFill) {
+ return super.fill(aFluid, doFill);
+ }
+
+ @Override
+ public FluidStack drain(int maxDrain, boolean doDrain) {
+ return super.drain(maxDrain, doDrain);
+ }
+
+ @Override
+ public void setItemNBT(NBTTagCompound aNBT) {
+ super.setItemNBT(aNBT);
+ }
+
+ @Override
+ public boolean isItemValidForSlot(int aIndex, ItemStack aStack) {
+ if (aIndex >= 3 && aIndex <= 6) {
+ return SlotChemicalPlantInput.isItemValidForChemicalPlantSlot(aStack);
+ }
+ return false;
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(int aSide) {
+ return super.getAccessibleSlotsFromSide(aSide);
+ }
+
+ @Override
+ public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
+ if (aIndex >= 3 && aIndex <= 6) {
+ return super.canInsertItem(aIndex, aStack, aSide);
+ }
+ return false;
+ }
+
+ @Override
+ public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) {
+ if (aIndex >= 7 && aIndex <= 11) {
+ return super.canExtractItem(aIndex, aStack, aSide);
+ }
+ return false;
+ }
+
+ @Override
+ public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
+ // TODO Auto-generated method stub
+ return super.canFill(aSide, aFluid);
+ }
+
+ @Override
+ public boolean canDrain(ForgeDirection aSide, Fluid aFluid) {
+ // TODO Auto-generated method stub
+ return super.canDrain(aSide, aFluid);
+ }
+
+ @Override
+ public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
+ // TODO Auto-generated method stub
+ return super.getTankInfo(aSide);
+ }
+
+ @Override
+ public int fill_default(
+ ForgeDirection aSide, FluidStack aFluid, boolean doFill
+ ) {
+ // TODO Auto-generated method stub
+ return super.fill_default(aSide, aFluid, doFill);
+ }
+
+ @Override
+ public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ // TODO Auto-generated method stub
+ return super.fill(aSide, aFluid, doFill);
+ }
+
+ @Override
+ public FluidStack drain(
+ ForgeDirection aSide, FluidStack aFluid, boolean doDrain
+ ) {
+ // TODO Auto-generated method stub
+ return super.drain(aSide, aFluid, doDrain);
+ }
+
+ @Override
+ public FluidStack drain(
+ ForgeDirection aSide, int maxDrain, boolean doDrain
+ ) {
+ // TODO Auto-generated method stub
+ return super.drain(aSide, maxDrain, doDrain);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java
index 611cb4da71..b8517533e6 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java
@@ -55,7 +55,7 @@ extends GregtechMeta_MultiBlockBase {
"1x Input Bus",
"1x Output Bus",
"1x Energy Hatch"
- };
+ };
}
@Override
@@ -101,7 +101,7 @@ extends GregtechMeta_MultiBlockBase {
public boolean checkRecipe(final ItemStack aStack) {
return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 0);
}
-
+
@Override
public int getMaxParallelRecipes() {
return this.mLevel * 12;
@@ -118,19 +118,21 @@ extends GregtechMeta_MultiBlockBase {
final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
this.mLevel = 0;
if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) {
+ Logger.INFO("No air? "+xDir+", 1, "+zDir);
return false;
}
final byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 1, zDir);
switch (tUsedMeta) {
- case 2:
- this.mLevel = 1;
- break;
- case 3:
- this.mLevel = 2;
- break;
- default:
- return false;
+ case 2:
+ this.mLevel = 1;
+ break;
+ case 3:
+ this.mLevel = 2;
+ break;
+ default:
+ Logger.INFO("Bad Heating Coils.");
+ return false;
}
for (int i = -1; i < 2; i++) {
for (int j = -1; j < 2; j++) {
@@ -140,7 +142,7 @@ extends GregtechMeta_MultiBlockBase {
Logger.INFO("Heating Coils missing.");
return false;
}
-
+
if (!isValidBlockForStructure(tTileEntity2, TAE.GTPP_INDEX(1), true, aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j), ModBlocks.blockCasingsMisc, 1)) {
Logger.INFO("Casings missing from top layer of coke oven.");
return false;
@@ -158,7 +160,7 @@ extends GregtechMeta_MultiBlockBase {
}
}
}
- }
+ }
return true;
}
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 2e0eeea844..8b07117596 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
@@ -609,8 +609,13 @@ extends GregtechMeta_MultiBlockBase {
}
// -- Try not to fail after this point - inputs have already been consumed! --
- ItemStack[] mBuiltOutput = this.mReplicatorOutputMap.toArray();
-
+ 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);
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 cce1d5b530..a2087c0891 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
@@ -188,6 +188,8 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase
}
}
}
+
+ // TODO - Fix Casing Count
return true;
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java
index c55fe10829..6e7039f8ca 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java
@@ -292,7 +292,19 @@ extends GregtechMeta_MultiBlockBase
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isServerSide()){
- //Utils.LOG_INFO("tick: "+aTick);
+ // Reload Lava Filter
+ if (this.getGUIItemStack() == null) {
+ if (this.mInputBusses.size() > 0) {
+ for (GT_MetaTileEntity_Hatch_InputBus aBus : this.mInputBusses) {
+ for (ItemStack aStack : aBus.mInventory) {
+ if (aStack.getItem() instanceof ItemLavaFilter) {
+ this.setGUIItemStack(aStack);
+ }
+ }
+ }
+ }
+ }
+
if (this.mEUt > 0){
if (aTick % 600L == 0L){
damageFilter();
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java
index 8925caf480..cb8b7590ee 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java
@@ -207,7 +207,7 @@ public class GregtechMTE_MiniFusionPlant extends GregtechMeta_MultiBlockBase {
FluidStack[] arg5 = (FluidStack[]) tFluidList.toArray(new FluidStack[tFluidList.size()]);
GT_Recipe arg6 = getRecipeMap().findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe,
false, this.getMaxInputVoltage(), arg5, new ItemStack[0]);
- if (arg6 == null && !this.mRunningOnLoad || this.maxEUStore() < (long) arg6.mSpecialValue) {
+ if (arg6 == null && !this.mRunningOnLoad || (arg6 != null && this.maxEUStore() < (long) arg6.mSpecialValue)) {
//Logger.INFO("Bad Step "+aStep++);
//this.turnCasingActive(false);
this.mLastRecipe = null;
@@ -215,7 +215,7 @@ public class GregtechMTE_MiniFusionPlant extends GregtechMeta_MultiBlockBase {
}
//Logger.INFO("Step "+aStep++);
- if (this.mRunningOnLoad || arg6.isRecipeInputEqual(true, arg5, new ItemStack[0])) {
+ if (this.mRunningOnLoad || (arg6 != null && arg6.isRecipeInputEqual(true, arg5, new ItemStack[0]))) {
//Logger.INFO("Step "+aStep++);
this.mLastRecipe = arg6;
this.mEUt = this.mLastRecipe.mEUt * 1;
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java
index 23ca94e54d..6f9080673f 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java
@@ -17,16 +17,11 @@ import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.Recipe_GT;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map;
-import gregtech.common.GT_Pollution;
import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.util.minecraft.FluidUtils;
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;
-import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java
index 33555c8f51..f3fefdf789 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java
@@ -34,6 +34,10 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase
public static int CASING_TEXTURE_ID;
public static String mCasingName = "Advanced Cryogenic Casing";
public static TreeGenerator mTreeData;
+
+ static {
+ mTreeData = new TreeGenerator();
+ }
public GregtechMetaTileEntityTreeFarm(final int aID, final String aName, final String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -76,10 +80,6 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase
}
}*/
- if (mTreeData == null) {
- mTreeData = new TreeGenerator();
- }
-
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java
index 07c8a4a7ac..24db72fbe0 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java
@@ -22,8 +22,6 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
public class GregtechMetaTileEntity_Refinery extends GregtechMeta_MultiBlockBase {
-
- public GT_Recipe mLastRecipe;
public GregtechMetaTileEntity_Refinery(final int aID, final String aName, final String aNameRegional) {
super(aID, aName, aNameRegional);
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
new file mode 100644
index 0000000000..fda79876f6
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java
@@ -0,0 +1,502 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.algae;
+
+import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang3.ArrayUtils;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.TAE;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.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.core.item.chemistry.AgriculturalChem;
+import gtPlusPlus.core.util.minecraft.FluidUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
+import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import gtPlusPlus.xmod.gregtech.loaders.recipe.RecipeLoader_AlgaeFarm;
+import ic2.core.init.BlocksItems;
+import ic2.core.init.InternalName;
+import net.minecraft.block.Block;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
+public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase {
+
+ private int mLevel = -1;
+
+ public GregtechMTE_AlgaePondBase(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMTE_AlgaePondBase(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMTE_AlgaePondBase(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Algae Pond";
+ }
+
+ @Override
+ public String[] getTooltip() {
+ return new String[] {
+ "Grows Algae!",
+ "Controller Block for the Algae Farm",
+ "Size: 9x3x9 [WxHxL] (open)",
+ "X X",
+ "X X",
+ "XXXXXXXXX",
+ "Machine Hulls (all bottom layer)",
+ "Sterile Farm Casings (rest)",
+ "Controller (front centered)",
+ "All hatches must be on the bottom layer",
+ "All hulls must be the same tier, this dictates machine speed",
+ "Does not require power or maintenance",
+ "1x Output Bus",
+ "1x Input Bus (optional)",
+ "1x Input Hatch (fill with water)",
+ };
+ }
+
+ @Override
+ public String getSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(207));
+ }
+
+ @Override
+ public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
+
+ int aID = TAE.getIndexFromPage(1, 15);
+ if (mLevel > -1) {
+ aID = mLevel;
+ }
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[aID], new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Default_Active : TexturesGtBlock.Overlay_Machine_Controller_Default)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[aID]};
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return null;
+ }
+
+ @Override
+ public boolean isFacingValid(final byte aFacing) {
+ return aFacing > 1;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 2;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ @Override
+ public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
+
+ this.mLevel = 0;
+
+
+ // Get Facing direction
+ int mCurrentDirectionX;
+ int mCurrentDirectionZ;
+
+ int mOffsetX_Lower = 0;
+ int mOffsetX_Upper = 0;
+ int mOffsetZ_Lower = 0;
+ int mOffsetZ_Upper = 0;
+
+ mCurrentDirectionX = 4;
+ mCurrentDirectionZ = 4;
+
+ mOffsetX_Lower = -4;
+ mOffsetX_Upper = 4;
+ mOffsetZ_Lower = -4;
+ mOffsetZ_Upper = 4;
+
+ final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX
+ * mCurrentDirectionX;
+ final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ
+ * mCurrentDirectionZ;
+
+ // Get Expected Tier
+ Block aCasingBlock = aBaseMetaTileEntity.getBlockAtSide((byte) 0);
+ int aCasingMeta = aBaseMetaTileEntity.getMetaIDAtSide((byte) 0);
+
+ // Bad Casings
+ if ((aCasingBlock != GregTech_API.sBlockCasings1) || aCasingMeta > 9) {
+ return false;
+ }
+ else {
+ mLevel = this.getCasingTierOnClientSide();
+ }
+ int aID = TAE.getIndexFromPage(1, 15);
+ int tAmount = 0;
+ check : for (int i = mOffsetX_Lower; i <= mOffsetX_Upper; ++i) {
+ for (int j = mOffsetZ_Lower; j <= mOffsetZ_Upper; ++j) {
+ for (int h = -1; h < 2; ++h) {
+ if ((h != 0) || ((((xDir + i != 0) || (zDir + j != 0))) && (((i != 0) || (j != 0))))) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+
+ Logger.INFO("X: " + i + " | Z: " + j+" | Tier: "+aID);
+ if (h == -1 && tTileEntity != null && addToMachineList(tTileEntity, aID)) {
+ continue;
+ }
+ else if (h != -1 && tTileEntity != null) {
+ Logger.INFO("Found hatch in wrong place, expected casing.");
+ return false;
+ }
+
+ Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
+ byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
+
+ if ((tBlock == ModBlocks.blockCasings2Misc) && (tMeta == 15) && (h >= 0)) {
+ ++tAmount;
+ }
+ else if ((tBlock == GregTech_API.sBlockCasings1) && (tMeta == mLevel) && (h == -1)) {
+ ++tAmount;
+ }
+ else if ((tBlock == GregTech_API.sBlockCasings1) && (tMeta != mLevel) && (h == -1)) {
+ Logger.INFO("Found wrong tiered casing.");
+ return false;
+ }
+ else {
+ if ((i != mOffsetX_Lower && j != mOffsetZ_Lower && i != mOffsetX_Upper
+ && j != mOffsetZ_Upper) && (h == 0 || h == 1)) {
+ continue;
+ } else {
+ if (tBlock.getLocalizedName().contains("gt.blockmachines") || tBlock == Blocks.water
+ || tBlock == Blocks.flowing_water
+ || tBlock == BlocksItems.getFluidBlock(InternalName.fluidDistilledWater)) {
+ continue;
+
+ } else {
+ Logger.INFO("[x] Did not form - Found: " + tBlock.getLocalizedName() + " | "
+ + tBlock.getDamageValue(aBaseMetaTileEntity.getWorld(),
+ aBaseMetaTileEntity.getXCoord() + i,
+ aBaseMetaTileEntity.getYCoord(),
+ aBaseMetaTileEntity.getZCoord() + j)
+ + " | Special Meta: "
+ + (tTileEntity == null ? "0" : tTileEntity.getMetaTileID()));
+ Logger.INFO("[x] Did not form - Found: "
+ + (aBaseMetaTileEntity.getXCoord() + xDir + i) + " | "
+ + aBaseMetaTileEntity.getYCoord() + " | "
+ + (aBaseMetaTileEntity.getZCoord() + zDir + j));
+ break check;
+ }
+ }
+
+ }
+
+ }
+ }
+ }
+ }
+ if ((tAmount >= 64)) {
+ Logger.INFO("Made structure.");
+ this.getBaseMetaTileEntity().getWorld().markBlockForUpdate(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord());
+ } else {
+ Logger.INFO("Did not make structure.");
+ }
+ return (tAmount >= 64);
+ }
+
+ public boolean checkForWater() {
+
+ // Get Facing direction
+ IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity();
+ int mDirectionX = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int mCurrentDirectionX;
+ int mCurrentDirectionZ;
+ int mOffsetX_Lower = 0;
+ int mOffsetX_Upper = 0;
+ int mOffsetZ_Lower = 0;
+ int mOffsetZ_Upper = 0;
+
+ mCurrentDirectionX = 4;
+ mCurrentDirectionZ = 4;
+
+ mOffsetX_Lower = -4;
+ mOffsetX_Upper = 4;
+ mOffsetZ_Lower = -4;
+ mOffsetZ_Upper = 4;
+
+ // if (aBaseMetaTileEntity.fac)
+
+ final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX
+ * mCurrentDirectionX;
+ final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ
+ * mCurrentDirectionZ;
+
+ int tAmount = 0;
+ for (int i = mOffsetX_Lower + 1; i <= mOffsetX_Upper - 1; ++i) {
+ for (int j = mOffsetZ_Lower + 1; j <= mOffsetZ_Upper - 1; ++j) {
+ for (int h = 0; h < 2; h++) {
+ Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
+ // byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
+ if (tBlock == Blocks.air || tBlock == Blocks.flowing_water || tBlock == BlocksItems.getFluidBlock(InternalName.fluidDistilledWater)) {
+ if (this.getStoredFluids() != null) {
+ for (FluidStack stored : this.getStoredFluids()) {
+ if (stored.isFluidEqual(FluidUtils.getFluidStack("water", 1))) {
+ if (stored.amount >= 1000) {
+ // Utils.LOG_WARNING("Going to try swap an air block for water from inut bus.");
+ stored.amount -= 1000;
+ Block fluidUsed = Blocks.water;
+ aBaseMetaTileEntity.getWorld().setBlock(
+ aBaseMetaTileEntity.getXCoord() + xDir + i,
+ aBaseMetaTileEntity.getYCoord() + h,
+ aBaseMetaTileEntity.getZCoord() + zDir + j, fluidUsed);
+
+ }
+ }
+ }
+ }
+ }
+ tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
+ if (tBlock == Blocks.water || tBlock == Blocks.flowing_water) {
+ ++tAmount;
+ // Logger.INFO("Found Water");
+ }
+ }
+ }
+ }
+
+ boolean isValidWater = tAmount >= 60;
+
+ if (isValidWater) {
+ Logger.INFO("Filled structure.");
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(final ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ this.fixAllMaintenanceIssue();
+ // Silly Client Syncing
+ if (aBaseMetaTileEntity.isClientSide()) {
+ this.mLevel = getCasingTierOnClientSide();
+ }
+
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 0);
+ }
+
+ public boolean checkRecipeGeneric(
+ ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
+ int aMaxParallelRecipes, int aEUPercent,
+ int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) {
+
+ if (this.mLevel < 0) {
+ Logger.INFO("Bad Tier.");
+ return false;
+ }
+
+ if (!checkForWater()) {
+ Logger.INFO("Not enough Water.");
+ return false;
+ }
+
+ // Reset outputs and progress stats
+ this.mEUt = 0;
+ this.mMaxProgresstime = 0;
+ this.mOutputItems = new ItemStack[]{};
+ this.mOutputFluids = new FluidStack[]{};
+
+ Logger.INFO("Running checkRecipeGeneric(0)");
+
+ GT_Recipe tRecipe = RecipeLoader_AlgaeFarm.getTieredRecipeFromCache(this.mLevel, isUsingCompost(aItemInputs));
+
+ this.mLastRecipe = tRecipe;
+
+ if (tRecipe == null) {
+ return false;
+ }
+
+ if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes, false)) {
+ return false;
+ }
+
+
+ // -- Try not to fail after this point - inputs have already been consumed! --
+
+
+ this.mMaxProgresstime = (int)(tRecipe.mDuration);
+ this.mEUt = 0;
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ Logger.INFO("Recipe time: "+this.mMaxProgresstime);
+ 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 *= aMaxParallelRecipes;
+ }
+ }
+
+ // 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 < aMaxParallelRecipes; 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.INFO("GOOD RETURN - 1");
+ return true;
+
+ }
+
+ private boolean isUsingCompost(ItemStack[] aItemInputs) {
+ ItemStack aCompost = ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1);
+ for (ItemStack i : aItemInputs) {
+ if (GT_Utility.areStacksEqual(aCompost, i)) {
+ if (i.stackSize >= 8) {
+ return true;
+ }
+ else {
+ continue;
+ }
+ }
+ }
+ return false;
+ }
+
+ @SideOnly(Side.CLIENT)
+ private final int getCasingTierOnClientSide() {
+ if (this == null || this.getBaseMetaTileEntity().getWorld() == null) {
+ return 0;
+ }
+ try {
+ Block aInitStructureCheck;
+ int aInitStructureCheckMeta;
+ IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity();
+ aInitStructureCheck = aBaseMetaTileEntity.getBlockOffset(0, -1, 0);
+ aInitStructureCheckMeta = aBaseMetaTileEntity.getMetaIDOffset(0, -1, 0);
+ if (aInitStructureCheck == GregTech_API.sBlockCasings1) {
+ return aInitStructureCheckMeta;
+ }
+ return 0;
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ return 0;
+ }
+ }
+
+
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java
index 736d0bc389..c499de0fa5 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java
@@ -23,6 +23,7 @@ import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.MiningUtils;
+import gtPlusPlus.core.util.minecraft.OreDictUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import net.minecraft.block.Block;
@@ -509,23 +510,23 @@ public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends G
mMixedOreData.put(new Pair<String, Integer>("oreLapis", 40));
mMixedOreData.put(new Pair<String, Integer>("oreRedstone", 40));
- if (LoadedMods.Thaumcraft || (OreDictionary.doesOreNameExist("oreAmber") && OreDictionary.doesOreNameExist("oreCinnabar"))) {
+ if (LoadedMods.Thaumcraft || (OreDictUtils.containsValidEntries("oreAmber") && OreDictUtils.containsValidEntries("oreCinnabar"))) {
mMixedOreData.put(new Pair<String, Integer>("oreAmber", 20));
mMixedOreData.put(new Pair<String, Integer>("oreCinnabar", 20));
}
- if (LoadedMods.Railcraft || OreDictionary.doesOreNameExist("oreSaltpeter")) {
+ if (LoadedMods.Railcraft || OreDictUtils.containsValidEntries("oreSaltpeter")) {
mMixedOreData.put(new Pair<String, Integer>("oreSaltpeter", 10));
}
- if (LoadedMods.IndustrialCraft2 || OreDictionary.doesOreNameExist("oreUranium")) {
+ if (LoadedMods.IndustrialCraft2 || OreDictUtils.containsValidEntries("oreUranium")) {
mMixedOreData.put(new Pair<String, Integer>("oreUranium", 10));
}
- if (OreDictionary.doesOreNameExist("oreSulfur")) {
+ if (OreDictUtils.containsValidEntries("oreSulfur")) {
mMixedOreData.put(new Pair<String, Integer>("oreSulfur", 15));
}
- if (OreDictionary.doesOreNameExist("oreSilicon")) {
+ if (OreDictUtils.containsValidEntries("oreSilicon")) {
mMixedOreData.put(new Pair<String, Integer>("oreSilicon", 15));
}
- if (OreDictionary.doesOreNameExist("oreApatite")) {
+ if (OreDictUtils.containsValidEntries("oreApatite")) {
mMixedOreData.put(new Pair<String, Integer>("oreApatite", 25));
}
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
new file mode 100644
index 0000000000..654d036bf8
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java
@@ -0,0 +1,823 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.chemplant;
+
+import static gregtech.api.enums.GT_Values.E;
+
+import java.util.HashSet;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.api.util.Recipe_GT;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
+import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
+import gtPlusPlus.xmod.gregtech.common.StaticFields59;
+import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.common.util.ForgeDirection;
+
+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);
+
+
+ public GregtechMTE_ChemicalPlant(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMTE_ChemicalPlant(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMTE_ChemicalPlant(this.mName);
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Chemical Plant";
+ }
+
+ @Override
+ public String[] getTooltip() {
+ return new String[] {
+ "Heavy Industry, now right at your doorstep!",
+ "Controller Block for the Chemical Plant",
+ "27 Coils",
+ "18 Pipe Casings",
+ "57 Tiered Machine Casings",
+ "80+ Solid Casings",
+ "Hatch tier is limited to Machine Casing tier",
+ };
+ }
+
+ @Override
+ public String getSound() {
+ return GregTech_API.sSoundList.get(Integer.valueOf(207));
+ }
+
+ @Override
+ public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
+
+ ITexture aOriginalTexture;
+
+ // Check things exist client side (The worst code ever)
+ if (aBaseMetaTileEntity.getWorld() != null) {
+
+ }
+ // Check the Tier Client Side
+ int aTier = mSolidCasingTier;
+
+ if (aTier == 1) {
+ aOriginalTexture = Textures.BlockIcons.CASING_BLOCKS[16];
+ }
+ else if (aTier == 2) {
+ aOriginalTexture = Textures.BlockIcons.CASING_BLOCKS[49];
+ }
+ else if (aTier == 3) {
+ aOriginalTexture = Textures.BlockIcons.CASING_BLOCKS[50];
+ }
+ else if (aTier == 4) {
+ aOriginalTexture = Textures.BlockIcons.CASING_BLOCKS[48];
+ }
+ else {
+ aOriginalTexture = Textures.BlockIcons.CASING_BLOCKS[11];
+ }
+
+
+ if (aSide == aFacing) {
+ return new ITexture[]{aOriginalTexture, new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active : TexturesGtBlock.Overlay_Machine_Controller_Advanced)};
+ }
+ return new ITexture[]{aOriginalTexture};
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @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 mFluidChemicalReactorRecipes;
+ }
+
+ @Override
+ public boolean isFacingValid(final byte aFacing) {
+ return aFacing > 1;
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 2 * getPipeCasingTier();
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ private int getSolidCasingTier() {
+ return mSolidCasingTier;
+ }
+
+ private int getMachineCasingTier() {
+ return mMachineCasingTier;
+ }
+ private int getPipeCasingTier() {
+ return mPipeCasingTier;
+ }
+ private int getCoilTier() {
+ return mCoilTier;
+ }
+
+ private int getCasingTextureID() {
+ // Check the Tier Client Side
+ int aTier = mSolidCasingTier;
+
+ if (aTier == 1) {
+ return 16;
+ }
+ else if (aTier == 2) {
+ return 49;
+ }
+ else if (aTier == 3) {
+ return 50;
+ }
+ else if (aTier == 4) {
+ return 48;
+ }
+ else {
+ return 11;
+ }
+ }
+
+ public boolean addToMachineList(IGregTechTileEntity aTileEntity) {
+ int aMaxTier = getMachineCasingTier();
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_TieredMachineBlock) {
+ GT_MetaTileEntity_TieredMachineBlock aMachineBlock = (GT_MetaTileEntity_TieredMachineBlock) aMetaTileEntity;
+ int aTileTier = aMachineBlock.mTier;
+ if (aTileTier > aMaxTier) {
+ Logger.INFO("Hatch tier too high.");
+ return false;
+ }
+ else {
+ return addToMachineList(aTileEntity, getCasingTextureID());
+ }
+ }
+ else {
+ Logger.INFO("Bad Tile Entity being added to hatch map."); // Shouldn't ever happen, but.. ya know..
+ return false;
+ }
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setInteger("mSolidCasingTier", this.mSolidCasingTier);
+ aNBT.setInteger("mMachineCasingTier", this.mMachineCasingTier);
+ aNBT.setInteger("mPipeCasingTier", this.mPipeCasingTier);
+ aNBT.setInteger("mCoilTier", this.mCoilTier);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ mSolidCasingTier = aNBT.getInteger("mSolidCasingTier");
+ mMachineCasingTier = aNBT.getInteger("mMachineCasingTier");
+ mPipeCasingTier = aNBT.getInteger("mPipeCasingTier");
+ mCoilTier = aNBT.getInteger("mCoilTier");
+ }
+
+ private static boolean isBlockSolidCasing(Block aBlock, int aMeta) {
+ if (aBlock == null) {
+ return false;
+ }
+ if (aBlock == GregTech_API.sBlockCasings2 && aMeta == 0) {
+ return true;
+ }
+ if (aBlock == GregTech_API.sBlockCasings4) {
+ int aMetaStainlessCasing = 1;
+ int aMetaTitaniumCasing = 2;
+ int aMetaTungstenCasing = 0;
+ if (aMeta == aMetaStainlessCasing || aMeta == aMetaTitaniumCasing || aMeta == aMetaTungstenCasing) {
+ return true;
+ }
+ }
+ return false;
+ }
+ private static boolean isBlockMachineCasing(Block aBlock, int aMeta) {
+ Block aCasingBlock1 = GregTech_API.sBlockCasings1;
+ if (aBlock == aCasingBlock1) {
+ if (aMeta > 9 || aMeta < 0) {
+ return false;
+ }
+ else {
+ return true;
+ }
+ }
+ else {
+ return false;
+ }
+ }
+ private static boolean isBlockPipeCasing(Block aBlock, int aMeta) {
+ Block aCasingBlock2 = GregTech_API.sBlockCasings2;
+ if (aBlock == aCasingBlock2) {
+ int aMetaBronzePipeCasing = 12;
+ int aMetaSteelPipeCasing = 13;
+ int aMetaTitaniumPipeCasing = 14;
+ int aMetaTungstenPipeCasing = 15;
+ if (aMeta > aMetaTungstenPipeCasing || aMeta < aMetaBronzePipeCasing) {
+ return false;
+ }
+ else {
+ return true;
+ }
+ }
+ else {
+ return false;
+ }
+ }
+
+ private static AutoMap<Integer> mValidCoilMetaCache;
+
+ private static boolean isBlockCoil(Block aBlock, int aMeta) {
+ Block aCasingBlock;
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ aCasingBlock = StaticFields59.getBlockCasings5();
+ }
+ else {
+ aCasingBlock = GregTech_API.sBlockCasings1;
+ }
+ // Cache the meta values for later
+ if (mValidCoilMetaCache == null || mValidCoilMetaCache.isEmpty()) {
+ AutoMap<Integer> aValidCoilMeta = new AutoMap<Integer>();
+ // Only use the right meta values available.
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ aValidCoilMeta = Meta_GT_Proxy.GT_ValidHeatingCoilMetas;
+ }
+ else {
+ aValidCoilMeta.put(12);
+ aValidCoilMeta.put(13);
+ aValidCoilMeta.put(14);
+ }
+ mValidCoilMetaCache = aValidCoilMeta;
+ }
+ if (aBlock == aCasingBlock) {
+ for (int i: mValidCoilMetaCache.values()) {
+ if (i == aMeta) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+
+ @Override
+ public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
+
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 3;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 3;
+
+ int tAmount = 0;
+ Logger.INFO("Checking ChemPlant Structure");
+
+ // Require Air above controller
+ boolean aAirCheck = aBaseMetaTileEntity.getAirOffset(0, 1, 0);
+
+ if (!aAirCheck) {
+ Logger.INFO("No Air Above Controller");
+ return false;
+ } else {
+
+ //String aName = aInitStructureCheck != null ? ItemUtils.getLocalizedNameOfBlock(aInitStructureCheck, aInitStructureCheckMeta) : "Air";
+
+ mSolidCasingTier = getSolidCasingTierCheck(aBaseMetaTileEntity, xDir, zDir);
+ mMachineCasingTier = getMachineCasingTierCheck(aBaseMetaTileEntity, xDir, zDir);
+
+ Logger.INFO("Initial Casing Check Complete, Solid Casing Tier: "+mSolidCasingTier+", Machine Casing Tier: "+mMachineCasingTier);
+
+ int aSolidCasingCount = 0;
+ int aMachineCasingCount = 0;
+ int aPipeCount = 0;
+ int aCoilCount = 0;
+
+ aSolidCasingCount = checkSolidCasings(aBaseMetaTileEntity, aStack, xDir, zDir);
+ aMachineCasingCount = checkMachineCasings(aBaseMetaTileEntity, aStack, xDir, zDir);
+ aPipeCount = checkPipes(aBaseMetaTileEntity, aStack, xDir, zDir);
+ aCoilCount = checkCoils(aBaseMetaTileEntity, aStack, xDir, zDir);
+
+ Logger.INFO("Casing Counts: ");
+ Logger.INFO("Solid: "+aSolidCasingCount+", Machine: "+aMachineCasingCount);
+ Logger.INFO("Pipe: "+aPipeCount+", Coil: "+aCoilCount);
+
+
+ Logger.INFO("Casing Tiers: ");
+ Logger.INFO("Solid: "+getSolidCasingTier()+", Machine: "+getMachineCasingTier());
+ Logger.INFO("Pipe: "+getPipeCasingTier()+", Coil: "+getCoilTier());
+
+ // Attempt to sync fields here, so that it updates client side values.
+ aBaseMetaTileEntity.getWorld().markBlockForUpdate(aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord());
+
+
+
+ // Minimum 80/93 Solid Casings
+ if (aSolidCasingCount < 80) {
+ Logger.INFO("Not enough solid casings. Found "+aSolidCasingCount+", require: 80.");
+ return false;
+ }
+ if (aMachineCasingCount != 57) {
+ Logger.INFO("Not enough machine casings. Found "+aMachineCasingCount+", require: 57.");
+ return false;
+ }
+ if (aPipeCount != 18) {
+ Logger.INFO("Not enough pipe casings. Found "+aPipeCount+", require: 18.");
+ return false;
+ }
+ if (aCoilCount != 27) {
+ Logger.INFO("Not enough coils. Found "+aCoilCount+", require: 27.");
+ return false;
+ }
+
+ Logger.INFO("Structure Check Complete!");
+
+ return true;
+ }
+ }
+
+
+ public int checkCoils(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack, int aOffsetX, int aOffsetZ) {
+ int tAmount = 0;
+ int aCurrentCoilMeta = -1;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ for (int h = 0; h < 8; h++) {
+ if (h == 1 || h == 3 || h == 5) {
+ Block aBlock = aBaseMetaTileEntity.getBlockOffset(aOffsetX + i, h, aOffsetZ + j);
+ int aMeta = aBaseMetaTileEntity.getMetaIDOffset(aOffsetX + i, h, aOffsetZ + j);
+ if (isBlockCoil(aBlock, aMeta)) {
+ if (aCurrentCoilMeta < 0) {
+ aCurrentCoilMeta = aMeta;
+ }
+ if (aCurrentCoilMeta != aMeta) {
+ return tAmount;
+ }
+ else {
+ tAmount++;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ this.mCoilTier = (aCurrentCoilMeta+1);
+ }
+ else {
+ if (aCurrentCoilMeta == 12) {
+ this.mCoilTier = 1;
+ }
+ else if (aCurrentCoilMeta == 13) {
+ this.mCoilTier = 2;
+ }
+ else if (aCurrentCoilMeta == 14) {
+ this.mCoilTier = 3;
+ }
+ else {
+ this.mCoilTier = 0;
+ }
+ }
+
+ return tAmount;
+ }
+
+
+ public int checkPipes(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack, int aOffsetX, int aOffsetZ) {
+ int tAmount = 0;
+ int aCurrentPipeMeta = -1;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ for (int h = 0; h < 8; h++) {
+ if (h == 2 || h == 4) {
+ Block aBlock = aBaseMetaTileEntity.getBlockOffset(aOffsetX + i, h, aOffsetZ + j);
+ int aMeta = aBaseMetaTileEntity.getMetaIDOffset(aOffsetX + i, h, aOffsetZ + j);
+ if (isBlockPipeCasing(aBlock, aMeta)) {
+ if (aCurrentPipeMeta < 0) {
+ aCurrentPipeMeta = aMeta;
+ }
+ if (aCurrentPipeMeta != aMeta) {
+ return tAmount;
+ }
+ else {
+ tAmount++;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (aCurrentPipeMeta == 12) {
+ this.mPipeCasingTier = 1;
+ }
+ else if (aCurrentPipeMeta == 13) {
+ this.mPipeCasingTier = 2;
+ }
+ else if (aCurrentPipeMeta == 14) {
+ this.mPipeCasingTier = 3;
+ }
+ else if (aCurrentPipeMeta == 15) {
+ this.mPipeCasingTier = 4;
+ }
+ else {
+ this.mPipeCasingTier = 0;
+ }
+
+ return tAmount;
+ }
+
+
+ public int checkSolidCasings(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack, int aOffsetX, int aOffsetZ) {
+
+ int tAmount = 0;
+
+ // Only check a 7x7 ring
+ for (int i = -3; i < 4; i++) {
+ for (int j = -3; j < 4; j++) {
+ // If we are on the 7x7 ring, proceed
+ if (i == -3 || i == 3 || j == -3 || j == 3) {
+ IGregTechTileEntity aTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(aOffsetX + i, 0, aOffsetZ + j);
+ Block aBlock = aBaseMetaTileEntity.getBlockOffset(aOffsetX + i, 0, aOffsetZ + j);
+ int aMeta = aBaseMetaTileEntity.getMetaIDOffset(aOffsetX + i, 0, aOffsetZ + j);
+
+ if (aTileEntity != null) {
+
+ if (this.addToMachineList(aTileEntity)) {
+ tAmount++;
+ }
+ else {
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ Logger.INFO("Error counting Bottom Layer Casing Ring. Bad Tile Entity. Found "+aTileEntity.getInventoryName());
+ return tAmount;
+ }
+ //Handle controller
+ if (aMetaTileEntity instanceof GregtechMTE_ChemicalPlant) {
+ continue;
+ }
+ else {
+ Logger.INFO("Error counting Bottom Layer Casing Ring. Bad Tile Entity. Found "+aMetaTileEntity.getInventoryName());
+ return tAmount;
+ }
+ }
+ }
+ else {
+ if (isBlockSolidCasing(aBlock, aMeta)) {
+ tAmount++;
+ }
+ else {
+ Logger.INFO("Error counting Bottom Layer Casing Ring. Found "+aBlock.getLocalizedName()+":"+aMeta);
+ return tAmount;
+ }
+ }
+ }
+ }
+ }
+
+ // Check 5 layers Pillars
+ for (int r=1;r<6;r++) {
+ // Check Each Pillar/Corner
+ for (int aPillar=0;aPillar<4;aPillar++) {
+ int i = 0;
+ int j = 0;
+ if (aPillar == 0) {
+ i = -3;
+ j = -3;
+ }
+ else if (aPillar == 1) {
+ i = 3;
+ j = 3;
+ }
+ else if (aPillar == 2) {
+ i = -3;
+ j = 3;
+ }
+ else if (aPillar == 3) {
+ i = 3;
+ j = -3;
+ }
+ Block aBlock = aBaseMetaTileEntity.getBlockOffset(aOffsetX + i, r, aOffsetZ + j);
+ int aMeta = aBaseMetaTileEntity.getMetaIDOffset(aOffsetX + i, r, aOffsetZ + j);
+ if (isBlockSolidCasing(aBlock, aMeta)) {
+ tAmount++;
+ }
+ else {
+ Logger.INFO("Error counting Pillars. Found "+ItemUtils.getLocalizedNameOfBlock(aBlock, aMeta));
+ return tAmount;
+ }
+ }
+ }
+
+
+ // Check top layer 7x7
+ for (int i = -3; i < 4; i++) {
+ for (int j = -3; j < 4; j++) {
+ Block aBlock = aBaseMetaTileEntity.getBlockOffset(aOffsetX + i, 6, aOffsetZ + j);
+ int aMeta = aBaseMetaTileEntity.getMetaIDOffset(aOffsetX + i, 6, aOffsetZ + j);
+ if (isBlockSolidCasing(aBlock, aMeta)) {
+ tAmount++;
+ }
+ else {
+ Logger.INFO("Error counting Top Layer casings. Found "+ItemUtils.getLocalizedNameOfBlock(aBlock, aMeta));
+ return tAmount;
+ }
+ }
+ }
+
+ return tAmount;
+ }
+
+
+ public int checkMachineCasings(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack, int aOffsetX, int aOffsetZ) {
+ int tAmount = 0;
+ int aHeight = 0;
+ // Iterate once for each layer
+ for (int aIteration=0;aIteration<3;aIteration++) {
+ // Dynamically set height
+ aHeight = (aIteration == 0 ? 0 : aIteration == 1 ? 1 : 5);
+ // Only check a 5x5 area
+ for (int i = -2; i < 3; i++) {
+ for (int j = -2; j < 3; j++) {
+ // If we are on the 5x5 ring, proceed
+ if (i == -2 || i == 2 || j == -2 || j == 2) {
+ // If the second axis is on the outer ring, continue
+ if (i < -2 || i > 2 || j < -2 || j > 2) {
+ continue;
+ }
+ Block aBlock = aBaseMetaTileEntity.getBlockOffset(aOffsetX + i, aHeight, aOffsetZ + j);
+ int aMeta = aBaseMetaTileEntity.getMetaIDOffset(aOffsetX + i, aHeight, aOffsetZ + j);
+ if (isBlockMachineCasing(aBlock, aMeta)) {
+ tAmount++;
+ }
+ else {
+ return tAmount;
+ }
+ }
+ }
+ }
+ }
+
+ // Check bottom layer inner 3x3
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ Block aBlock = aBaseMetaTileEntity.getBlockOffset(aOffsetX + i, 0, aOffsetZ + j);
+ int aMeta = aBaseMetaTileEntity.getMetaIDOffset(aOffsetX + i, 0, aOffsetZ + j);
+ if (isBlockMachineCasing(aBlock, aMeta)) {
+ tAmount++;
+ }
+ else {
+ return tAmount;
+ }
+ }
+ }
+
+ return tAmount;
+ }
+
+ public int getSolidCasingTierCheck(IGregTechTileEntity aBaseMetaTileEntity, int xDir, int zDir) {
+ Block aInitStructureCheck;
+ int aInitStructureCheckMeta;
+ if (xDir == 0) {
+ aInitStructureCheck = aBaseMetaTileEntity.getBlockOffset(zDir, 1, 0);
+ aInitStructureCheckMeta = aBaseMetaTileEntity.getMetaIDOffset(zDir, 1, 0);
+ }
+ else {
+ aInitStructureCheck = aBaseMetaTileEntity.getBlockOffset(0, 1, xDir);
+ aInitStructureCheckMeta = aBaseMetaTileEntity.getMetaIDOffset(0, 1, xDir);
+ }
+ if (aInitStructureCheck == GregTech_API.sBlockCasings2) {
+ int aMetaSteelCasing = 0;
+ if (aInitStructureCheckMeta == aMetaSteelCasing) {
+ return 1;
+ }
+ }
+ else if (aInitStructureCheck == GregTech_API.sBlockCasings4) {
+ int aMetaStainlessCasing = 1;
+ int aMetaTitaniumCasing = 2;
+ int aMetaTungstenCasing = 0;
+ if (aInitStructureCheckMeta == aMetaStainlessCasing) {
+ return 2;
+ }
+ else if (aInitStructureCheckMeta == aMetaTitaniumCasing) {
+ return 3;
+ }
+ else if (aInitStructureCheckMeta == aMetaTungstenCasing) {
+ return 4;
+ }
+ }
+ return 0;
+ }
+
+ public int getMachineCasingTierCheck(IGregTechTileEntity aBaseMetaTileEntity, int xDir, int zDir) {
+ Block aInitStructureCheck;
+ int aInitStructureCheckMeta;
+ Logger.INFO(""+xDir+", "+zDir);
+ if (xDir == 0) {
+ if (zDir > 0) {
+ aInitStructureCheck = aBaseMetaTileEntity.getBlockOffset(0, 0, 1);
+ aInitStructureCheckMeta = aBaseMetaTileEntity.getMetaIDOffset(0, 0, 1);
+ }
+ else {
+ aInitStructureCheck = aBaseMetaTileEntity.getBlockOffset(0, 0, -1);
+ aInitStructureCheckMeta = aBaseMetaTileEntity.getMetaIDOffset(0, 0, -1);
+ }
+
+ }
+ else {
+ if (xDir > 0) {
+ aInitStructureCheck = aBaseMetaTileEntity.getBlockOffset(1, 0, 0);
+ aInitStructureCheckMeta = aBaseMetaTileEntity.getMetaIDOffset(1, 0, 0);
+ }
+ else {
+ aInitStructureCheck = aBaseMetaTileEntity.getBlockOffset(-1, 0, 0);
+ aInitStructureCheckMeta = aBaseMetaTileEntity.getMetaIDOffset(-1, 0, 0);
+ }
+ }
+
+ if (isBlockMachineCasing(aInitStructureCheck, aInitStructureCheckMeta)) {
+ Logger.INFO("Using Meta "+aInitStructureCheckMeta);
+ return aInitStructureCheckMeta;
+ }
+ return 0;
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(final ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ // Silly Client Syncing
+ if (aBaseMetaTileEntity.isClientSide()) {
+ this.mSolidCasingTier = getCasingTierOnClientSide();
+ }
+
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 0);
+ }
+
+
+
+ @SideOnly(Side.CLIENT)
+ private final int getCasingTierOnClientSide() {
+
+ if (this == null || this.getBaseMetaTileEntity().getWorld() == null) {
+ return 0;
+ }
+ try {
+ Block aInitStructureCheck;
+ int aInitStructureCheckMeta;
+ IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity();
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 3;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 3;
+ if (xDir == 0) {
+ aInitStructureCheck = aBaseMetaTileEntity.getBlockOffset(zDir, 1, 0);
+ aInitStructureCheckMeta = aBaseMetaTileEntity.getMetaIDOffset(zDir, 1, 0);
+ }
+ else {
+ aInitStructureCheck = aBaseMetaTileEntity.getBlockOffset(0, 1, xDir);
+ aInitStructureCheckMeta = aBaseMetaTileEntity.getMetaIDOffset(0, 1, xDir);
+ }
+ if (aInitStructureCheck == GregTech_API.sBlockCasings2) {
+ int aMetaSteelCasing = 0;
+ if (aInitStructureCheckMeta == aMetaSteelCasing) {
+ return 1;
+ }
+ }
+ else if (aInitStructureCheck == GregTech_API.sBlockCasings4) {
+ int aMetaStainlessCasing = 1;
+ int aMetaTitaniumCasing = 2;
+ int aMetaTungstenCasing = 0;
+ if (aInitStructureCheckMeta == aMetaStainlessCasing) {
+ return 2;
+ }
+ else if (aInitStructureCheckMeta == aMetaTitaniumCasing) {
+ return 3;
+ }
+ else if (aInitStructureCheckMeta == aMetaTungstenCasing) {
+ return 4;
+ }
+ }
+ return 0;
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ return 0;
+ }
+
+ }
+
+
+
+
+
+
+
+
+}
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 dda1a6b0c0..7300b3507b 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
@@ -21,6 +21,7 @@ import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import gtPlusPlus.preloader.asm.AsmConfig;
import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_PowerSubStation;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_PowerSubStation;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBattery;
@@ -120,7 +121,9 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe
checkMachineProblem(problem);
}
private void checkMachineProblem(String msg) {
- Logger.INFO("Power Sub-Station problem: " + msg);
+ if (!AsmConfig.disableAllLogging) {
+ Logger.INFO("Power Sub-Station problem: " + msg);
+ }
}
public static int getCellTier(Block aBlock, int aMeta) {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
index d8a5617b2e..d4a25e03dd 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
@@ -266,7 +266,7 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base {
//Get us four ItemStacks to input into the mixer
ItemStack input1, input2, input3, input4;
- input1 = (inputStacks.length >= 1) ? (input1 = (inputStacks[0] == null) ? null : inputStacks[0]) : null;
+ input1 = inputStacks[0];
input2 = (inputStacks.length >= 2) ? (input2 = (inputStacks[1] == null) ? null : inputStacks[1]) : null;
input3 = (inputStacks.length >= 3) ? (input3 = (inputStacks[2] == null) ? null : inputStacks[2]) : null;
input4 = (inputStacks.length >= 4) ? (input4 = (inputStacks[3] == null) ? null : inputStacks[3]) : null;
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java
index 0a20d9357c..40994040bd 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java
@@ -1,33 +1,75 @@
package gtPlusPlus.xmod.gregtech.loaders;
import java.util.HashSet;
-import java.util.Set;
import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.Materials;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.Recipe_GT;
import gtPlusPlus.api.interfaces.RunnableWithInfo;
import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.material.Material;
-import gtPlusPlus.core.material.MaterialGenerator;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
-public class RecipeGen_FluidCanning extends RecipeGen_Base {
-
- public final static Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
- static {
- MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
+public class RecipeGen_FluidCanning implements Runnable {
+
+ public static void init() {
+ FluidCanningRunnableHandler x = new FluidCanningRunnableHandler();
+ x.run();
}
+ private static class FluidCanningRunnableHandler implements RunnableWithInfo<String> {
+
+ @Override
+ public void run() {
+ mHasRun = true;
+ for (RecipeGen_FluidCanning aRecipe : mCache) {
+ aRecipe.run();
+ }
+ }
+
+ @Override
+ public String getInfoData() {
+ return "Fluid Canning Recipes";
+ }
+ }
+
+ private static boolean mHasRun = false;
+
+ private static HashSet<RecipeGen_FluidCanning> mCache = new HashSet<RecipeGen_FluidCanning>();
+
+ private static void addRunnableToRecipeCache(RecipeGen_FluidCanning r) {
+ if (mHasRun) {
+ CORE.crash();
+ }
+ mCache.add(r);
+ }
+
+ protected boolean disableOptional;
+
private final GT_Recipe recipe;
private final boolean isValid;
- // Alternative Constructor
+ public boolean valid() {
+ return isValid;
+ }
+ public RecipeGen_FluidCanning(boolean aExtracting, ItemStack aEmpty, ItemStack aFull, FluidStack aFluid) {
+ this(aExtracting, aEmpty, aFull, aFluid, GT_Values.NF, null, null);
+ }
+
+ public RecipeGen_FluidCanning(boolean aExtracting, ItemStack aEmpty, ItemStack aFull, FluidStack aFluidIn, FluidStack aFluidOut) {
+ this(aExtracting, aEmpty, aFull, aFluidIn, aFluidOut, null, null);
+ }
+
public RecipeGen_FluidCanning(boolean aExtracting, ItemStack aEmpty, ItemStack aFull, FluidStack aFluid, Integer aDuration, Integer aEUt) {
+ this(aExtracting, aEmpty, aFull, aFluid, GT_Values.NF, aDuration, aEUt);
+ }
+
+ // Alternative Constructor
+ public RecipeGen_FluidCanning(boolean aExtracting, ItemStack aEmpty, ItemStack aFull, FluidStack aFluidIn, FluidStack aFluidOut, Integer aDuration, Integer aEUt) {
ItemStack aInput;
ItemStack aOutput;
FluidStack aFluidInput;
@@ -35,7 +77,7 @@ public class RecipeGen_FluidCanning extends RecipeGen_Base {
// Safety check on the duration
if (aDuration == null || aDuration <= 0) {
- aDuration = (aFluid != null) ? (aFluid.amount / 62) : (1000 / 62);
+ aDuration = (aFluidIn != null) ? (aFluidIn.amount / 62) : ((aFluidOut != null) ? (aFluidOut.amount / 62) : 10);
}
// Safety check on the EU
@@ -52,14 +94,14 @@ public class RecipeGen_FluidCanning extends RecipeGen_Base {
if (aExtracting) {
aInput = aFull;
aOutput = aEmpty;
- aFluidInput = null;
- aFluidOutput = aFluid;
+ aFluidInput = GT_Values.NF;
+ aFluidOutput = aFluidIn;
}
else {
aInput = aEmpty;
- aOutput = aFull;
- aFluidInput = aFluid;
- aFluidOutput = null;
+ aOutput = aFull;
+ aFluidInput = aFluidIn;
+ aFluidOutput = aFluidOut != null ? aFluidOut : GT_Values.NF;
}
//Check validity
@@ -69,110 +111,118 @@ public class RecipeGen_FluidCanning extends RecipeGen_Base {
new ItemStack[] { aInput },
new ItemStack[] { aOutput },
null,
- new int[] {},
+ new int[] {10000},
new FluidStack[] { aFluidInput },
new FluidStack[] { aFluidOutput },
aDuration,
- 1,
+ aEUt,
0);
- // Not Valid
- if ((aExtracting && (aInput == null || aOutput == null ||aFluidOutput == null)) || (!aExtracting && (aInput == null || aOutput == null || aFluidInput == null))) {
- isValid = false;
- disableOptional = aExtracting;
- recipe = null;
+ // Check Valid
+ boolean aTempValidityCheck = false;
+ //Logger.INFO("Validity Check.");
+ if (aExtracting) {
+ Logger.INFO("Extracting.");
+ if (aInput != null && aFluidOutput != null) {
+ //Logger.INFO("Pass.");
+ aTempValidityCheck = true;
+ }
}
else {
+ //Logger.INFO("Canning.");
+ if (aInput != null && aOutput != null && (aFluidInput != null || aFluidOutput != null)) {
+ //Logger.INFO("Pass.");
+ aTempValidityCheck = true;
+ }
+ }
+
+
+ if (aTempValidityCheck) {
// Valid Recipe
recipe = aRecipe;
- mRecipeGenMap.add(this);
disableOptional = aExtracting;
- isValid = true;
+ isValid = true;
+ //Logger.INFO("Passed Validity Check. Hash: "+recipe.hashCode());
+ //Logger.INFO("Mapped as: "+(disableOptional ? "Extracting" : "Canning"));
+ addRunnableToRecipeCache(this);
+ }
+ else {
+ //Logger.INFO("Failed Validity Check.");
+ isValid = false;
+ disableOptional = aExtracting;
+ aRecipe.mEnabled = false;
+ aRecipe.mHidden = true;
+ recipe = null;
}
-
-
-
-
}
@Override
public void run() {
+ Logger.INFO("Processing Recipe with Hash: "+recipe.hashCode());
generateRecipes();
}
private void generateRecipes() {
- if (isValid && recipe != null) {
- //Used to store Fluid extraction state
+ if (isValid && recipe != null) {
+ //Logger.INFO("Processing "+(disableOptional ? "Extracting" : "Canning")+" Recipe.");
if (this.disableOptional) {
- addFluidExtractionRecipe(
- recipe.mInputs.length >= 1 ? recipe.mInputs[0] : null, //Input
- recipe.mInputs.length == 2 ? recipe.mInputs[1] : null, //Input 2
- recipe.mFluidOutputs.length == 1 ? recipe.mFluidOutputs[0] : null, //Fluid Output
- recipe.mDuration, //Duration
- recipe.mEUt //Eu Tick
- );
+ addFluidExtractionRecipe(recipe);
}
else {
- addFluidCannerRecipe(
- recipe.mInputs.length == 1 ? recipe.mInputs[0] : null, //Input
- recipe.mOutputs.length == 1 ? recipe.mOutputs[0] : null, //Input 2
- recipe.mFluidInputs.length == 1 ? recipe.mFluidInputs[0] : null //Fluid Input
- );
-
+ addFluidCannerRecipe(recipe);
}
-
- }
+ }
}
- private final boolean addFluidExtractionRecipe(final ItemStack aInput, final ItemStack aRemains, FluidStack aOutput, int aDuration, final int aEUt) {
- if (aInput == null || aOutput == null) {
- return false;
- }
- if (aOutput.isFluidEqual(Materials.PhasedGold.getMolten(1L))) {
- aOutput = Materials.VibrantAlloy.getMolten(aOutput.amount);
+ private final boolean addFluidExtractionRecipe(GT_Recipe aRecipe) {
+ boolean result = false;
+ int aCount1 = GT_Recipe_Map.sFluidExtractionRecipes.mRecipeList.size();
+ int aCount2 = aCount1;
+ GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(aRecipe);
+ aCount1 = GT_Recipe_Map.sFluidExtractionRecipes.mRecipeList.size();
+ result = aCount1 > aCount2;
+ if (result) {
+ //Logger.INFO("[FIND] Added Extraction recipe for "+ItemUtils.getArrayStackNames(aRecipe.mInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mOutputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidOutputs));
}
- if (aOutput.isFluidEqual(Materials.PhasedIron.getMolten(1L))) {
- aOutput = Materials.PulsatingIron.getMolten(aOutput.amount);
+ else {
+ Logger.INFO("[ERROR] Failed adding Extraction recipe for "+ItemUtils.getArrayStackNames(aRecipe.mInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mOutputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidOutputs));
+ //dumpStack();
}
- //Logger.INFO(buildLogString());
- boolean result = GT_Values.RA.addFluidExtractionRecipe(aInput, aRemains, aOutput, 10000, aDuration, aEUt);
- //Logger.INFO(buildLogString());
- //dumpStack();
return result;
}
- public final boolean addFluidCannerRecipe(final ItemStack aInput, final ItemStack aOutput, FluidStack aFluidInput) {
- if (aInput == null || aOutput == null || aFluidInput == null) {
- return false;
- }
- if (aFluidInput.isFluidEqual(Materials.PhasedGold.getMolten(1L))) {
- aFluidInput = Materials.VibrantAlloy.getMolten(aFluidInput.amount);
+ private final boolean addFluidCannerRecipe(GT_Recipe aRecipe) {
+ boolean result = false;
+ int aCount1 = GT_Recipe_Map.sFluidCannerRecipes.mRecipeList.size();
+ int aCount2 = aCount1;
+ GT_Recipe_Map.sFluidCannerRecipes.addRecipe(aRecipe);
+ aCount1 = GT_Recipe_Map.sFluidCannerRecipes.mRecipeList.size();
+ result = aCount1 > aCount2;
+ if (result) {
+ //Logger.INFO("[FIND] Added Canning recipe for "+ItemUtils.getArrayStackNames(aRecipe.mInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mOutputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidOutputs));
}
- if (aFluidInput.isFluidEqual(Materials.PhasedIron.getMolten(1L))) {
- aFluidInput = Materials.PulsatingIron.getMolten(aFluidInput.amount);
+ else {
+ Logger.INFO("[ERROR] Failed adding Canning recipe for "+ItemUtils.getArrayStackNames(aRecipe.mInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mOutputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidOutputs));
+ //dumpStack();
}
- //Logger.INFO(buildLogString());
- boolean result = GT_Values.RA.addFluidCannerRecipe(aInput, aOutput, aFluidInput, GT_Values.NF);
- //Logger.INFO(buildLogString());
- //dumpStack();
return result;
- }
-
+ }
+
private void dumpStack() {
int parents = 2;
for (int i=0;i<6;i++) {
Logger.INFO((disableOptional ? "EXTRACTING" : "CANNING")+" DEBUG | "+(i == 0 ? "Called from: " : "Parent: ")+ReflectionUtils.getMethodName(i+parents));
}
-
+
}
-
+
private String buildLogString() {
int solidSize = getMapSize(GT_Recipe_Map.sCannerRecipes);
int fluidSize = getMapSize(GT_Recipe_Map.sFluidCannerRecipes);
return (disableOptional ? "EXTRACTING" : "CANNING")+" DEBUG | Solids: "+solidSize+" | Liquids: "+fluidSize+" | ";
}
-
+
private final int getMapSize(GT_Recipe_Map aMap) {
return aMap.mRecipeList.size();
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java
index b3b71c7587..2b4e52abb9 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java
@@ -48,10 +48,9 @@ public class RecipeGen_Fluids extends RecipeGen_Base {
// Ingot
if (ItemUtils.checkForInvalidItems(material.getIngot(1)))
- if (CORE.RA.addFluidExtractionRecipe(material.getIngot(1), // Input
- null, // Input 2
+ if (CORE.RA.addFluidExtractionRecipe(
+ material.getIngot(1), // Input
material.getFluid(144), // Fluid Output
- 0, // Chance
1 * 20, // Duration
material.vVoltageMultiplier // Eu Tick
)) {
@@ -64,10 +63,9 @@ public class RecipeGen_Fluids extends RecipeGen_Base {
// Plate
if (ItemUtils.checkForInvalidItems(material.getPlate(1)))
- if (CORE.RA.addFluidExtractionRecipe(material.getPlate(1), // Input
- null, // Input 2
+ if (CORE.RA.addFluidExtractionRecipe(
+ material.getPlate(1), // Input
material.getFluid(144), // Fluid Output
- 0, // Chance
1 * 20, // Duration
material.vVoltageMultiplier // Eu Tick
)) {
@@ -80,10 +78,9 @@ public class RecipeGen_Fluids extends RecipeGen_Base {
// Double Plate
if (ItemUtils.checkForInvalidItems(material.getPlateDouble(1)))
- if (CORE.RA.addFluidExtractionRecipe(material.getPlateDouble(1), // Input
- null, // Input 2
+ if (CORE.RA.addFluidExtractionRecipe(
+ material.getPlateDouble(1), // Input
material.getFluid(288), // Fluid Output
- 0, // Chance
1 * 20, // Duration
material.vVoltageMultiplier // Eu Tick
)) {
@@ -96,10 +93,9 @@ public class RecipeGen_Fluids extends RecipeGen_Base {
// Nugget
if (ItemUtils.checkForInvalidItems(material.getNugget(1)))
- if (CORE.RA.addFluidExtractionRecipe(material.getNugget(1), // Input
- null, // Input 2
+ if (CORE.RA.addFluidExtractionRecipe(
+ material.getNugget(1), // Input
material.getFluid(16), // Fluid Output
- 0, // Chance
16, // Duration
material.vVoltageMultiplier // Eu Tick
)) {
@@ -112,10 +108,9 @@ public class RecipeGen_Fluids extends RecipeGen_Base {
// Block
if (ItemUtils.checkForInvalidItems(material.getBlock(1)))
- if (CORE.RA.addFluidExtractionRecipe(material.getBlock(1), // Input
- null, // Input 2
+ if (CORE.RA.addFluidExtractionRecipe(
+ material.getBlock(1), // Input
material.getFluid(144 * 9), // Fluid Output
- 0, // Chance
288, // Duration
material.vVoltageMultiplier // Eu Tick
)) {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java
index 52f7ab24f3..9b7e1d708d 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java
@@ -219,9 +219,10 @@ public class RecipeGen_Ore extends RecipeGen_Base {
Logger.MATERIALS("material.getCrushed(1): "+(material.getCrushed(1) != null));
Logger.MATERIALS("material.getCrushedPurified(1): "+(material.getCrushedPurified(1) != null));
- Logger.MATERIALS("bonusA.getTinyDust(1): "+(tinyDustA != null)+" | Material: "+(bonusA != null) + " | Material name: "+(bonusA != null ? bonusA.getLocalizedName() : "invalid material"));
- Logger.MATERIALS("bonusB.getTinyDust(1): "+(tinyDustB != null)+" | Material: "+(bonusB != null) + " | Material name: "+(bonusB != null ? bonusB.getLocalizedName() : "invalid material"));
+ Logger.MATERIALS("material.getTinyDust(1): "+(ItemUtils.getItemName(bonusA.getCrushed(1))));
+ Logger.MATERIALS("material.getTinyDust(1): "+(ItemUtils.getItemName(bonusB.getCrushed(1))));
+
try {
//.08 compat
if (GT_ModHandler.addThermalCentrifugeRecipe(material.getCrushed(1), 200, material.getCrushedCentrifuged(1), tinyDustB, dustStone)){
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java
index 3328b0894f..84188a44aa 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java
@@ -7,16 +7,11 @@ import java.util.Map;
import org.apache.commons.lang3.reflect.FieldUtils;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-
-import gregtech.api.enums.GT_Values;
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_Utility;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.data.Pair;
@@ -26,6 +21,8 @@ import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
public class RecipeGen_Recycling implements Runnable {
@@ -60,6 +57,7 @@ public class RecipeGen_Recycling implements Runnable {
public static void generateRecipes(final Material material) {
+ if (material != null)
Logger.WARNING("Generating Recycling recipes for " + material.getLocalizedName());
final OrePrefixes[] mValidPrefixesAsString = { OrePrefixes.ingot, OrePrefixes.ingotHot, OrePrefixes.nugget,
@@ -139,7 +137,7 @@ public class RecipeGen_Recycling implements Runnable {
//Fluid Extractor
if (ItemUtils.checkForInvalidItems(tempStack)) {
// mValidItems[mSlotIndex++] = tempStack;
- if ((mDust != null) && CORE.RA.addFluidExtractionRecipe(tempStack, null, material.getFluid(mFluidAmount), 0, 30, material.vVoltageMultiplier)) {
+ if ((mDust != null) && CORE.RA.addFluidExtractionRecipe(tempStack, material.getFluid(mFluidAmount), 30, material.vVoltageMultiplier)) {
Logger.WARNING("Fluid Recycle Recipe: " + material.getLocalizedName() + " - Success - Recycle "
+ tempStack.getDisplayName() + " and obtain " + mFluidAmount+"mb of "+material.getFluid(1).getLocalizedName()+".");
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java
new file mode 100644
index 0000000000..8a4ae1344a
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java
@@ -0,0 +1,202 @@
+package gtPlusPlus.xmod.gregtech.loaders.recipe;
+
+import java.util.HashMap;
+
+import gregtech.api.enums.GT_Values;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.Recipe_GT;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.api.objects.data.WeightedCollection;
+import gtPlusPlus.core.item.chemistry.AgriculturalChem;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
+public class RecipeLoader_AlgaeFarm {
+
+ private static final HashMap<Integer, AutoMap<GT_Recipe>> mRecipeCache = new HashMap<Integer, AutoMap<GT_Recipe>>();
+ private static final HashMap<Integer, AutoMap<GT_Recipe>> mRecipeCompostCache = new HashMap<Integer, AutoMap<GT_Recipe>>();
+
+ public static final void generateRecipes() {
+ for (int i=0;i<10;i++) {
+ getTieredRecipeFromCache(i, false);
+ }
+ for (int i=0;i<10;i++) {
+ getTieredRecipeFromCache(i, true);
+ }
+ }
+
+ public static GT_Recipe getTieredRecipeFromCache(int aTier, boolean aCompost) {
+ HashMap<Integer, AutoMap<GT_Recipe>> aMap = aCompost ? mRecipeCompostCache : mRecipeCache;
+ String aComp = aCompost ? "(Compost)" : "";
+
+ AutoMap<GT_Recipe> aTemp = aMap.get(aTier);
+ if (aTemp == null || aTemp.isEmpty()) {
+ aTemp = new AutoMap<GT_Recipe>();
+ aMap.put(aTier, aTemp);
+ Logger.INFO("Tier "+aTier+aComp+" had no recipes, initialising new map.");
+ }
+ if (aTemp.size() < 500) {
+ Logger.INFO("Tier "+aTier+aComp+" has less than 500 recipes, generating "+(500 - aTemp.size())+".");
+ for (int i=aTemp.size();i<500;i++) {
+ aTemp.put(generateBaseRecipe(aCompost, aTier));
+ }
+ }
+ int aIndex = MathUtils.randInt(0, aTemp.isEmpty() ? 1 : aTemp.size());
+ Logger.INFO("Using recipe with index of "+aIndex+". "+aComp);
+ return aTemp.get(aIndex);
+ }
+
+ private static GT_Recipe generateBaseRecipe(boolean aUsingCompost, int aTier) {
+
+ // Type Safety
+ if (aTier < 0) {
+ return null;
+ }
+
+ WeightedCollection<Float> aOutputTimeMulti = new WeightedCollection<Float>();
+ for (int i=100;i> 0;i--) {
+ float aValue = 0;
+ if (i < 10) {
+ aValue = 3f;
+ }
+ else if (i < 20) {
+ aValue = 2f;
+ }
+ else {
+ aValue = 1f;
+ }
+ aOutputTimeMulti.put(i, aValue);
+ }
+
+ final int[] aDurations = new int[] {
+ 432000,
+ 378000,
+ 216000,
+ 162000,
+ 108000,
+ 81000,
+ 54000,
+ 40500,
+ 27000,
+ 20250,
+ 13500,
+ 6750,
+ 3375,
+ 1686,
+ 843,
+ 421
+ };
+
+ ItemStack[] aInputs = new ItemStack[] {};
+
+ if (aUsingCompost) {
+ // Make it use 4 compost per tier if we have some available
+ ItemStack aCompost = ItemUtils.getSimpleStack(AgriculturalChem.mCompost, aTier * 4);
+ aInputs = new ItemStack[] {aCompost};
+ // Boost Tier by one if using compost so it gets a speed boost
+ aTier++;
+ }
+
+ // We set these elsewhere
+ ItemStack[] aOutputs = getOutputsForTier(aTier);
+
+ GT_Recipe tRecipe = new Recipe_GT(
+ false,
+ aInputs,
+ aOutputs,
+ (Object) null,
+ new int[] {},
+ new FluidStack[] {GT_Values.NF},
+ new FluidStack[] {GT_Values.NF},
+ (int) (aDurations[aTier] * aOutputTimeMulti.get()), // Time
+ 0,
+ 0);
+
+ tRecipe.mSpecialValue = tRecipe.hashCode();
+
+ return tRecipe;
+ }
+
+ private static ItemStack[] getOutputsForTier(int aTier) {
+
+ // 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)));
+ }
+ }
+ 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 >= 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 >= 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)));
+ }
+ }
+
+ // 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)));
+ }
+ }
+ }
+
+ // Map the AutoMap contents to an Itemstack Array.
+ ItemStack[] aOutputs = new ItemStack[aOutputMap.size()];
+ for (int i=0;i<aOutputMap.size();i++) {
+ aOutputs[i] = aOutputMap.get(i);
+ }
+
+ // Return filled ItemStack Array.
+ return aOutputs;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
index 3c996ef64f..efac0222af 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
@@ -7,11 +7,15 @@ import java.lang.reflect.Method;
import java.util.List;
import gregtech.api.GregTech_API;
+import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
import gregtech.api.interfaces.internal.IGT_RecipeAdder;
import gregtech.api.util.CustomRecipeMap;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.Recipe_GT;
import gregtech.api.util.SemiFluidFuelHandler;
@@ -19,7 +23,6 @@ import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
-import gtPlusPlus.core.material.ELEMENT;
import gtPlusPlus.core.material.MaterialGenerator;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.data.ArrayUtils;
@@ -681,6 +684,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
private static final Method mScannerTT;
private static final Method[] mChemicalRecipe = new Method[3];
private static final Method mLargeChemReactor;
+ private static final Method mPyroOven;
static {
@@ -707,6 +711,17 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
if (ttTest != null) {
T = ttTest;
}
+ else {
+ Method[] aDump = TTRecipeAdder.getDeclaredMethods();
+ for (Method m : aDump) {
+ if (m != null) {
+ Logger.INFO("Found "+m.getName()+" | "+m.getModifiers()+" | "+ArrayUtils.toString(m.getParameters(), "EMPTY")+"");
+ if (m.getName().toLowerCase().equals("addresearchableassemblylinerecipe")){
+ Logger.INFO("Types: "+ArrayUtils.toString(m.getParameterTypes()));
+ }
+ }
+ }
+ }
}
}
else {
@@ -719,6 +734,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
mLargeChemReactor = ReflectionUtils.getMethod(clazz, "addMultiblockChemicalRecipe", ItemStack[].class, FluidStack[].class, FluidStack[].class, ItemStack[].class, int.class, int.class);
+ mPyroOven = ReflectionUtils.getMethod(clazz, "addPyrolyseRecipe", ItemStack.class, FluidStack.class, int.class, ItemStack.class, FluidStack.class, int.class, int.class);
+
}
@@ -727,6 +744,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
mAssemblyLine = null;
mLargeChemReactor = null;
mScannerTT = null;
+ mPyroOven = null;
}
@@ -788,7 +806,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
Logger.INFO("Failed to generate TecTech recipe for "+ItemUtils.getItemName(aResearchItem)+", please report this to Alkalus.");
}
catch (Throwable t) {
-
+ t.printStackTrace();
}
}
return (boolean) mAssemblyLine.invoke(GT_Values.RA, aResearchItem, aResearchTime, aInputs,
@@ -991,15 +1009,29 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
}
@Override
- public boolean addFluidExtractionRecipe(ItemStack input, ItemStack input2, FluidStack output, int aTime, int aEu, int aSpecial) {
- Method aExtractionMethod = ReflectionUtils.getMethod(MaterialGenerator.class, "addFluidExtractionRecipe", new Class[] {ItemStack.class, ItemStack.class, FluidStack.class, int.class, int.class});
- return ReflectionUtils.invoke(null, aExtractionMethod, new Object[] {input, input2, output, aSpecial, aTime, aEu});
+ public boolean addFluidExtractionRecipe(ItemStack input, FluidStack output, int aTime, int aEu) {
+ return MaterialGenerator.addFluidExtractionRecipe(GT_Values.NI, input, output, aTime, aEu);
+ }
+
+ @Override
+ public boolean addFluidExtractionRecipe(ItemStack aEmpty, ItemStack aRemains, FluidStack aFluid, int aDuration, int aEU) {
+ return MaterialGenerator.addFluidExtractionRecipe(aEmpty, aRemains, aFluid, aDuration, aEU);
}
@Override
- public boolean addFluidCannerRecipe(ItemStack aFullContainer, ItemStack container, FluidStack rFluidIn, FluidStack rFluidOut) {
- Method aExtractionMethod = ReflectionUtils.getMethod(MaterialGenerator.class, "addFluidCannerRecipe", new Class[] {ItemStack.class, ItemStack.class, FluidStack.class});
- return ReflectionUtils.invoke(null, aExtractionMethod, new Object[] {aFullContainer, container, rFluidIn, rFluidOut});
+ public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn) {
+ return MaterialGenerator.addFluidCannerRecipe(aContainer, aFullContainer, rFluidIn, null);
+ }
+
+ @Override
+ public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn, FluidStack rFluidOut) {
+ return MaterialGenerator.addFluidCannerRecipe(aContainer, aFullContainer, rFluidIn, rFluidOut);
+ }
+
+
+ @Override
+ public boolean addFluidCannerRecipe(ItemStack aFullContainer, ItemStack container, FluidStack rFluidIn, FluidStack rFluidOut, int aTime, int aEu) {
+ return MaterialGenerator.addFluidCannerRecipe(container, aFullContainer, rFluidIn, rFluidOut, aTime, aEu);
}
/**
@@ -1149,6 +1181,128 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
}
+ @Override
+ public boolean addFluidReactorRecipe(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));
+ Logger.INFO("Fluid Inputs: "+ItemUtils.getArrayStackNames(aInputFluids));
+ Logger.INFO("Outputs: "+ItemUtils.getArrayStackNames(aOutputs));
+ Logger.INFO("Fluid Outputs: "+ItemUtils.getArrayStackNames(aFluidOutputs));
+ CORE.crash();
+ }
+
+
+ Recipe_GT aSpecialRecipe = new Recipe_GT(
+ false,
+ aInputs,
+ aOutputs,
+ null,
+ new int[] {},
+ aInputFluids,
+ aFluidOutputs,
+ time,
+ (int) eu,
+ aTier);
+
+ int aSize = Recipe_GT.Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.mRecipeList.size();
+ int aSize2 = aSize;
+ Recipe_GT.Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.add(aSpecialRecipe);
+ aSize = Recipe_GT.Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.mRecipeList.size();
+ return aSize > aSize2;
+ }
+
+ @Override
+ public boolean addBlastRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int time, long eu, int aHeat) {
+ Recipe_GT aSpecialRecipe = new Recipe_GT(
+ false,
+ aInputs,
+ aOutputs,
+ null,
+ new int[] {},
+ aInputFluids,
+ aFluidOutputs,
+ time,
+ (int) eu,
+ aHeat);
+
+ int aSize = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.size();
+ int aSize2 = aSize;
+ GT_Recipe.GT_Recipe_Map.sBlastRecipes.add(aSpecialRecipe);
+ aSize = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.size();
+ return aSize > aSize2;
+
+ }
+
+ @Override
+ public boolean addPyrolyseRecipe(ItemStack aInput, FluidStack aFluidInput, int intCircuit, ItemStack aOutput, FluidStack aFluidOutput, int aDuration, int aEUt) {
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || mPyroOven == null) {
+ return false;
+ }
+ try {
+ return (boolean) mPyroOven.invoke(GT_Values.RA, aInput, aFluidInput, intCircuit, aOutput, aFluidOutput, aDuration, aEUt);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden) {
+ if (aInput != null && aOutput != null) {
+ if ((aDuration = GregTech_API.sRecipeFile.get("distillery", aOutput.getFluid().getUnlocalizedName(),
+ aDuration)) <= 0) {
+ return false;
+ } else {
+ GT_Recipe tRecipe = GT_Recipe_Map.sDistilleryRecipes.addRecipe(true, new ItemStack[]{aCircuit},
+ new ItemStack[] {aSolidOutput}, (Object) null, new FluidStack[]{aInput}, new FluidStack[]{aOutput},
+ aDuration, aEUt, 0);
+ if (aHidden && tRecipe != null) {
+ tRecipe.mHidden = true;
+ }
+ return true;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt) {
+ if (aInput != null && aOutput != null) {
+ if ((aDuration = GregTech_API.sRecipeFile.get("extractor", aInput, aDuration)) <= 0) {
+ return false;
+ } else {
+ GT_Recipe_Map.sExtractorRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput},
+ (Object) null, (FluidStack[]) null, (FluidStack[]) null, aDuration, aEUt, 0);
+ return true;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3) {
+ //return GT_Values.RA.addPulveriserRecipe(arg0, arg1, arg2, arg3, arg4)
+
+ aOutput1 = GT_OreDictUnificator.get(true, aOutput1);
+ aOutput2 = GT_OreDictUnificator.get(true, aOutput2);
+ aOutput3 = GT_OreDictUnificator.get(true, aOutput3);
+ if ((GT_Utility.isStackInvalid(aInput)) || (GT_Utility.isStackInvalid(aOutput1))) {
+ return false;
+ }
+ if (GT_Utility.getContainerItem(aInput, false) == null) {
+
+ if (GregTech_API.sRecipeFile.get(ConfigCategories.Machines.maceration, aInput, true)) {
+ GT_Utility.addSimpleIC2MachineRecipe(aInput, GT_ModHandler.getMaceratorRecipeList(), null,
+ new Object[] { aOutput1 });
+ }
+ GT_Values.RA.addPulveriserRecipe(aInput, new ItemStack[] { aOutput1, aOutput2, aOutput3 },
+ new int[] { 10000, 10000, 10000 }, 400, 2);
+ }
+ return true;
+
+ }
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java
new file mode 100644
index 0000000000..2c9f1d1943
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java
@@ -0,0 +1,28 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.algae.GregtechMTE_AlgaePondBase;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.chemplant.GregtechMTE_ChemicalPlant;
+
+public class GregtechAlgaeContent {
+
+ public static void run() {
+ if (LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Algae Content.");
+ run1();
+ }
+ }
+
+ private static void run1() {
+
+ // Algae Pond
+ GregtechItemList.AlgaeFarm_Controller.set(new GregtechMTE_AlgaePondBase(997, "algaefarm.controller.tier.single", "Algae Farm").getStackForm(1L));
+
+ // Chemical Plant
+ GregtechItemList.ChemicalPlant_Controller.set(new GregtechMTE_ChemicalPlant(998, "chemicalplant.controller.tier.single", "ExxonMobil Chemical Plant").getStackForm(1L));
+
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java
index 45a23fb184..54e4fbf024 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java
@@ -8,9 +8,11 @@ import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_AirIntake;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_ControlCore;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler_Adv;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Naquadah;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_TurbineProvider;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_SuperBus_Input;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_SuperBus_Output;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GT_MetaTileEntity_Hatch_CustomFluidBase;
@@ -62,6 +64,25 @@ public class GregtechCustomHatches {
"Naquadah Reactor Input hatch" // Local name
).getStackForm(1L));
+
+ GregtechItemList.Hatch_Input_TurbineHousing.set(new GT_MetaTileEntity_Hatch_TurbineProvider(31025, // ID
+ "hatch.turbine.input.tier.00", // unlocal name
+ "Turbine Housing", // Local name
+ 8
+ ).getStackForm(1L));
+
+ // Multiblock Control Core Bus
+ GregtechItemList.Hatch_Control_Core.set((new GT_MetaTileEntity_Hatch_ControlCore(30020, "hatch.control.adv", "Control Core Module", 1)).getStackForm(1L));
+
+ // Multiblock Air Intake Hatch
+ GregtechItemList.Hatch_Air_Intake.set(new GT_MetaTileEntity_Hatch_AirIntake(861, "hatch.air.intake.tier.00", "Air Intake Hatch", 5).getStackForm(1L));
+
+
+
+
+
+
+
}
private static void run2() {
@@ -91,12 +112,7 @@ public class GregtechCustomHatches {
.getStackForm(1L));
GregtechItemList.Hatch_Muffler_Adv_MAX
.set((new GT_MetaTileEntity_Hatch_Muffler_Adv(30009, "hatch.muffler.adv.tier.09", "Advanced Muffler Hatch (MAX)", 9))
- .getStackForm(1L));
-
- //GT++ multiblock Control Core Bus
- GregtechItemList.Hatch_Control_Core
- .set((new GT_MetaTileEntity_Hatch_ControlCore(30020, "hatch.control.adv", "Control Core Module", 1))
- .getStackForm(1L));
+ .getStackForm(1L));
}
private static void run3() {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java
new file mode 100644
index 0000000000..bd0edd9002
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java
@@ -0,0 +1,24 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaTileEntity_ChemicalReactor;
+
+public class GregtechFluidReactor {
+
+ public static void run() {
+
+ GregtechItemList.FluidReactor_LV
+ .set(new GregtechMetaTileEntity_ChemicalReactor(31021, "chemicalplant.01.tier.01", "Chemical Plant I", 1)
+ .getStackForm(1L));
+ GregtechItemList.FluidReactor_HV
+ .set(new GregtechMetaTileEntity_ChemicalReactor(31022, "chemicalplant.01.tier.02", "Chemical Plant II", 3)
+ .getStackForm(1L));
+ GregtechItemList.FluidReactor_IV
+ .set(new GregtechMetaTileEntity_ChemicalReactor(31023, "chemicalplant.01.tier.03", "Chemical Plant III", 5)
+ .getStackForm(1L));
+ GregtechItemList.FluidReactor_ZPM
+ .set(new GregtechMetaTileEntity_ChemicalReactor(31024, "chemicalplant.01.tier.04", "Chemical Plant IV", 7)
+ .getStackForm(1L));
+
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPollutionDevices.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPollutionDevices.java
index bbe2d10273..c470243822 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPollutionDevices.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPollutionDevices.java
@@ -2,8 +2,8 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
-import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_AirIntake;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaAtmosphericReconditioner;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaPollutionCreator;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaPollutionDetector;
@@ -12,8 +12,8 @@ public class GregtechPollutionDevices {
public static void run() {
if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
- Logger.INFO("Gregtech5u Content | Registering Anti-Pollution Devices.");
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ if (PollutionUtils.isPollutionEnabled()) {
+ Logger.INFO("Gregtech5u Content | Registering Anti-Pollution Devices.");
run1();
}
}
@@ -50,7 +50,6 @@ public class GregtechPollutionDevices {
"pollutioncleaner.10.tier.single", "Biosphere Cleanser", 9).getStackForm(1L));
}
- GregtechItemList.Hatch_Air_Intake.set(new GT_MetaTileEntity_Hatch_AirIntake(861, "hatch.air.intake.tier.00", "Air Intake Hatch", 5).getStackForm(1L));
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java
index b8dd8e4767..2d548a57b7 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java
@@ -12,6 +12,7 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.material.ALLOY;
import gtPlusPlus.core.recipe.common.CI;
+import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GregtechMetaTileEntityRocketFuelGenerator;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMetaTileEntity_LargeRocketEngine;
@@ -32,12 +33,15 @@ public class GregtechRocketFuelGenerator {
GregtechItemList.Controller_RocketEngine.set(
new GregtechMetaTileEntity_LargeRocketEngine(996, "gtpp.multimachine.rocketengine", "Rocketdyne F-1A Engine").getStackForm(1L));
+
+ ItemList aDieselEngine = Utils.getValueOfItemList("Machine_Multi_DieselEngine", ItemList.Machine_Multi_LargeBoiler_TungstenSteel);
+
GT_ModHandler.addCraftingRecipe(
GregtechItemList.Controller_RocketEngine.get(1L),
CI.bitsd,
new Object[]{
"PCP", "EME", "GWG",
- 'M', ItemList.Machine_Multi_DieselEngine,
+ 'M', aDieselEngine,
'P', ItemList.Electric_Piston_IV,
'E', ItemList.Field_Generator_EV,
'C', OrePrefixes.circuit.get(Materials.Master),
diff --git a/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java b/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java
index e394a8b8c0..686910b9aa 100644
--- a/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java
+++ b/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java
@@ -221,10 +221,10 @@ public class FishTrapHandler {
private static void addGregtechFluidRecipe(final ItemStack input){
if (LoadedMods.Gregtech){
if (CORE.GTNH) {
- CORE.RA.addFluidExtractionRecipe(input, null, FluidUtils.getFluidStack("fishoil", 50), 10000, 16, 4);
+ CORE.RA.addFluidExtractionRecipe(input, FluidUtils.getFluidStack("fishoil", 50), 16, 4);
}
else {
- CORE.RA.addFluidExtractionRecipe(input, null, FluidUtils.getFluidStack("fishoil", 4), 0, 16, 4); //4eu/t total eu used = 64 so time = 64/4
+ CORE.RA.addFluidExtractionRecipe(input, FluidUtils.getFluidStack("fishoil", 4), 16, 4); //4eu/t total eu used = 64 so time = 64/4
}
}
}
diff --git a/src/Java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java b/src/Java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java
new file mode 100644
index 0000000000..92d711101b
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java
@@ -0,0 +1,276 @@
+package gtPlusPlus.xmod.ic2.item;
+
+import java.util.List;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.util.Utils;
+import ic2.api.item.IKineticRotor;
+import ic2.core.IC2;
+import ic2.core.block.kineticgenerator.gui.GuiWaterKineticGenerator;
+import ic2.core.block.kineticgenerator.gui.GuiWindKineticGenerator;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.util.StatCollector;
+
+public class CustomKineticRotor extends Item implements IKineticRotor {
+
+ private final int mTier;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon[] mTextures;
+
+ private static final String[] mRegistrationNames = new String[] {
+ "itemwoodrotor", "itemironrotor", "itemsteelrotor", "itemwcarbonrotor"
+ };
+
+ private static final String[] mUnlocalNames = new String[] {
+ "itemEnergeticRotor",
+ "itemTungstenSteelRotor",
+ "itemVibrantRotor",
+ "itemIridiumRotor",
+ "itemMagnaliumRotor",
+ "itemUltimetRotor",
+ };
+ private static final int[] mMaxDurability = new int[] {
+ 512000, 809600, 1600000, 3200000
+ };
+ private static final int[] mRadius = new int[] {
+ 9, 11, 13, 15
+ };
+ private static final float[] mEfficiency = new float[] {
+ 0.9f, 1.0f, 1.2f, 1.5f
+ };
+ private static final int[] mMinWindStrength = new int[] {
+ 12, 14, 16, 18
+ };
+ private static final int[] mMaxWindStrength = new int[] {
+ 80, 120, 160, 320
+ };
+
+ private static final ResourceLocation[] mResourceLocations = new ResourceLocation[] {
+ new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorEnergeticModel.png"),
+ new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorTungstenSteelModel.png"),
+ new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorVibrantModel.png"),
+ new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorIridiumModel.png"),
+ new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorMagnaliumModel.png"),
+ new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorUltimetModel.png"),
+ };
+
+ private final int maxWindStrength;
+ private final int minWindStrength;
+ private final int radius;
+ private final float efficiency;
+ private final ResourceLocation renderTexture;
+
+ public CustomKineticRotor(int aTier) {
+ mTier = aTier;
+ this.setMaxStackSize(1);
+ // Handle Differences if EIO is not loaded
+ if (!LoadedMods.EnderIO && (aTier == 0 || aTier == 2)) {
+ this.renderTexture = mResourceLocations[(aTier == 0 ? 4 : 5)];
+ this.setUnlocalizedName(mUnlocalNames[(aTier == 0 ? 4 : 5)]);
+ }
+ else {
+ this.renderTexture = mResourceLocations[aTier];
+ this.setUnlocalizedName(mUnlocalNames[aTier]);
+ }
+ this.setMaxDamage(mMaxDurability[aTier]);
+ this.radius = mRadius[aTier];
+ this.efficiency = mEfficiency[aTier];
+ this.minWindStrength = mMinWindStrength[aTier];
+ this.maxWindStrength = mMaxWindStrength[aTier];
+ this.setNoRepair();
+ this.setCreativeTab(IC2.tabIC2);
+ GameRegistry.registerItem(this, mRegistrationNames[aTier]);
+ }
+
+ @Override
+ public void setDamage(final ItemStack stack, final int damage) {
+ if (mTier < 3) {
+ super.setDamage(stack, damage);
+ }
+ }
+
+ @Override
+ public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List info, final boolean b) {
+
+ info.add(StatCollector.translateToLocalFormatted("ic2.itemrotor.wind.info", new Object[]{this.minWindStrength, this.maxWindStrength}));
+
+ GearboxType type = null;
+ if (Minecraft.getMinecraft().currentScreen != null && Minecraft.getMinecraft().currentScreen instanceof GuiWaterKineticGenerator) {
+ type = GearboxType.WATER;
+ }
+ else if (Minecraft.getMinecraft().currentScreen != null && Minecraft.getMinecraft().currentScreen instanceof GuiWindKineticGenerator) {
+ type = GearboxType.WIND;
+ }
+
+ if (type != null) {
+ info.add(StatCollector.translateToLocal("ic2.itemrotor.fitsin." + this.isAcceptedType(itemStack, type)));
+ }
+
+ }
+
+ @Override
+ public int getDiameter(final ItemStack stack)
+ {
+ return this.radius;
+ }
+
+ @Override
+ public ResourceLocation getRotorRenderTexture(final ItemStack stack)
+ {
+ return this.renderTexture;
+ }
+
+ @Override
+ public float getEfficiency(final ItemStack stack)
+ {
+ return this.efficiency;
+ }
+
+ @Override
+ public int getMinWindStrength(final ItemStack stack)
+ {
+ return this.minWindStrength;
+ }
+
+ @Override
+ public int getMaxWindStrength(final ItemStack stack)
+ {
+ return this.maxWindStrength;
+ }
+
+ @Override
+ public boolean isAcceptedType(final ItemStack stack, final IKineticRotor.GearboxType type){
+ return (type == IKineticRotor.GearboxType.WIND) || (type == IKineticRotor.GearboxType.WATER);
+ }
+
+ public String getUnlocalizedName() {
+ return "ic2." + super.getUnlocalizedName().substring(5);
+ }
+
+ public String getUnlocalizedName(ItemStack itemStack) {
+ return this.getUnlocalizedName();
+ }
+
+ public String getItemStackDisplayName(ItemStack itemStack) {
+ return StatCollector.translateToLocal(this.getUnlocalizedName(itemStack));
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return mTier < 3;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIconFromDamage(int meta) {
+ if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) {
+ if (mTier == 0) {
+ return mTextures[4];
+ }
+ else {
+ return mTextures[5];
+ }
+ }
+ else {
+ return mTextures[mTier];
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIconIndex(ItemStack aIndex) {
+ if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) {
+ if (mTier == 0) {
+ return mTextures[4];
+ }
+ else {
+ return mTextures[5];
+ }
+ }
+ else {
+ return mTextures[mTier];
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIconFromDamageForRenderPass(int aDmg, int aPass) {
+ if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) {
+ if (mTier == 0) {
+ return mTextures[4];
+ }
+ else {
+ return mTextures[5];
+ }
+ }
+ else {
+ return mTextures[mTier];
+ }
+ }
+
+ @Override
+ protected String getIconString() {
+ return super.getIconString();
+ }
+
+ @Override
+ public int getDisplayDamage(ItemStack stack) {
+ return super.getDisplayDamage(stack);
+ }
+
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack) {
+ return super.getDurabilityForDisplay(stack);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
+ if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) {
+ if (mTier == 0) {
+ return mTextures[4];
+ }
+ else {
+ return mTextures[5];
+ }
+ }
+ else {
+ return mTextures[mTier];
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(ItemStack stack, int pass) {
+ if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) {
+ if (mTier == 0) {
+ return mTextures[4];
+ }
+ else {
+ return mTextures[5];
+ }
+ }
+ else {
+ return mTextures[mTier];
+ }
+ }
+
+ @Override
+ public void registerIcons(IIconRegister iconRegister) {
+ int aIndex = 0;
+ mTextures = new IIcon[6];
+ for (String y : mUnlocalNames) {
+ mTextures[aIndex++] = iconRegister.registerIcon(IC2.textureDomain + ":" + "rotors/" + y);
+ }
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java b/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java
index 64aa7f99bf..862ba38748 100644
--- a/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java
+++ b/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java
@@ -1,13 +1,9 @@
package gtPlusPlus.xmod.ic2.item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.ResourceLocation;
-
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.item.base.CoreItem;
import gtPlusPlus.core.lib.LoadedMods;
-import ic2.core.IC2;
-import ic2.core.init.InternalName;
+import net.minecraft.item.ItemStack;
public class IC2_Items {
@@ -29,45 +25,33 @@ public class IC2_Items {
public static ItemStack blockRTG;
public static ItemStack blockKineticGenerator;
- public static void register(){
+ private static final String[] mData1 = new String[] {"itemEnergeticRotorBlade", "itemMagnaliumRotorBlade"};
+ private static final String[] mData2 = new String[] {"itemEnergeticShaft", "itemMagnaliumShaft"};
+ private static final String[] mData3 = new String[] {"itemVibrantRotorBlade", "itemUltimetRotorBlade"};
+ private static final String[] mData4 = new String[] {"itemVibrantShaft", "itemUltimetShaft"};
+
- if(LoadedMods.EnderIO){
- //Tier 1
- rotor_Blade_Material_1 = new ItemStack (new CoreItem("itemEnergeticRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- shaft_Material_1 = new ItemStack (new CoreItem("itemEnergeticShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- rotor_Material_1 = new ItemStack (new RotorBase(InternalName.itemwoodrotor, 9, 512000, 0.9F, 12, 80, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorEnergeticModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemEnergeticRotor"));
- //Tier 2
- rotor_Blade_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- shaft_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- rotor_Material_2 = new ItemStack (new RotorBase(InternalName.itemironrotor, 11, 809600, 1.0F, 14, 120, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorTungstenSteelModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemTungstenSteelRotor"));
- //Tier 3
- rotor_Blade_Material_3 = new ItemStack (new CoreItem("itemVibrantRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- shaft_Material_3 = new ItemStack (new CoreItem("itemVibrantShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- rotor_Material_3 = new ItemStack (new RotorBase(InternalName.itemsteelrotor, 13, 1600000, 1.2F, 16, 160, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorVibrantModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemVibrantRotor"));
- //Tier 4
- rotor_Blade_Material_4 = new ItemStack (new CoreItem("itemIridiumRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- shaft_Material_4 = new ItemStack (new CoreItem("itemIridiumShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- rotor_Material_4 = new ItemStack (new RotorIridium(InternalName.itemwcarbonrotor, 15, 3200000, 1.5F, 18, 320, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorIridiumModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemIridiumRotor"));
+ public static void register(){
- }
- else {
- //Tier 1 - Magnalium
- rotor_Blade_Material_1 = new ItemStack (new CoreItem("itemMagnaliumRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- shaft_Material_1 = new ItemStack (new CoreItem("itemMagnaliumShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- rotor_Material_1 = new ItemStack (new RotorBase(InternalName.itemwoodrotor, 9, 512000, 0.9F, 12, 80, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorMagnaliumModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemMagnaliumRotor"));
- //Tier 2
- rotor_Blade_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- shaft_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- rotor_Material_2 = new ItemStack (new RotorBase(InternalName.itemironrotor, 11, 809600, 1.0F, 14, 120, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorTungstenSteelModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemTungstenSteelRotor"));
- //Tier 3 - Ultimet
- rotor_Blade_Material_3 = new ItemStack (new CoreItem("itemUltimetRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- shaft_Material_3 = new ItemStack (new CoreItem("itemUltimetShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- rotor_Material_3 = new ItemStack (new RotorBase(InternalName.itemsteelrotor, 13, 1600000, 1.2F, 16, 160, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorUltimetModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemUltimetRotor"));
- //Tier 4
- rotor_Blade_Material_4 = new ItemStack (new CoreItem("itemIridiumRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- shaft_Material_4 = new ItemStack (new CoreItem("itemIridiumShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- rotor_Material_4 = new ItemStack (new RotorIridium(InternalName.itemwcarbonrotor, 15, 3200000, 1.5F, 18, 320, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorIridiumModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemIridiumRotor"));
- }
+ int aIndexEIO = (LoadedMods.EnderIO ? 0 : 1);
+
+ // Rotor Blades
+ rotor_Blade_Material_1 = new ItemStack (new CoreItem(mData1[aIndexEIO], AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ rotor_Blade_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ rotor_Blade_Material_3 = new ItemStack (new CoreItem(mData3[aIndexEIO], AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ rotor_Blade_Material_4 = new ItemStack (new CoreItem("itemIridiumRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+
+ // Rotor Shafts
+ shaft_Material_1 = new ItemStack (new CoreItem(mData2[aIndexEIO], AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ shaft_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ shaft_Material_3 = new ItemStack (new CoreItem(mData4[aIndexEIO], AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ shaft_Material_4 = new ItemStack (new CoreItem("itemIridiumShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+
+ // Rotors
+ rotor_Material_1 = new ItemStack (new CustomKineticRotor(0));
+ rotor_Material_2 = new ItemStack (new CustomKineticRotor(1));
+ rotor_Material_3 = new ItemStack (new CustomKineticRotor(2));
+ rotor_Material_4 = new ItemStack (new CustomKineticRotor(3));
}
}
diff --git a/src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java b/src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java
index aca1c6a310..b9dffbd371 100644
--- a/src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java
+++ b/src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java
@@ -118,5 +118,10 @@ public class RotorIridium extends RotorBase{
this.setCustomDamage(stack, this.getCustomDamage(stack) + damage);
return true;
}
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/reliquary/util/ReliquaryRecipeHandler.java b/src/Java/gtPlusPlus/xmod/reliquary/util/ReliquaryRecipeHandler.java
index b79a4f45a5..1133e67fe6 100644
--- a/src/Java/gtPlusPlus/xmod/reliquary/util/ReliquaryRecipeHandler.java
+++ b/src/Java/gtPlusPlus/xmod/reliquary/util/ReliquaryRecipeHandler.java
@@ -2,7 +2,6 @@ package gtPlusPlus.xmod.reliquary.util;
import static gtPlusPlus.core.lib.CORE.GTNH;
-import gregtech.api.enums.GT_Values;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
import gtPlusPlus.api.objects.Logger;
@@ -45,7 +44,7 @@ public class ReliquaryRecipeHandler {
Logger.INFO("Finished removing original recipes.");
// Add new recipes
- if (GT_Values.RA.addChemicalRecipe(ALLOY.ENERGYCRYSTAL.getDust(4), ReliquaryItems.emptyVial(), FluidUtils.getHotWater(2000), null, ReliquaryItems.glowingWater(), 20 * 30, 500)) {
+ if (CORE.RA.addChemicalRecipe(ALLOY.ENERGYCRYSTAL.getDust(4), ReliquaryItems.emptyVial(), FluidUtils.getHotWater(2000), null, ReliquaryItems.glowingWater(), 20 * 30, 500)) {
Logger.INFO("Added new recipe for Glowing Water.");
}
if (CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {ItemUtils.simpleMetaStack(Items.ender_eye, 0, 32), CI.getFieldGenerator(5, GTNH ? 8 : 4), CI.getTieredComponent(OrePrefixes.plate, 5, GTNH ? 16 : 8), CI.getEmitter(3, 20)}, FluidUtils.getUUM(50), ReliquaryItems.emptyVoidTear(), 20 * 2000, 2000)){
diff --git a/src/Java/gtPlusPlus/xmod/thaumcraft/util/ThaumcraftUtils.java b/src/Java/gtPlusPlus/xmod/thaumcraft/util/ThaumcraftUtils.java
index 8beaa8df5e..f23a5db6fe 100644
--- a/src/Java/gtPlusPlus/xmod/thaumcraft/util/ThaumcraftUtils.java
+++ b/src/Java/gtPlusPlus/xmod/thaumcraft/util/ThaumcraftUtils.java
@@ -38,8 +38,18 @@ import net.minecraft.world.World;
public class ThaumcraftUtils {
- private static Class mClass_Aspect;
+ private static Class<?> mClass_Aspect;
private static Field mField_Aspects;
+
+ static {
+ mClass_Aspect = ReflectionUtils.getClass("thaumcraft.api.aspects.Aspect");
+ if (mClass_Aspect != null) {
+ Field aTagF = ReflectionUtils.getField(mClass_Aspect, "tag");
+ if (aTagF != null) {
+ mField_Aspects = aTagF;
+ }
+ }
+ }
public static boolean addAspectToItem(ItemStack item, TC_Aspect_Wrapper aspect, int amount) {
return addAspectToItem(item, new TC_Aspect_Wrapper[] {aspect}, new Integer[] {amount});
@@ -212,10 +222,10 @@ public class ThaumcraftUtils {
}
- private static final Class mClass_ThaumcraftApi;
- private static final Class mClass_ThaumcraftApiHelper;
- private static final Class mClass_AspectList;
- private static final Class mClass_ResearchManager;
+ private static final Class<?> mClass_ThaumcraftApi;
+ private static final Class<?> mClass_ThaumcraftApiHelper;
+ private static final Class<?> mClass_AspectList;
+ private static final Class<?> mClass_ResearchManager;
private static final Method mMethod_registerObjectTag1;
private static final Method mMethod_registerObjectTag2;
private static final Method mMethod_registerComplexObjectTag;
@@ -336,12 +346,11 @@ public class ThaumcraftUtils {
public static String getTagFromAspectObject(Object aAspect) {
- try {
- Field aTagF = ReflectionUtils.getField(mClass_Aspect, "tag");
- if (aTagF == null) {
+ try {
+ if (mClass_Aspect == null || mField_Aspects == null) {
return null;
- }
- String aTafB = (String) aTagF.get(aAspect);
+ }
+ String aTafB = (String) mField_Aspects.get(aAspect);
if (aTafB == null) {
return null;
}
diff --git a/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java b/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java
index 1b2541ff3a..85485b5565 100644
--- a/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java
+++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java
@@ -12,6 +12,7 @@ import gregtech.api.util.GT_OreDictUnificator;
import cofh.lib.util.helpers.ItemHelper;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.thermalfoundation.item.TF_Items;
import net.minecraftforge.fluids.FluidRegistry;
@@ -25,34 +26,23 @@ public class TF_Gregtech_Recipes {
private static void start(){
//Get Items to work with
- final ItemStack dust_Cryotheum = TF_Items.itemDustCryotheum.copy();
- final ItemStack dust_Pyrotheum = TF_Items.itemDustPyrotheum.copy();
- final ItemStack dust_Blizz = TF_Items.itemDustBlizz.copy();
- final ItemStack dust_Blizz3 = ItemUtils.simpleMetaStack(TF_Items.itemMaterial, 2, 3);
- final ItemStack rod_Blizz = TF_Items.itemRodBlizz.copy();
+ final ItemStack dust_Cryotheum = ItemUtils.getItemStackOfAmountFromOreDict("dustCryotheum", 1);
+ final ItemStack dust_Pyrotheum = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Pyrotheum, 1L);
+ final ItemStack dust_Blizz = ItemUtils.getItemStackOfAmountFromOreDict("dustBlizz", 1);
+ final ItemStack dust_Blizz3 = ItemUtils.getItemStackOfAmountFromOreDict("dustBlizz", 3);
+ final ItemStack rod_Blizz = ItemUtils.getItemStackOfAmountFromOreDict("stickBlizz", 1);
+
final FluidStack moltenBlaze = getFluidStack("molten.blaze", 1440);
//Gelid Cryotheum
- Logger.INFO("Adding Recipes for Gelid Cryotheum");
- CORE.RA.addFluidExtractionRecipe(dust_Cryotheum, GT_Values.NI, getFluidStack("cryotheum", 250), 10000, 200, 240);
GT_Values.RA.addChemicalBathRecipe((GT_OreDictUnificator.get(OrePrefixes.ore, Materials.Cinnabar, 1L)), getFluidStack("cryotheum", 144), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cinnabar, 3L), GT_Values.NI, GT_Values.NI, null, 400, 30);
//Blizz Powder
- Logger.INFO("Adding Recipes for Blizz Powder");
GT_Values.RA.addChemicalBathRecipe(new ItemStack(Items.snowball, 4), moltenBlaze, dust_Blizz, GT_Values.NI, GT_Values.NI, null, 400, 240);
//Blizz Rod
- Logger.INFO("Adding Recipes for Blizz Rod");
GT_Values.RA.addVacuumFreezerRecipe(new ItemStack(Items.blaze_rod), rod_Blizz, (int) Math.max((Materials.Blaze.getMass()*4) * 3L, 1L));
- GT_ModHandler.addPulverisationRecipe(rod_Blizz, dust_Blizz3, new ItemStack(Items.snowball, 1), 50, false);
-
- //Blazing Pyrotheum
- Logger.INFO("Adding Recipes for Blazing Pyrotheum");
- CORE.RA.addFluidExtractionRecipe(dust_Pyrotheum, GT_Values.NI, getFluidStack("pyrotheum", 250), 10000, 200, 240);
-
- //Ender Fluid
- CORE.RA.addFluidExtractionRecipe(ItemUtils.getSimpleStack(Items.ender_pearl), GT_Values.NI, getFluidStack("ender", 250), 10000, 100, 30);
-
+ GT_ModHandler.addPulverisationRecipe(rod_Blizz, dust_Blizz3, new ItemStack(Items.snowball, 1), 50, false);
ItemStack dustCoal = ItemUtils.getItemStackOfAmountFromOreDict("dustCoal", 1);
ItemStack dustSulfur = ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 1);
@@ -105,14 +95,7 @@ public class TF_Gregtech_Recipes {
}
private static FluidStack getFluidStack(final String fluidName, final int amount){
- Logger.WARNING("Trying to get a fluid stack of "+fluidName);
- try {
- return FluidRegistry.getFluidStack(fluidName, amount);
- }
- catch (final Throwable e){
- return null;
- }
-
+ return FluidUtils.getFluidStack(fluidName, amount);
}
}