aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java44
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java27
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Cyclotron.java231
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java280
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine_NoPlayerInventory.java27
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Cyclotron.java44
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java291
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine_Default.java68
-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.java33
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java103
-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_MetaPipeEntity_Heat.java532
-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/GregtechMetaPipeEntityFluid.java8
-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/GregtechMetaPipeEntityBase_Cable.java13
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java800
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/objects/MultiblockRequirements.java114
-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.java453
-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.java10
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java24
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtCutomCovers.java32
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java102
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java186
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_VisualPlate.java67
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java6
-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/MetaCustomCoverItem.java225
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java8
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java49
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/items/covers/MetaItemCoverCasings.java40
-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/requirements/RequirementsBasicCubic.java2
-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.java52
-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_IndustrialCuttingMachine.java10
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java14
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java2
-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/GregtechMetaTileEntity_IndustrialSifter.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java16
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java19
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java71
-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_Cyclotron.java25
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java502
-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.java30
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricSnips.java107
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingAngleGrinder.java (renamed from src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingAngelGrinder.java)4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java235
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java25
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java12
-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.java216
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/recipes/RecipesToRemove.java19
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java28
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java23
-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.java53
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperChests.java78
88 files changed, 6788 insertions, 1726 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
index 7acd76882e..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,21 +32,25 @@ 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;
import gtPlusPlus.xmod.gregtech.loaders.Gregtech_Blocks;
-import gtPlusPlus.xmod.gregtech.loaders.ProcessingAngelGrinder;
+import gtPlusPlus.xmod.gregtech.loaders.ProcessingAngleGrinder;
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){
@@ -107,7 +114,7 @@ public class HANDLER_GT {
if (CORE.ConfigSwitches.enableSkookumChoochers){
new ProcessingToolHeadChoocher().run();
}
- new ProcessingAngelGrinder().run();
+ new ProcessingAngleGrinder().run();
new ProcessingElectricSnips().run();
new ProcessingElectricButcherKnife().run();
new ProcessingElectricLighter().run();
@@ -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 933ec227ba..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,
@@ -102,6 +105,7 @@ public enum GregtechItemList implements GregtechItemContainer {
Carbyne_Sheet_Finished,
//End Game Laser Engraver Lens
+ Laser_Lens_WoodsGlass,
Laser_Lens_Special,
//Bombs
@@ -109,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,
@@ -224,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,
@@ -318,6 +330,9 @@ public enum GregtechItemList implements GregtechItemContainer {
Casing_Vacuum_Furnace,
Controller_Vacuum_Furnace,
+ // Large Rocket Engine
+ Casing_RocketEngine,
+ Controller_RocketEngine,
//----------------------------------------------------------------------------
@@ -336,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,
@@ -471,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,
@@ -594,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,
//----------------------------------------------------------------------------
@@ -607,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_Cyclotron.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Cyclotron.java
index 921871cebe..6d0eb6b14c 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Cyclotron.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Cyclotron.java
@@ -1,232 +1,37 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.util.GT_LanguageManager;
-import java.util.Iterator;
-import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.ICrafting;
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ * <p/>
+ * The Container I use for all my Basic Machines
+ */
public class CONTAINER_Cyclotron extends GT_ContainerMetaTile_Machine {
-
- public int mActive = 0;
- public int mMaxProgressTime = 0;
- public int mProgressTime = 0;
- public long mEnergy = 0;
- public int mSteam = 0;
- public int mSteamStorage = 0;
- public int mStorage = 0;
- public int mOutput = 0;
- public int mInput = 0;
- public int mID = 0;
- public int mDisplayErrorCode = 0;
- private int oActive = 0;
- private int oMaxProgressTime = 0;
- private int oProgressTime = 0;
- private long oEnergy = 0;
- private int oSteam = 0;
- private int oSteamStorage = 0;
- private int oStorage = 0;
- private int oOutput = 0;
- private int oInput = 0;
- private int oID = 0;
- private int oDisplayErrorCode = 0;
- private int mTimer = 0;
- public CONTAINER_Cyclotron(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- this.mTileEntity = aTileEntity;
- if (this.mTileEntity != null && this.mTileEntity.getMetaTileEntity() != null) {
- this.addSlots(aInventoryPlayer);
- if (this.doesBindPlayerInventory()) {
- this.bindPlayerInventory(aInventoryPlayer);
- }
-
- this.detectAndSendChanges();
- } else {
- aInventoryPlayer.player.openContainer = aInventoryPlayer.player.inventoryContainer;
- }
+ public CONTAINER_Cyclotron(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
- }
-
- public CONTAINER_Cyclotron(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity,
- boolean doesBindInventory) {
super(aInventoryPlayer, aTileEntity);
- this.mTileEntity = aTileEntity;
- if (this.mTileEntity != null && this.mTileEntity.getMetaTileEntity() != null) {
- this.addSlots(aInventoryPlayer);
- if (this.doesBindPlayerInventory() && doesBindInventory) {
- this.bindPlayerInventory(aInventoryPlayer);
- }
-
- this.detectAndSendChanges();
- } else {
- aInventoryPlayer.player.openContainer = aInventoryPlayer.player.inventoryContainer;
- }
-
}
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- if (!this.mTileEntity.isClientSide() && this.mTileEntity.getMetaTileEntity() != null) {
- this.mStorage = (int) Math.min(2147483647L, this.mTileEntity.getEUCapacity());
- this.mEnergy = this.mTileEntity.getStoredEU();
- this.mSteamStorage = (int) Math.min(2147483647L, this.mTileEntity.getSteamCapacity());
- this.mSteam = (int) Math.min(2147483647L, this.mTileEntity.getStoredSteam());
- this.mOutput = (int) Math.min(2147483647L, this.mTileEntity.getOutputVoltage());
- this.mInput = (int) Math.min(2147483647L, this.mTileEntity.getInputVoltage());
- this.mDisplayErrorCode = this.mTileEntity.getErrorDisplayID();
- this.mProgressTime = this.mTileEntity.getProgress();
- this.mMaxProgressTime = this.mTileEntity.getMaxProgress();
- this.mActive = this.mTileEntity.isActive() ? 1 : 0;
- ++this.mTimer;
- Iterator var2 = this.crafters.iterator();
-
- while (true) {
- ICrafting var1;
- do {
- if (!var2.hasNext()) {
- this.oID = this.mID;
- this.oSteam = this.mSteam;
- this.oInput = this.mInput;
- this.oActive = this.mActive;
- this.oOutput = this.mOutput;
- this.oEnergy = this.mEnergy;
- this.oStorage = this.mStorage;
- this.oSteamStorage = this.mSteamStorage;
- this.oProgressTime = this.mProgressTime;
- this.oMaxProgressTime = this.mMaxProgressTime;
- this.oDisplayErrorCode = this.mDisplayErrorCode;
- return;
- }
-
- var1 = (ICrafting) var2.next();
- if (this.mTimer % 500 == 10 || this.oEnergy != this.mEnergy) {
-
- int uEnergy = (int) Math.min(2147483647L, this.mTileEntity.getStoredEU());
-
- var1.sendProgressBarUpdate(this, 0, uEnergy & '￿');
- var1.sendProgressBarUpdate(this, 1, uEnergy >>> 16);
- }
-
- if (this.mTimer % 500 == 10 || this.oStorage != this.mStorage) {
- var1.sendProgressBarUpdate(this, 2, this.mStorage & '￿');
- var1.sendProgressBarUpdate(this, 3, this.mStorage >>> 16);
- }
-
- if (this.mTimer % 500 == 10 || this.oOutput != this.mOutput) {
- var1.sendProgressBarUpdate(this, 4, this.mOutput);
- }
-
- if (this.mTimer % 500 == 10 || this.oInput != this.mInput) {
- var1.sendProgressBarUpdate(this, 5, this.mInput);
- }
-
- if (this.mTimer % 500 == 10 || this.oDisplayErrorCode != this.mDisplayErrorCode) {
- var1.sendProgressBarUpdate(this, 6, this.mDisplayErrorCode);
- }
-
- if (this.mTimer % 500 == 10 || this.oProgressTime != this.mProgressTime) {
- var1.sendProgressBarUpdate(this, 11, this.mProgressTime & '￿');
- var1.sendProgressBarUpdate(this, 12, this.mProgressTime >>> 16);
- }
-
- if (this.mTimer % 500 == 10 || this.oMaxProgressTime != this.mMaxProgressTime) {
- var1.sendProgressBarUpdate(this, 13, this.mMaxProgressTime & '￿');
- var1.sendProgressBarUpdate(this, 14, this.mMaxProgressTime >>> 16);
- }
-
- if (this.mTimer % 500 == 10 || this.oID != this.mID) {
- var1.sendProgressBarUpdate(this, 15, this.mID);
- }
-
- if (this.mTimer % 500 == 10 || this.oActive != this.mActive) {
- var1.sendProgressBarUpdate(this, 16, this.mActive);
- }
-
- if (this.mTimer % 500 == 10 || this.oSteam != this.mSteam) {
- var1.sendProgressBarUpdate(this, 17, this.mSteam & '￿');
- var1.sendProgressBarUpdate(this, 18, this.mSteam >>> 16);
- }
- } while (this.mTimer % 500 != 10 && this.oSteamStorage == this.mSteamStorage);
-
- var1.sendProgressBarUpdate(this, 19, this.mSteamStorage & '￿');
- var1.sendProgressBarUpdate(this, 20, this.mSteamStorage >>> 16);
- }
- }
+ public CONTAINER_Cyclotron(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final boolean bindInventory) {
+ super(aInventoryPlayer, aTileEntity, bindInventory);
}
- @SideOnly(Side.CLIENT)
- public void updateProgressBar(int par1, int par2) {
- super.updateProgressBar(par1, par2);
- switch (par1) {
- case 0 :
- this.mEnergy = this.mEnergy & -65536 | par2;
- break;
- case 1 :
- this.mEnergy = this.mEnergy & '￿' | par2 << 16;
- break;
- case 2 :
- this.mStorage = this.mStorage & -65536 | par2;
- break;
- case 3 :
- this.mStorage = this.mStorage & '￿' | par2 << 16;
- break;
- case 4 :
- this.mOutput = par2;
- break;
- case 5 :
- this.mInput = par2;
- break;
- case 6 :
- this.mDisplayErrorCode = par2;
- case 7 :
- case 8 :
- case 9 :
- case 10 :
- default :
- break;
- case 11 :
- this.mProgressTime = this.mProgressTime & -65536 | par2;
- break;
- case 12 :
- this.mProgressTime = this.mProgressTime & '￿' | par2 << 16;
- break;
- case 13 :
- this.mMaxProgressTime = this.mMaxProgressTime & -65536 | par2;
- break;
- case 14 :
- this.mMaxProgressTime = this.mMaxProgressTime & '￿' | par2 << 16;
- break;
- case 15 :
- this.mID = par2;
- break;
- case 16 :
- this.mActive = par2;
- break;
- case 17 :
- this.mSteam = this.mSteam & -65536 | par2;
- break;
- case 18 :
- this.mSteam = this.mSteam & '￿' | par2 << 16;
- break;
- case 19 :
- this.mSteamStorage = this.mSteamStorage & -65536 | par2;
- break;
- case 20 :
- this.mSteamStorage = this.mSteamStorage & '￿' | par2 << 16;
- }
-
+ @Override
+ public void addSlots(final InventoryPlayer aInventoryPlayer) {
+ //this.addSlotToContainer(new Slot(this.mTileEntity, 1, 154, 42));
}
- public boolean canInteractWith(EntityPlayer player) {
- return this.mTileEntity.isUseableByPlayer(player);
+ @Override
+ public int getSlotCount() {
+ return 0;
}
- public String trans(String aKey, String aEnglish) {
- return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aKey, aEnglish, false);
+ @Override
+ public int getShiftClickSlotCount() {
+ return 0;
}
-} \ No newline at end of file
+}
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 bdf19454ce..88b9661c95 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java
@@ -1,9 +1,22 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import net.minecraft.entity.player.InventoryPlayer;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.List;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.util.GT_Recipe;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.ICrafting;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
@@ -11,6 +24,14 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
* The Container I use for all my Basic Machines
*/
public class CONTAINER_MultiMachine extends GT_ContainerMetaTile_Machine {
+
+ public String[] mTileDescription;
+ private String[] oTileDescription;
+
+ private GregtechMeta_MultiBlockBase mMCTEI;
+ private boolean mControllerSet = false;
+
+
public CONTAINER_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
super(aInventoryPlayer, aTileEntity);
}
@@ -18,20 +39,245 @@ public class CONTAINER_MultiMachine extends GT_ContainerMetaTile_Machine {
public CONTAINER_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final boolean bindInventory) {
super(aInventoryPlayer, aTileEntity, bindInventory);
}
-}
+
+ public static void setControllerInstance(CONTAINER_MultiMachine aContainer, IGregTechTileEntity aTile) {
+ if (aTile == null) {
+ return;
+ }
+ final IMetaTileEntity aMetaTileEntity = aTile.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return;
+ }
+ if (aMetaTileEntity instanceof GregtechMeta_MultiBlockBase) {
+ aContainer.mMCTEI = (GregtechMeta_MultiBlockBase) aMetaTileEntity;
+ }
+ }
+
+ public int aTotalTickTime = 0;
+ public int aMaxParallel = 0;
+ public int aPollutionTick = 0;
+ public int aMaxInputVoltage = 0;
+ public int aInputTier = 0;
+ public int aOutputTier = 0;
+ public int aRecipeDuration = 0;
+ public int aRecipeEU = 0;
+ public int aRecipeSpecial = 0;
+ public int aPollutionReduction = 0;
+ public int aStoredEnergy = 0;
+ public int aMaxEnergy = 0;
+ public int aEfficiency = 0;
+
+ private int oTotalTickTime = 0;
+ private int oMaxParallel = 0;
+ private int oPollutionTick = 0;
+ private int oMaxInputVoltage = 0;
+ private int oInputTier = 0;
+ private int oOutputTier = 0;
+ private int oRecipeDuration = 0;
+ private int oRecipeEU = 0;
+ private int oRecipeSpecial = 0;
+ private int oPollutionReduction = 0;
+ private int oStoredEnergy = 0;
+ private int oMaxEnergy = 0;
+ private int oEfficiency = 0;
+
+ private static Field timer;
+ //private static Field crafters;
+
+ @Override
+ public final void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if (this.mTileEntity.isClientSide() || this.mTileEntity.getMetaTileEntity() == null) {
+ return;
+ }
+ if (!mControllerSet) {
+ setControllerInstance(this, this.mTileEntity);
+ }
+ mControllerSet = (mMCTEI != null);
+ if (timer == null) {
+ timer = ReflectionUtils.getField(getClass(), "mTimer");
+ }
+ if (crafters == null) {
+ //crafters = ReflectionUtils.getField(getClass(), "crafters");
+ }
+ if (timer != null && crafters != null && mControllerSet) {
+ //Logger.INFO("Trying to update clientside GUI data");
+ try {
+ //Logger.INFO("0");
+ int aTimer = (int) ReflectionUtils.getFieldValue(timer, this);
+
+ //List crafters1List = (List) crafters1;
+ List<ICrafting> crafters2 = new ArrayList<ICrafting>();
+ //Logger.INFO("1");
+ for (Object o : crafters) {
+ if (o instanceof ICrafting) {
+ crafters2.add((ICrafting) o);
+ }
+ }
+ //Logger.INFO("2");
+ if (!crafters2.isEmpty()) {
+ //Logger.INFO("3");
+ handleInitialFieldSetting();
+
+ try {
+ //Logger.INFO("4");
+ for (final ICrafting var3 : crafters2) {
+ handleCraftingEvent(aTimer, var3);
+ }
+ //Logger.INFO("5");
+ handleInternalFieldSetting();
+ //Logger.INFO("6");
+ } catch (Throwable t) {
-/*@Override
- public void addSlots(InventoryPlayer aInventoryPlayer) {
- addSlotToContainer(new Slot(mTileEntity, 1, 152, 5));
- }
-
- @Override
- public int getSlotCount() {
- return 1;
- }
-
- @Override
- public int getShiftClickSlotCount() {
- return 0;
- }
-}*/
+ }
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+ else {
+ Logger.INFO("Failed.");
+ }
+ }
+
+ public void handleInitialFieldSetting() {
+ this.aTotalTickTime = MathUtils.balance((int) mMCTEI.getTotalRuntimeInTicks(), Integer.MIN_VALUE, Integer.MAX_VALUE);
+ this.aMaxParallel = mMCTEI.getMaxParallelRecipes();
+ this.aPollutionTick = mMCTEI.getPollutionPerTick(null);
+ this.aMaxInputVoltage = MathUtils.balance((int) mMCTEI.getMaxInputVoltage(), Integer.MIN_VALUE, Integer.MAX_VALUE);
+ this.aInputTier = MathUtils.balance((int) mMCTEI.getInputTier(), Integer.MIN_VALUE, Integer.MAX_VALUE);
+ this.aOutputTier = MathUtils.balance((int) mMCTEI.getOutputTier(), Integer.MIN_VALUE, Integer.MAX_VALUE);
+ if (mMCTEI.mLastRecipe != null) {
+ GT_Recipe aRecipe = mMCTEI.mLastRecipe;
+ this.aRecipeDuration = MathUtils.balance(aRecipe.mDuration, Integer.MIN_VALUE, Integer.MAX_VALUE);
+ this.aRecipeEU = MathUtils.balance(aRecipe.mEUt, Integer.MIN_VALUE, Integer.MAX_VALUE);
+ this.aRecipeSpecial = MathUtils.balance(aRecipe.mSpecialValue, Integer.MIN_VALUE, Integer.MAX_VALUE);
+ }
+ this.aPollutionReduction = mMCTEI.getPollutionReductionForAllMufflers();
+
+ this.aStoredEnergy = MathUtils.balance((int) mMCTEI.getStoredEnergyInAllEnergyHatches(), Integer.MIN_VALUE, Integer.MAX_VALUE);
+ this.aMaxEnergy = MathUtils.balance((int) mMCTEI.getMaxEnergyStorageOfAllEnergyHatches(), Integer.MIN_VALUE, Integer.MAX_VALUE);
+ this.aEfficiency = MathUtils.balance(mMCTEI.mEfficiency, Integer.MIN_VALUE, Integer.MAX_VALUE);
+ }
+
+ public void handleCraftingEvent(int aTimer, ICrafting aCrafter) {
+ int aID = 750;
+ if (aTimer % 500 == 10 || this.oTotalTickTime != this.aTotalTickTime) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aTotalTickTime);
+ }
+ if (aTimer % 500 == 10 || this.oMaxParallel != this.aMaxParallel) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aMaxParallel);
+ }
+ if (aTimer % 500 == 10 || this.oPollutionTick != this.aPollutionTick) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aPollutionTick);
+ }
+ if (aTimer % 500 == 10 || this.oMaxInputVoltage != this.aMaxInputVoltage) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aMaxInputVoltage);
+ }
+ if (aTimer % 500 == 10 || this.oInputTier != this.aInputTier) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aInputTier);
+ }
+ if (aTimer % 500 == 10 || this.oOutputTier != this.aOutputTier) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aOutputTier);
+ }
+ if (aTimer % 500 == 10 || this.oRecipeDuration != this.aRecipeDuration) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aRecipeDuration);
+ }
+ if (aTimer % 500 == 10 || this.oRecipeEU != this.aRecipeEU) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aRecipeEU);
+ }
+ if (aTimer % 500 == 10 || this.oRecipeSpecial != this.aRecipeSpecial) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aRecipeSpecial);
+ }
+ if (aTimer % 500 == 10 || this.oPollutionReduction != this.aPollutionReduction) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aPollutionReduction);
+ }
+ if (aTimer % 500 == 10 || this.oStoredEnergy != this.aStoredEnergy) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aStoredEnergy);
+ }
+ if (aTimer % 500 == 10 || this.oMaxEnergy != this.aMaxEnergy) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aMaxEnergy);
+ }
+ if (aTimer % 500 == 10 || this.oEfficiency != this.aEfficiency) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aEfficiency);
+ }
+ }
+
+ public void handleInternalFieldSetting() {
+ this.oTotalTickTime = this.aTotalTickTime;
+ this.oMaxParallel = this.aMaxParallel;
+ this.oPollutionTick = this.aPollutionTick;
+ this.oMaxInputVoltage = this.aMaxInputVoltage;
+ this.oInputTier = this.aInputTier;
+ this.oOutputTier = this.aOutputTier;
+ this.oRecipeDuration = this.aRecipeDuration;
+ this.oRecipeEU = this.aRecipeEU;
+ this.oRecipeSpecial = this.aRecipeSpecial;
+ this.oPollutionReduction = this.aPollutionReduction;
+ this.oStoredEnergy = this.aStoredEnergy;
+ this.oMaxEnergy = this.aMaxEnergy;
+ this.oEfficiency = this.aEfficiency;
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void updateProgressBar(final int par1, final int par2) {
+ super.updateProgressBar(par1, par2);
+ int shiftedSwitch = par1 - 750;
+ switch (shiftedSwitch) {
+ case 0: {
+ this.aTotalTickTime = par2;
+ break;
+ }
+ case 1: {
+ this.aMaxParallel = par2;
+ break;
+ }
+ case 2: {
+ this.aPollutionTick = par2;
+ break;
+ }
+ case 3: {
+ this.aMaxInputVoltage = par2;
+ break;
+ }
+ case 4: {
+ this.aInputTier = par2;
+ break;
+ }
+ case 5: {
+ this.aOutputTier = par2;
+ break;
+ }
+ case 6: {
+ this.aRecipeDuration = par2;
+ break;
+ }
+ case 7: {
+ this.aRecipeEU = par2;
+ break;
+ }
+ case 8: {
+ this.aRecipeSpecial = par2;
+ break;
+ }
+ case 9: {
+ this.aPollutionReduction = par2;
+ break;
+ }
+ case 10: {
+ this.aStoredEnergy = par2;
+ break;
+ }
+ case 11: {
+ this.aMaxEnergy = par2;
+ break;
+ }
+ case 12: {
+ this.aEfficiency = par2;
+ break;
+ }
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine_NoPlayerInventory.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine_NoPlayerInventory.java
new file mode 100644
index 0000000000..2d63a13d60
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine_NoPlayerInventory.java
@@ -0,0 +1,27 @@
+package gtPlusPlus.xmod.gregtech.api.gui;
+
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+
+public class CONTAINER_MultiMachine_NoPlayerInventory extends CONTAINER_MultiMachine {
+
+ public CONTAINER_MultiMachine_NoPlayerInventory(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ public CONTAINER_MultiMachine_NoPlayerInventory(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final boolean bindInventory) {
+ super(aInventoryPlayer, aTileEntity, bindInventory);
+ }
+
+ public boolean doesBindPlayerInventory() {
+ return false;
+ }
+
+ @Override
+ public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer) {
+ return null;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Cyclotron.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Cyclotron.java
new file mode 100644
index 0000000000..0be44fa616
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Cyclotron.java
@@ -0,0 +1,44 @@
+package gtPlusPlus.xmod.gregtech.api.gui;
+
+import gregtech.api.gui.GT_Container_MultiMachine;
+import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
+
+public class GUI_Cyclotron extends GT_GUIContainerMetaTile_Machine
+{
+ public final String mNEI;
+ public final String mName;
+
+ public GUI_Cyclotron(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aName, final String aNEI) {
+ super(new GT_Container_MultiMachine(aInventoryPlayer, aTileEntity, false), "gregtech:textures/gui/multimachines/" + "FusionComputer.png");
+ this.mName = aName;
+ this.mNEI = aNEI;
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
+ this.fontRendererObj.drawString(this.mName, 8, -10, 16448255);
+ if (this.mContainer != null) {
+ if ((((GT_Container_MultiMachine)this.mContainer).mDisplayErrorCode & 0x40) != 0x0) {
+ this.fontRendererObj.drawString("Incomplete Structure.", 10, 8, 16448255);
+ }
+ if (((GT_Container_MultiMachine)this.mContainer).mDisplayErrorCode == 0) {
+ if (((GT_Container_MultiMachine)this.mContainer).mActive == 0) {
+ this.fontRendererObj.drawString("Hit with Soft Hammer to (re-)start the Machine if it doesn't start.", -70, 170, 16448255);
+ }
+ else {
+ this.fontRendererObj.drawString("Running perfectly.", 10, 170, 16448255);
+ }
+ }
+ }
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ 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);
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java
index 425fe6d01f..c78e7789b8 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java
@@ -1,12 +1,26 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import net.minecraft.entity.player.InventoryPlayer;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.TimeUnit;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.Materials;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
+import gregtech.api.util.GT_Utility;
+import gregtech.common.items.GT_MetaGenerated_Tool_01;
import gtPlusPlus.core.lib.CORE;
+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.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
@@ -17,52 +31,261 @@ import gtPlusPlus.core.lib.CORE;
*/
public class GUI_MultiMachine extends GT_GUIContainerMetaTile_Machine {
- String mName = "";
+ private final static Materials GOOD;
+ private final static Materials BAD;
+ private final String mName;
+
+ private final static ConcurrentHashMap<String, ItemStack> mToolStacks = new ConcurrentHashMap<String, ItemStack>();
+
+ //net.minecraft.client.gui.inventory.GuiContainer.drawItemStack(ItemStack, int, int, String)
+ private final static Method mDrawItemStack;
+
+ static {
+ GOOD = Materials.Uranium;
+ BAD = Materials.Plutonium;
+
+ //net.minecraft.client.gui.inventory.GuiContainer.drawItemStack(ItemStack, int, int, String)
+ mDrawItemStack = ReflectionUtils.getMethod(GuiContainer.class, "drawItemStack", new Class[] {ItemStack.class, int.class, int.class, String.class});
+ }
public GUI_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aName, final String aTextureFile) {
- super(new CONTAINER_MultiMachine(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
- this.mName = aName;
+ super(new CONTAINER_MultiMachine_NoPlayerInventory(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
+ this.mName = aName != null ? aName : "";
}
@Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.fontRendererObj.drawString(this.mName, 10, 8, 16448255);
-
+ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
if (this.mContainer != null) {
- if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 1) != 0) {
- this.fontRendererObj.drawString("Pipe is loose.", 10, 16, 16448255);
- }
- if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 2) != 0) {
- this.fontRendererObj.drawString("Screws are missing.", 10, 24, 16448255);
- }
- if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 4) != 0) {
- this.fontRendererObj.drawString("Something is stuck.", 10, 32, 16448255);
- }
- if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 8) != 0) {
- this.fontRendererObj.drawString("Platings are dented.", 10, 40, 16448255);
- }
- if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 16) != 0) {
- this.fontRendererObj.drawString("Circuitry burned out.", 10, 48, 16448255);
- }
- if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 32) != 0) {
- this.fontRendererObj.drawString("That doesn't belong there.", 10, 56, 16448255);
+ drawGuiInfoTextLayer(par1, par2);
+ drawGuiRepairStatusLayer(par1, par2);
+ }
+ }
+
+
+ protected void drawGuiInfoTextLayer(final float par1, final int par2) {
+
+ if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 64) != 0) {
+ this.fontRendererObj.drawString(mName, 6, 7, 16448255); // Move down 8px
+ this.fontRendererObj.drawString("Incomplete Structure.", 6, 15, 16448255); // Move down 8px
+ }
+ else {
+ int aTotalTickTime = ((CONTAINER_MultiMachine) this.mContainer).aTotalTickTime;
+ int aMaxParallel = ((CONTAINER_MultiMachine) this.mContainer).aMaxParallel;
+ int aPollutionTick = ((CONTAINER_MultiMachine) this.mContainer).aPollutionTick;
+ int aMaxInputVoltage = ((CONTAINER_MultiMachine) this.mContainer).aMaxInputVoltage;
+ int aInputTier = ((CONTAINER_MultiMachine) this.mContainer).aInputTier;
+ int aOutputTier = ((CONTAINER_MultiMachine) this.mContainer).aOutputTier;
+ int aRecipeDuration = ((CONTAINER_MultiMachine) this.mContainer).aRecipeDuration;
+ int aRecipeEU = ((CONTAINER_MultiMachine) this.mContainer).aRecipeEU;
+ int aRecipeSpecial = ((CONTAINER_MultiMachine) this.mContainer).aRecipeSpecial;
+ int aEfficiency = ((CONTAINER_MultiMachine) this.mContainer).aEfficiency;
+
+ int aPollutionReduction = ((CONTAINER_MultiMachine) this.mContainer).aPollutionReduction;
+
+
+ long aStoredEnergy = ((CONTAINER_MultiMachine) this.mContainer).aStoredEnergy;
+ long aMaxEnergy = ((CONTAINER_MultiMachine) this.mContainer).aMaxEnergy;
+
+ /*
+ * Logic Block
+ */
+
+ long seconds = (aTotalTickTime/20);
+ int weeks = (int) (TimeUnit.SECONDS.toDays(seconds) / 7);
+ int days = (int) (TimeUnit.SECONDS.toDays(seconds) - 7 * weeks);
+ long hours = TimeUnit.SECONDS.toHours(seconds) - TimeUnit.DAYS.toHours(days) - TimeUnit.DAYS.toHours(7*weeks);
+ long minutes = TimeUnit.SECONDS.toMinutes(seconds) - (TimeUnit.SECONDS.toHours(seconds) * 60);
+ long second = TimeUnit.SECONDS.toSeconds(seconds) - (TimeUnit.SECONDS.toMinutes(seconds) *60);
+
+ ArrayList<String> mInfo = new ArrayList<String>();
+
+ String EU = StatCollector.translateToLocal("GTPP.info.eu");
+
+ //GTPP.machines.tier
+
+ mInfo.add(mName);
+
+ if (aInputTier > 0) {
+ mInfo.add(StatCollector.translateToLocal("GTPP.machines.input")+" "+StatCollector.translateToLocal("GTPP.machines.tier")+": "+ EnumChatFormatting.GREEN +GT_Values.VOLTAGE_NAMES[aInputTier]);
}
- if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 64) != 0) {
- this.fontRendererObj.drawString("Incomplete Structure.", 10, 64, 16448255);
+ if (aOutputTier > 0) {
+ mInfo.add(StatCollector.translateToLocal("GTPP.machines.output")+" "+StatCollector.translateToLocal("GTPP.machines.tier")+": "+ EnumChatFormatting.GREEN +GT_Values.VOLTAGE_NAMES[aOutputTier]);
+ }
+
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.progress")+": "+
+ EnumChatFormatting.GREEN + Integer.toString(((CONTAINER_MultiMachine) this.mContainer).mProgressTime/20) + EnumChatFormatting.RESET +" s / "+
+ EnumChatFormatting.YELLOW + Integer.toString(((CONTAINER_MultiMachine) this.mContainer).mMaxProgressTime/20) + EnumChatFormatting.RESET +" s");
+
+
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.energy")+": "+
+ EnumChatFormatting.GREEN + Long.toString(aStoredEnergy) + EnumChatFormatting.RESET +" "+EU+" / "+
+ EnumChatFormatting.YELLOW + Long.toString(aMaxEnergy) + EnumChatFormatting.RESET +" "+EU+"");
+
+ if (aRecipeEU != 0 && aRecipeDuration > 0) {
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.usage")+": "+
+ EnumChatFormatting.RED + Integer.toString(-aRecipeEU) + EnumChatFormatting.RESET + " "+EU+"/t");
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.duration")+": "+
+ EnumChatFormatting.RED + Integer.toString(aRecipeDuration) + EnumChatFormatting.RESET + " ticks");
+ if (aRecipeSpecial > 0) {
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.specialvalue")+": "+
+ EnumChatFormatting.RED + Integer.toString(aRecipeEU) + EnumChatFormatting.RESET + "");
+ }
+ }
+
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.mei")+": "+
+ EnumChatFormatting.YELLOW+Long.toString(aMaxInputVoltage)+EnumChatFormatting.RESET+ " "+EU+"/t"+EnumChatFormatting.RESET);
+
+ mInfo.add(StatCollector.translateToLocal(StatCollector.translateToLocal("GTPP.machines.tier")+": "+
+ EnumChatFormatting.YELLOW+GT_Values.VN[GT_Utility.getTier(aMaxInputVoltage)]+ EnumChatFormatting.RESET));
+
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.efficiency")+": "+ EnumChatFormatting.YELLOW+Float.toString(aEfficiency / 100.0F)+EnumChatFormatting.RESET + " %");
+
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollution")+": "+ EnumChatFormatting.RED + (aPollutionTick*20)+ EnumChatFormatting.RESET+"/sec");
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollutionreduced")+": "+ EnumChatFormatting.GREEN + aPollutionReduction + EnumChatFormatting.RESET+" %");
+
+ mInfo.add(StatCollector.translateToLocal("GTPP.CC.parallel")+": "+EnumChatFormatting.GREEN+(aMaxParallel)+EnumChatFormatting.RESET);
+
+ mInfo.add("Total Time Since Built: ");
+ mInfo.add("" + EnumChatFormatting.DARK_GREEN + Integer.toString(weeks)+EnumChatFormatting.RESET+" Weeks,");
+ mInfo.add("" + EnumChatFormatting.DARK_GREEN+ Integer.toString(days) +EnumChatFormatting.RESET+ " Days,");
+ mInfo.add("" + EnumChatFormatting.DARK_GREEN+ Long.toString(hours) +EnumChatFormatting.RESET+ " Hours,");
+ mInfo.add("" + EnumChatFormatting.DARK_GREEN+ Long.toString(minutes) +EnumChatFormatting.RESET+ " Minutes,");
+ mInfo.add("" + EnumChatFormatting.DARK_GREEN+ Long.toString(second) +EnumChatFormatting.RESET+ " Seconds");
+
+
+
+ // Machine Name
+ //fontRendererObj.drawString(this.mName, 6, 7, 16448255);
+
+ for (int i=0;i<mInfo.size();i++) {
+ fontRendererObj.drawString(mInfo.get(i), 6, 7+(i*8), 16448255);
}
- if (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode == 0) {
- if (((CONTAINER_MultiMachine) this.mContainer).mActive == 0) {
- this.fontRendererObj.drawString("Hit with Soft Hammer", 10, 16, 16448255);
- this.fontRendererObj.drawString("to (re-)start the Machine", 10, 24, 16448255);
- this.fontRendererObj.drawString("if it doesn't start.", 10, 32, 16448255);
- } else {
- this.fontRendererObj.drawString("Running perfectly.", 10, 16, 16448255);
+ }
+
+
+
+
+ }
+
+
+ protected void drawGuiRepairStatusLayer(final float par1, final int par2) {
+
+ boolean aWrench = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 1) != 0;
+ boolean aScrewdriver = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 2) != 0;
+ boolean aMallet = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 4) != 0;
+ boolean aHammer = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 8) != 0;
+ boolean aSoldering = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 16) != 0;
+ boolean aCrowbar = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 32) != 0;
+
+ if (mToolStacks.isEmpty()) {
+ // Map Stacks of Repair items
+ aWrench = false;
+ aScrewdriver = false;
+ aMallet = false;
+ aHammer = false;
+ aSoldering = false;
+ aCrowbar = false;
+ mToolStacks.put(aWrench+"WRENCH", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, (aWrench ? BAD : GOOD), Materials.Tungsten, null));
+ mToolStacks.put(aCrowbar+"CROWBAR", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.CROWBAR, 1, (aCrowbar ? BAD : GOOD), Materials.Tungsten, null));
+ mToolStacks.put(aHammer+"HARDHAMMER", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, (aHammer ? BAD : GOOD), Materials.Tungsten, null));
+ mToolStacks.put(aMallet+"SOFTHAMMER", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOFTHAMMER, 1, (aMallet ? BAD : GOOD), Materials.Tungsten, null));
+ mToolStacks.put(aScrewdriver+"SCREWDRIVER", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, (aScrewdriver ? BAD : GOOD), Materials.Tungsten, null));
+ mToolStacks.put(aSoldering+"SOLDERING_IRON_LV", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, (aSoldering ? BAD : GOOD), Materials.Tungsten, null));
+
+ // Map Stacks of valid items
+ aWrench = true;
+ aScrewdriver = true;
+ aMallet = true;
+ aHammer = true;
+ aSoldering = true;
+ aCrowbar = true;
+ mToolStacks.put(aWrench+"WRENCH", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, (aWrench ? BAD : GOOD), Materials.Tungsten, null));
+ mToolStacks.put(aCrowbar+"CROWBAR", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.CROWBAR, 1, (aCrowbar ? BAD : GOOD), Materials.Tungsten, null));
+ mToolStacks.put(aHammer+"HARDHAMMER", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, (aHammer ? BAD : GOOD), Materials.Tungsten, null));
+ mToolStacks.put(aMallet+"SOFTHAMMER", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOFTHAMMER, 1, (aMallet ? BAD : GOOD), Materials.Tungsten, null));
+ mToolStacks.put(aScrewdriver+"SCREWDRIVER", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, (aScrewdriver ? BAD : GOOD), Materials.Tungsten, null));
+ mToolStacks.put(aSoldering+"SOLDERING_IRON_LV", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, (aSoldering ? BAD : GOOD), Materials.Tungsten, null));
+
+ ItemStack aGlassPane1 = ItemUtils.getItemStackOfAmountFromOreDict("paneGlassRed", 1);
+ ItemStack aGlassPane2 = ItemUtils.getItemStackOfAmountFromOreDict("paneGlassLime", 1);
+ mToolStacks.put("falseGLASS", aGlassPane1);
+ mToolStacks.put("trueGLASS", aGlassPane2);
+
+ // Reset vars to real state
+ aWrench = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 1) != 0;
+ aScrewdriver = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 2) != 0;
+ aMallet = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 4) != 0;
+ aHammer = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 8) != 0;
+ aSoldering = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 16) != 0;
+ aCrowbar = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 32) != 0;
+
+ }
+
+ ItemStack aWrenchStack;
+ ItemStack aCrowbarStack;
+ ItemStack aHammerStack;
+ ItemStack aMalletStack;
+ ItemStack aScrewdriverStack;
+ ItemStack aSolderingStack;
+ if (!mToolStacks.isEmpty() && mDrawItemStack != null) {
+
+ aWrenchStack = mToolStacks.get(aWrench + "WRENCH");
+ aCrowbarStack = mToolStacks.get(aCrowbar + "CROWBAR");
+ aHammerStack = mToolStacks.get(aHammer + "HARDHAMMER");
+ aMalletStack = mToolStacks.get(aMallet + "SOFTHAMMER");
+ aScrewdriverStack = mToolStacks.get(aScrewdriver + "SCREWDRIVER");
+ aSolderingStack = mToolStacks.get(aSoldering + "SOLDERING_IRON_LV");
+
+ try {
+
+ ItemStack[] aToolStacks2 = new ItemStack[] {
+ aWrenchStack, aCrowbarStack,
+ aHammerStack, aMalletStack,
+ aScrewdriverStack, aSolderingStack };
+
+ int aIndex = 0;
+ //Draw Repair status tools
+ for (aIndex = 0; aIndex < 6; aIndex++) {
+ int x = 156;
+ int y = 112 - (18 * 3) + (aIndex * 18);
+ mDrawItemStack.invoke(this,
+ new Object[] {
+ aToolStacks2[aIndex] != null ? aToolStacks2[aIndex]
+ : ItemUtils.getErrorStack(1, "Bad Times"),
+ x, y, "" + (aIndex == 2 ? "H" : aIndex == 3 ? "M" : "") // Stacksize Overlay
+ });
+ //this.fontRendererObj.drawString("", 10, 64, 16448255);
+ }
+
+ //Draw Running status
+ boolean running = ((CONTAINER_MultiMachine) this.mContainer).mActive != 0;
+ ItemStack aGlassPane = mToolStacks.get(running+"GLASS");
+
+ if (aGlassPane == null) {
+ aGlassPane = ItemUtils.getItemStackOfAmountFromOreDict("paneGlass" + (running ? "Lime" : "Red"), 1);
+ mToolStacks.put(running+"GLASS", aGlassPane);
}
+
+ mDrawItemStack.invoke(this,
+ new Object[] {
+ aGlassPane != null ? aGlassPane
+ : ItemUtils.getErrorStack(1, "Bad Times"),
+ 156,
+ 112 - (18 * 5),
+ running ? "On" : "Off"}); // Stacksize Overlay
+
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ e.printStackTrace();
}
}
+
+
+
+
}
+
@Override
protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine_Default.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine_Default.java
new file mode 100644
index 0000000000..0cfab4e71e
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine_Default.java
@@ -0,0 +1,68 @@
+package gtPlusPlus.xmod.gregtech.api.gui;
+
+import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.util.GT_LanguageManager;
+import gtPlusPlus.core.lib.CORE;
+import net.minecraft.entity.player.InventoryPlayer;
+
+public class GUI_MultiMachine_Default extends GT_GUIContainerMetaTile_Machine
+{
+ String mName;
+
+ public GUI_MultiMachine_Default(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aName, final String aTextureFile) {
+ super(new CONTAINER_MultiMachine(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + ((aTextureFile == null) ? "MultiblockDisplay" : aTextureFile));
+ this.mName = "";
+ this.mName = aName;
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
+ this.fontRendererObj.drawString(this.mName, 10, 8, 16448255);
+ if (this.mContainer != null) {
+ if ((((CONTAINER_MultiMachine)this.mContainer).mDisplayErrorCode & 0x1) != 0x0) {
+ this.fontRendererObj.drawString(this.trans("132", "Pipe is loose."), 10, 16, 16448255);
+ }
+ if ((((CONTAINER_MultiMachine)this.mContainer).mDisplayErrorCode & 0x2) != 0x0) {
+ this.fontRendererObj.drawString(this.trans("133", "Screws are missing."), 10, 24, 16448255);
+ }
+ if ((((CONTAINER_MultiMachine)this.mContainer).mDisplayErrorCode & 0x4) != 0x0) {
+ this.fontRendererObj.drawString(this.trans("134", "Something is stuck."), 10, 32, 16448255);
+ }
+ if ((((CONTAINER_MultiMachine)this.mContainer).mDisplayErrorCode & 0x8) != 0x0) {
+ this.fontRendererObj.drawString(this.trans("135", "Platings are dented."), 10, 40, 16448255);
+ }
+ if ((((CONTAINER_MultiMachine)this.mContainer).mDisplayErrorCode & 0x10) != 0x0) {
+ this.fontRendererObj.drawString(this.trans("136", "Circuitry burned out."), 10, 48, 16448255);
+ }
+ if ((((CONTAINER_MultiMachine)this.mContainer).mDisplayErrorCode & 0x20) != 0x0) {
+ this.fontRendererObj.drawString(this.trans("137", "That doesn't belong there."), 10, 56, 16448255);
+ }
+ if ((((CONTAINER_MultiMachine)this.mContainer).mDisplayErrorCode & 0x40) != 0x0) {
+ this.fontRendererObj.drawString(this.trans("138", "Incomplete Structure."), 10, 64, 16448255);
+ }
+ if (((CONTAINER_MultiMachine)this.mContainer).mDisplayErrorCode == 0) {
+ if (((CONTAINER_MultiMachine)this.mContainer).mActive == 0) {
+ this.fontRendererObj.drawString(this.trans("139", "Hit with Soft Hammer"), 10, 16, 16448255);
+ this.fontRendererObj.drawString(this.trans("140", "to (re-)start the Machine"), 10, 24, 16448255);
+ this.fontRendererObj.drawString(this.trans("141", "if it doesn't start."), 10, 32, 16448255);
+ }
+ else {
+ this.fontRendererObj.drawString(this.trans("142", "Running perfectly."), 10, 16, 16448255);
+ }
+ }
+ }
+ }
+
+ public String trans(final String aKey, final String aEnglish) {
+ return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aKey, aEnglish, false);
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ 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);
+ }
+}
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 e4a15d34ea..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
@@ -204,6 +204,7 @@ public interface IGregtech_RecipeAdder {
public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, FluidStack inputFluid, FluidStack outputFluid, ItemStack output, int time, int eu);
public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, FluidStack inputFluid, FluidStack outputFluid, ItemStack output, Object object, int time, int eu);
public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, FluidStack inputFluid, FluidStack outputFluid, ItemStack output, ItemStack object, int time);
+ public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, int aCircuit, FluidStack inputFluid, FluidStack outputFluid, ItemStack output, ItemStack output2, int time, int eu);
public boolean addMultiblockChemicalRecipe(ItemStack[] itemStacks, FluidStack[] fluidStacks, FluidStack[] fluidStacks2, ItemStack[] outputs, int time, int eu);
@@ -215,8 +216,16 @@ public interface IGregtech_RecipeAdder {
public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aDust, ItemStack aOutput);
- public void addFluidExtractionRecipe(ItemStack input, Object 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
*
@@ -254,7 +263,25 @@ public interface IGregtech_RecipeAdder {
public boolean addFusionReactorRecipe(ItemStack aInputStackA, ItemStack aInputStackB, FluidStack plasma, int aOutputChance, int aFusionDurationInTicks, int aEu, int aSpecial);
- boolean addVacuumFurnaceRecipe(ItemStack aInput1, ItemStack aInput2,
+ public boolean addVacuumFurnaceRecipe(ItemStack aInput1, ItemStack aInput2,
FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1,
ItemStack aOutput2, int aDuration, int aEUt, int aLevel);
+
+
+ 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 e637365c1e..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,18 +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();
@@ -73,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)) {
@@ -94,19 +124,70 @@ 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() {
- ItemStack rStack = new ItemStack(Meta_GT_Proxy.sBlockMachines, 1, this.getMetaTileID());
- NBTTagCompound aSuperNBT = super.getDrops().get(0).getTagCompound();
- NBTTagCompound tNBT = aSuperNBT;
- if (this.hasValidMetaTileEntity()) {
- this.mMetaTileEntity.setItemNBT(tNBT);
+ ArrayList<ItemStack> aDrops = new ArrayList<ItemStack>();
+ ItemStack rStack = new ItemStack(GregTech_API.sBlockMachines, 1, this.getMetaTileID());
+ // Currently not using my custom block.
+ // ItemStack rStack = new ItemStack(Meta_GT_Proxy.sBlockMachines, 1,
+ // this.getMetaTileID());
+ boolean fail = true;
+
+ ArrayList<ItemStack> aSuperDrops = super.getDrops();
+ if (aSuperDrops != null && !aSuperDrops.isEmpty()) {
+ ItemStack aSuperStack = super.getDrops().get(0);
+ if (aSuperStack != null && aSuperStack.hasTagCompound()) {
+ NBTTagCompound aSuperNBT = aSuperStack.getTagCompound();
+ if (aSuperNBT != null && !aSuperNBT.hasNoTags()) {
+ NBTTagCompound tNBT = (NBTTagCompound) aSuperNBT.copy();
+ if (tNBT != null && !tNBT.hasNoTags()) {
+ if (this.hasValidMetaTileEntity()) {
+ this.mMetaTileEntity.setItemNBT(tNBT);
+ rStack.setTagCompound(tNBT);
+ fail = false;
+ aDrops.add(rStack);
+ }
+ }
+ }
+
+ }
}
- if (!tNBT.hasNoTags()) {
- rStack.setTagCompound(tNBT);
+ if (fail) {
+ aDrops.add(rStack);
}
-
- return new ArrayList<ItemStack>(Arrays.asList(new ItemStack[] { rStack }));
+ return aDrops;
}
public boolean isTeleporterCompatible(Direction aSide) {
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_MetaPipeEntity_Heat.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Heat.java
deleted file mode 100644
index 68ec0ba0c9..0000000000
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Heat.java
+++ /dev/null
@@ -1,532 +0,0 @@
-package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import gregtech.GT_Mod;
-import gregtech.api.enums.Dyes;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.enums.Textures.BlockIcons;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IEnergyConnected;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.BaseMetaPipeEntity;
-import gregtech.api.metatileentity.MetaPipeEntity;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.GT_Client;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.xmod.gregtech.api.interfaces.IHeatEntity;
-import gtPlusPlus.xmod.gregtech.api.interfaces.IMetaTileEntityHeatPipe;
-import gtPlusPlus.xmod.gregtech.common.StaticFields59;
-import ic2.api.energy.tile.IEnergySink;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.AxisAlignedBB;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
-
-public class GT_MetaPipeEntity_Heat extends MetaPipeEntity implements IMetaTileEntityHeatPipe, IHeatEntity {
-
- public final Materials mMaterial;
- public final long mHeatLossPerMeter, mAmperage, mMaxTemp;
- public final boolean mInsulated, mCanShock;
- public long mTransferredAmperage = 0, mTransferredAmperageLast20 = 0, mTransferredVoltageLast20 = 0;
- public short mOverheat;
-
- private boolean mCheckConnections;
- public byte mDisableInput;
-
- public GT_MetaPipeEntity_Heat(int aID, String aName, String aNameRegional, Materials aMaterial, long aMaxTemp) {
- super(aID, aName, aNameRegional, 0);
- mMaterial = aMaterial;
- mAmperage = 1;
- mMaxTemp = aMaxTemp;
- mInsulated = false;
- mCanShock = true;
- mHeatLossPerMeter = aMaxTemp/1000;
- }
-
- public GT_MetaPipeEntity_Heat(String aName, Materials aMaterial, long aMaxTemp) {
- super(aName, 0);
- mMaterial = aMaterial;
- mAmperage = 1;
- mMaxTemp = aMaxTemp;
- mInsulated = false;
- mCanShock = true;
- mHeatLossPerMeter = aMaxTemp/1000;
- }
-
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaPipeEntity_Heat(mName, mMaterial, mMaxTemp);
- }
-
- @Override
- public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) {
- if (mCanShock && (((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0 && aEntity instanceof EntityLivingBase)
- GT_Utility.applyHeatDamage((EntityLivingBase) aEntity, mTransferredVoltageLast20);
- }
-
- @Override
- public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- if (!mCanShock) return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- return AxisAlignedBB.getBoundingBox(aX + 0.125D, aY + 0.125D, aZ + 0.125D, aX + 0.875D, aY + 0.875D, aZ + 0.875D);
- }
-
- @Override
- public boolean isSimpleMachine() {
- return true;
- }
-
- @Override
- public boolean isFacingValid(byte aFacing) {
- return false;
- }
-
- @Override
- public boolean isValidSlot(int aIndex) {
- return true;
- }
-
- @Override
- public final boolean renderInside(byte aSide) {
- return false;
- }
-
- @Override
- public int getProgresstime() {
- return (int) mTransferredAmperage * 64;
- }
-
- @Override
- public int maxProgresstime() {
- return (int) mAmperage * 64;
- }
-
- @Override
- public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
- if (!getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsEnergyIn(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), getBaseMetaTileEntity()))
- return 0;
- return transferHeat(aSide, aVoltage, aAmperage, new ArrayList<TileEntity>(Arrays.asList((TileEntity) getBaseMetaTileEntity())));
- }
-
- @Override
- public long transferHeat(byte aSide, long aVoltage, long aAmperage, ArrayList<TileEntity> aAlreadyPassedTileEntityList) {
- if (!this.isConnectedAtSide(aSide) && aSide != 6) {
- return 0L;
- } else {
- long rUsedAmperes = 0L;
- aVoltage -= this.mHeatLossPerMeter;
- if (aVoltage > 0L) {
- for (byte i = 0; i < 6 && aAmperage > rUsedAmperes; ++i) {
- if (i != aSide && this.isConnectedAtSide(i)
- && this.getBaseMetaTileEntity().getCoverBehaviorAtSide(i).letsEnergyOut(i,
- this.getBaseMetaTileEntity().getCoverIDAtSide(i),
- this.getBaseMetaTileEntity().getCoverDataAtSide(i), this.getBaseMetaTileEntity())) {
- TileEntity tTileEntity = this.getBaseMetaTileEntity().getTileEntityAtSide(i);
- if (!aAlreadyPassedTileEntityList.contains(tTileEntity)) {
- aAlreadyPassedTileEntityList.add(tTileEntity);
- if (tTileEntity instanceof IEnergyConnected) {
- if (this.getBaseMetaTileEntity().getColorization() >= 0) {
- byte tColor = ((IEnergyConnected) tTileEntity).getColorization();
- if (tColor >= 0 && tColor != this.getBaseMetaTileEntity().getColorization()) {
- continue;
- }
- }
-
- if (tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity)
- .getMetaTileEntity() instanceof IMetaTileEntityHeatPipe
- && ((IGregTechTileEntity) tTileEntity)
- .getCoverBehaviorAtSide(GT_Utility.getOppositeSide(i))
- .letsEnergyIn(GT_Utility.getOppositeSide(i),
- ((IGregTechTileEntity) tTileEntity)
- .getCoverIDAtSide(GT_Utility.getOppositeSide(i)),
- ((IGregTechTileEntity) tTileEntity)
- .getCoverDataAtSide(GT_Utility.getOppositeSide(i)),
- (IGregTechTileEntity) tTileEntity)) {
- if (((IGregTechTileEntity) tTileEntity).getTimer() > 50L) {
- rUsedAmperes += ((IMetaTileEntityHeatPipe) ((IGregTechTileEntity) tTileEntity)
- .getMetaTileEntity()).transferHeat(GT_Utility.getOppositeSide(i),
- aVoltage, aAmperage - rUsedAmperes,
- aAlreadyPassedTileEntityList);
- }
- } else {
- rUsedAmperes += ((IEnergyConnected) tTileEntity).injectEnergyUnits(
- GT_Utility.getOppositeSide(i), aVoltage, aAmperage - rUsedAmperes);
- }
- } else {
- ForgeDirection tDirection;
-
- if (tTileEntity instanceof IEnergySink) {
- tDirection = ForgeDirection.getOrientation(i).getOpposite();
- if (((IEnergySink) tTileEntity)
- .acceptsEnergyFrom((TileEntity) this.getBaseMetaTileEntity(), tDirection)
- && ((IEnergySink) tTileEntity).getDemandedEnergy() > 0.0D
- && ((IEnergySink) tTileEntity).injectEnergy(tDirection, (double) aVoltage,
- (double) aVoltage) < (double) aVoltage) {
- ++rUsedAmperes;
- }
- }
- }
- }
- }
- }
- }
-
- this.mTransferredAmperage += rUsedAmperes;
- this.mTransferredVoltageLast20 = Math.max(this.mTransferredVoltageLast20, aVoltage);
- this.mTransferredAmperageLast20 = Math.max(this.mTransferredAmperageLast20, this.mTransferredAmperage);
- if (aVoltage <= this.mMaxTemp && this.mTransferredAmperage <= this.mAmperage) {
- return rUsedAmperes;
- } else {
- if (this.mOverheat > GT_Mod.gregtechproxy.mWireHeatingTicks * 100) {
- //this.getBaseMetaTileEntity().setToFire();
- } else {
- this.mOverheat = (short) (this.mOverheat + 100);
- }
-
- return aAmperage;
- }
- }
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (aBaseMetaTileEntity.isServerSide()) {
- this.mTransferredAmperage = 0L;
- if (this.mOverheat > 0) {
- --this.mOverheat;
- }
-
- if (aTick % 20L == 0L) {
- this.mTransferredVoltageLast20 = 0L;
- this.mTransferredAmperageLast20 = 0L;
-
- for (byte tSide = 0; tSide < 6; ++tSide) {
- IGregTechTileEntity tBaseMetaTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityAtSide(tSide);
- byte uSide = GT_Utility.getOppositeSide(tSide);
- if ((this.mCheckConnections || this.isConnectedAtSide(tSide)
- || aBaseMetaTileEntity.getCoverBehaviorAtSide(tSide).alwaysLookConnected(tSide,
- aBaseMetaTileEntity.getCoverIDAtSide(tSide),
- aBaseMetaTileEntity.getCoverDataAtSide(tSide), aBaseMetaTileEntity)
- || tBaseMetaTileEntity != null && tBaseMetaTileEntity.getCoverBehaviorAtSide(uSide)
- .alwaysLookConnected(uSide, tBaseMetaTileEntity.getCoverIDAtSide(uSide),
- tBaseMetaTileEntity.getCoverDataAtSide(uSide), tBaseMetaTileEntity))
- && this.connect(tSide) == 0) {
- this.disconnect(tSide);
- }
- }
-
- if (isGT6Pipes()) {
- this.mCheckConnections = false;
- }
- }
- } else if (aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected == 4) {
- aBaseMetaTileEntity.issueTextureUpdate();
- }
-
- }
-
- @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 false;
- }
-
- @Override
- public String[] getDescription() {
- return new String[]{
- "Max Voltage: " + EnumChatFormatting.GOLD + mMaxTemp + "C" + EnumChatFormatting.GRAY,
- "Loss: " + EnumChatFormatting.RED + mHeatLossPerMeter + EnumChatFormatting.GRAY + " HU per meter",
- CORE.GT_Tooltip
- };
- }
-
- @Override
- public float getThickNess() {
- return 1;
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setInteger("HeatBuffer", this.HeatBuffer);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- this.HeatBuffer = aNBT.getInteger("HeatBuffer");
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
- protected int transmitHeat;
- protected int maxHeatEmitpeerTick;
- protected int HeatBuffer;
-
-
-
-
- public byte getTileEntityBaseType() {
- return 4;
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections,
- byte aColorIndex, boolean aConnected, boolean aRedstone) {
- float tThickNess = this.getThickNess();
- if (this.mDisableInput == 0) {
- return new ITexture[]{(ITexture) (aConnected
- ? getBaseTexture(tThickNess, 1, this.mMaterial, aColorIndex)
- : new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex],
- Dyes.getModulation(aColorIndex, this.mMaterial.mRGBa)))};
- } else {
- byte tMask = 0;
- byte[][] sRestrictionArray = new byte[][]{{2, 3, 5, 4}, {2, 3, 4, 5}, {1, 0, 4, 5}, {1, 0, 4, 5},
- {1, 0, 2, 3}, {1, 0, 2, 3}};
- if (aSide >= 0 && aSide < 6) {
- for (byte i = 0; i < 4; ++i) {
- if (this.isInputDisabledAtSide(sRestrictionArray[aSide][i])) {
- tMask = (byte) (tMask | 1 << i);
- }
- }
- }
-
- return new ITexture[]{
- (ITexture) (aConnected
- ? getBaseTexture(tThickNess, 1, this.mMaterial, aColorIndex)
- : new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex],
- Dyes.getModulation(aColorIndex, this.mMaterial.mRGBa))),
- getRestrictorTexture(tMask)};
- }
- }
-
- protected static final ITexture getBaseTexture(float aThickNess, int aPipeAmount, Materials aMaterial,
- byte aColorIndex) {
- if (aPipeAmount >= 9) {
- return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeNonuple.mTextureIndex],
- Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- } else if (aPipeAmount >= 4) {
- return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeQuadruple.mTextureIndex],
- Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- } else if (aThickNess < 0.124F) {
- return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex],
- Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- } else if (aThickNess < 0.374F) {
- return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex],
- Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- } else if (aThickNess < 0.499F) {
- return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex],
- Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- } else if (aThickNess < 0.749F) {
- return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex],
- Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- } else {
- return aThickNess < 0.874F
- ? new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex],
- Dyes.getModulation(aColorIndex, aMaterial.mRGBa))
- : new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex],
- Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- }
- }
-
- protected static final ITexture getRestrictorTexture(byte aMask) {
- switch (aMask) {
- case 1 :
- return new GT_RenderedTexture(BlockIcons.PIPE_RESTRICTOR_UP);
- case 2 :
- return new GT_RenderedTexture(BlockIcons.PIPE_RESTRICTOR_DOWN);
- case 3 :
- return new GT_RenderedTexture(BlockIcons.PIPE_RESTRICTOR_UD);
- case 4 :
- return new GT_RenderedTexture(BlockIcons.PIPE_RESTRICTOR_LEFT);
- case 5 :
- return new GT_RenderedTexture(BlockIcons.PIPE_RESTRICTOR_UL);
- case 6 :
- return new GT_RenderedTexture(BlockIcons.PIPE_RESTRICTOR_DL);
- case 7 :
- return new GT_RenderedTexture(BlockIcons.PIPE_RESTRICTOR_NR);
- case 8 :
- return new GT_RenderedTexture(BlockIcons.PIPE_RESTRICTOR_RIGHT);
- case 9 :
- return new GT_RenderedTexture(BlockIcons.PIPE_RESTRICTOR_UR);
- case 10 :
- return new GT_RenderedTexture(BlockIcons.PIPE_RESTRICTOR_DR);
- case 11 :
- return new GT_RenderedTexture(BlockIcons.PIPE_RESTRICTOR_NL);
- case 12 :
- return new GT_RenderedTexture(BlockIcons.PIPE_RESTRICTOR_LR);
- case 13 :
- return new GT_RenderedTexture(BlockIcons.PIPE_RESTRICTOR_ND);
- case 14 :
- return new GT_RenderedTexture(BlockIcons.PIPE_RESTRICTOR_NU);
- case 15 :
- return new GT_RenderedTexture(BlockIcons.PIPE_RESTRICTOR);
- default :
- return null;
- }
- }
-
-
- public final boolean isGT6Pipes() {
- return StaticFields59.mGT6StylePipes;
- }
-
- public void updateHeatEntity() {
- int amount = this.getMaxHeatEmittedPerTick() - this.HeatBuffer;
- if (amount > 0) {
- this.addtoHeatBuffer(this.fillHeatBuffer(amount));
- }
- }
-
- public boolean facingMatchesDirection(ForgeDirection direction) {
- return true;
- }
-
- public int maxrequestHeatTick(ForgeDirection directionFrom) {
- return this.getMaxHeatEmittedPerTick();
- }
-
- public int requestHeat(ForgeDirection directionFrom, int requestheat) {
- if (this.facingMatchesDirection(directionFrom)) {
- int heatbuffertemp = this.getHeatBuffer();
- if (this.getHeatBuffer() >= requestheat) {
- this.setHeatBuffer(this.getHeatBuffer() - requestheat);
- this.transmitHeat = requestheat;
- return requestheat;
- } else {
- this.transmitHeat = heatbuffertemp;
- this.setHeatBuffer(0);
- return heatbuffertemp;
- }
- } else {
- return 0;
- }
- }
-
-
- public int getHeatBuffer() {
- return this.HeatBuffer;
- }
-
- public void setHeatBuffer(int HeatBuffer) {
- this.HeatBuffer = HeatBuffer;
- }
-
- public void addtoHeatBuffer(int heat) {
- this.setHeatBuffer(this.getHeatBuffer() + heat);
- }
-
-
- public int fillHeatBuffer(int maxAmount) {
- return maxAmount >= this.getMaxHeatEmittedPerTick() ? this.getMaxHeatEmittedPerTick() : maxAmount;
- }
-
- public int getMaxHeatEmittedPerTick() {
- return (int) (this.mMaxTemp/1000);
- }
-
-
- public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
- float aZ) {
- if (isGT6Pipes()) {
- byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
- byte tMask = (byte) (1 << tSide);
- if (aPlayer.isSneaking()) {
- if (this.isInputDisabledAtSide(tSide)) {
- this.mDisableInput = (byte) (this.mDisableInput & ~tMask);
- GT_Utility.sendChatToPlayer(aPlayer, this.trans("212", "Input enabled"));
- if (!this.isConnectedAtSide(tSide)) {
- this.connect(tSide);
- }
- } else {
- this.mDisableInput |= tMask;
- GT_Utility.sendChatToPlayer(aPlayer, this.trans("213", "Input disabled"));
- }
- } else if (!this.isConnectedAtSide(tSide)) {
- if (this.connect(tSide) > 0) {
- GT_Utility.sendChatToPlayer(aPlayer, this.trans("214", "Connected"));
- }
- } else {
- this.disconnect(tSide);
- GT_Utility.sendChatToPlayer(aPlayer, this.trans("215", "Disconnected"));
- }
-
- return true;
- } else {
- return false;
- }
- }
-
- public boolean isInputDisabledAtSide(int aSide) {
- return (this.mDisableInput & 1 << aSide) != 0;
- }
-
-
-
-
- @Override
- public int maxHeatInPerTick(ForgeDirection var1) {
- return (int) (this.mMaxTemp/500);
- }
-
- @Override
- public int addHeat(ForgeDirection var1, int var2) {
-
-
-
- /*ForgeDirection dir = ForgeDirection.getOrientation(this.getFacing());
- TileEntity te = this.getBaseMetaTileEntity().getWorld().getTileEntity(this.xCoord + dir.offsetX, this.yCoord + dir.offsetY,
- this.zCoord + dir.offsetZ);
- if (te instanceof IHeatSource) {
- int heatbandwith = ((IHeatSource) te).maxrequestHeatTick(dir.getOpposite());
- double freeEUstorage = (double) this.maxEUStorage - this.EUstorage;
- if (freeEUstorage >= this.productionpeerheat * (double) heatbandwith) {
- this.receivedheat = ((IHeatSource) te).requestHeat(dir.getOpposite(), heatbandwith);
- if (this.receivedheat != 0) {
- this.production = (double) this.receivedheat * this.productionpeerheat;
- this.EUstorage += this.production;
- return true;
- }
- }
- }
-
- this.production = 0.0D;
- this.receivedheat = 0;*/
-
-
- return 0;
- }
-
- @Override
- public int getTransmitHeat() {
- return this.transmitHeat;
- }
-
-
-
-
-
-} \ No newline at end of file
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/GregtechMetaPipeEntityFluid.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java
index 8a29dc5db2..be23123193 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java
@@ -18,13 +18,7 @@ public class GregtechMetaPipeEntityFluid extends GT_MetaPipeEntity_Fluid {
public static final boolean mGt6Pipe;
static {
- Boolean aGt6 = (Boolean) StaticFields59.getFieldFromGregtechProxy("gt6Pipe");
- if (aGt6 != null) {
- mGt6Pipe = aGt6;
- }
- else {
- mGt6Pipe = false;
- }
+ mGt6Pipe = StaticFields59.mGT6StylePipes;
}
public final GT_Materials mMaterial;
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/GregtechMetaPipeEntityBase_Cable.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java
index d17c820699..4dd5bf25d6 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java
@@ -5,6 +5,7 @@ import static gregtech.api.enums.GT_Values.VN;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashSet;
import cofh.api.energy.IEnergyReceiver;
import net.minecraft.entity.Entity;
@@ -219,6 +220,18 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements
return this.transferElectricity(aSide, aVoltage, aAmperage,
new ArrayList<>(Arrays.asList((TileEntity) this.getBaseMetaTileEntity())));
}
+
+
+ /**
+ * Adds support for the newer function added by https://github.com/Blood-Asp/GT5-Unofficial/commit/73ee102b63efd92c0f164a7ed7a79ebcd2619617#diff-3051838621d8ae87aa5ccd1345e1f07d
+ */
+ public long transferElectricity(byte arg0, long arg1, long arg2, HashSet<TileEntity> arg3) {
+ ArrayList<TileEntity> aTiles = new ArrayList<TileEntity>();
+ for (TileEntity y : arg3) {
+ aTiles.add(y);
+ }
+ return transferElectricity(arg0, arg1, arg2, aTiles);
+ }
@Override
public long transferElectricity(final byte aSide, long aVoltage, final long aAmperage,
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 0e1ef0e47e..4a6cad20c3 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
@@ -4,9 +4,9 @@ import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
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;
@@ -41,18 +41,28 @@ 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;
+import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine_Default;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_Multi_Basic_Slotted;
+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_InputBattery;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBattery;
@@ -66,16 +76,13 @@ 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 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);
@@ -83,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
@@ -98,9 +116,14 @@ GT_MetaTileEntity_MultiBlockBase {
//Control Core Hatch
public ArrayList<GT_MetaTileEntity_Hatch_ControlCore> mControlCoreBus = new ArrayList<GT_MetaTileEntity_Hatch_ControlCore>();
+ public ArrayList<GT_MetaTileEntity_Hatch_AirIntake> mAirIntakes = new ArrayList<GT_MetaTileEntity_Hatch_AirIntake>();
public ArrayList<GT_MetaTileEntity_Hatch_InputBattery> mChargeHatches = new ArrayList<GT_MetaTileEntity_Hatch_InputBattery>();
public ArrayList<GT_MetaTileEntity_Hatch_OutputBattery> mDischargeHatches = new ArrayList<GT_MetaTileEntity_Hatch_OutputBattery>();
+ // 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);
@@ -120,13 +143,23 @@ GT_MetaTileEntity_MultiBlockBase {
public abstract boolean hasSlotInGUI();
+ public long getTotalRuntimeInTicks() {
+ return this.mTotalRunTime;
+ }
+
@Override
public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
if (hasSlotInGUI()) {
return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity);
}
- else {
- return new CONTAINER_MultiMachine(aPlayerInventory, aBaseMetaTileEntity);
+ else {
+ String aCustomGUI = getCustomGUIResourceName();
+ if (aCustomGUI == null) {
+ return new CONTAINER_MultiMachine_NoPlayerInventory(aPlayerInventory, aBaseMetaTileEntity);
+ }
+ else {
+ return new CONTAINER_MultiMachine(aPlayerInventory, aBaseMetaTileEntity);
+ }
}
}
@@ -139,7 +172,7 @@ GT_MetaTileEntity_MultiBlockBase {
@Override
public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
String aCustomGUI = getCustomGUIResourceName();
- aCustomGUI = aCustomGUI != null ? aCustomGUI : "MultiblockDisplay";
+ aCustomGUI = aCustomGUI != null ? aCustomGUI : hasSlotInGUI() ? "MultiblockDisplay" : "MultiblockDisplay_Generic";
aCustomGUI = aCustomGUI + ".png";
if (hasSlotInGUI()) {
if (!requiresVanillaGtGUI()) {
@@ -150,7 +183,12 @@ GT_MetaTileEntity_MultiBlockBase {
}
}
else {
- return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), aCustomGUI);
+ if (getCustomGUIResourceName() == null && !hasSlotInGUI()) {
+ return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), aCustomGUI);
+ }
+ else {
+ return new GUI_MultiMachine_Default(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), aCustomGUI);
+ }
}
}
@@ -189,31 +227,17 @@ GT_MetaTileEntity_MultiBlockBase {
long minutes = TimeUnit.SECONDS.toMinutes(seconds) - (TimeUnit.SECONDS.toHours(seconds) * 60);
long second = TimeUnit.SECONDS.toSeconds(seconds) - (TimeUnit.SECONDS.toMinutes(seconds) *60);
- int mPollutionReduction=0;
- for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- mPollutionReduction=Math.max(calculatePollutionReductionForHatch(tHatch, 100),mPollutionReduction);
- }
- }
-
- long storedEnergy=0;
- long maxEnergy=0;
- for(GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) {
- if (isValidMetaTileEntity(tHatch)) {
- storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU();
- maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity();
- }
- }
-
+ int mPollutionReduction = getPollutionReductionForAllMufflers();
+ long storedEnergy = getStoredEnergyInAllEnergyHatches();
+ long maxEnergy = getMaxEnergyStorageOfAllEnergyHatches();
int tTier = this.getControlCoreTier();
-
mInfo.add(getMachineTooltip());
//Lets borrow the GTNH handling
- mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.Progress")+": "+
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.progress")+": "+
EnumChatFormatting.GREEN + Integer.toString(mProgresstime/20) + EnumChatFormatting.RESET +" s / "+
EnumChatFormatting.YELLOW + Integer.toString(mMaxProgresstime/20) + EnumChatFormatting.RESET +" s");
@@ -260,6 +284,36 @@ GT_MetaTileEntity_MultiBlockBase {
}
+ public int getPollutionReductionForAllMufflers() {
+ int mPollutionReduction=0;
+ for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ mPollutionReduction=Math.max(calculatePollutionReductionForHatch(tHatch, 100),mPollutionReduction);
+ }
+ }
+ return mPollutionReduction;
+ }
+
+ public long getStoredEnergyInAllEnergyHatches() {
+ long storedEnergy=0;
+ for(GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU();
+ }
+ }
+ return storedEnergy;
+ }
+
+ public long getMaxEnergyStorageOfAllEnergyHatches() {
+ long maxEnergy=0;
+ for(GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity();
+ }
+ }
+ return maxEnergy;
+ }
+
@Override
public boolean isGivingInformation() {
return true;
@@ -294,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();
@@ -330,7 +384,7 @@ GT_MetaTileEntity_MultiBlockBase {
AutoMap<String> aOrderedMap = new AutoMap<String>();
if (showHatches) {
aOrderedMap.put(aRequiresMaint);
- aOrderedMap.put(aRequiresCoreModule);
+ //aOrderedMap.put(aRequiresCoreModule);
if (showPollution) {
aOrderedMap.put(aRequiresMuffler);
}
@@ -361,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();
@@ -414,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;
+ }
+ }
}
}
- if (!tCanBufferFluid) return false;
+
+ 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;
+ }
+ }
+
+ /*
+ * End Fluid Management
+ */
}
+
return true;
}
@@ -484,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();
+ }
}
@@ -678,12 +989,20 @@ GT_MetaTileEntity_MultiBlockBase {
* log("GOOD RETURN - 1"); return true; }
*/
+ public long getMaxInputEnergy() {
+ long rEnergy = 0;
+ if (mEnergyHatches.size() < 2) // so it only takes 1 amp is only 1 hatch is present so it works like most gt multies
+ return mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage();
+ for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches)
+ if (isValidMetaTileEntity(tHatch)) rEnergy += tHatch.getBaseMetaTileEntity().getInputVoltage() * tHatch.getBaseMetaTileEntity().getInputAmperage();
+ return rEnergy;
+ }
+
public boolean checkRecipeGeneric(
ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
int aMaxParallelRecipes, int aEUPercent,
int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) {
- // Based on the Processing Array. A bit overkill, but very flexible.
-
+ // Based on the Processing Array. A bit overkill, but very flexible.
// Reset outputs and progress stats
this.mEUt = 0;
@@ -693,13 +1012,13 @@ GT_MetaTileEntity_MultiBlockBase {
long tVoltage = getMaxInputVoltage();
byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ long tEnergy = getMaxInputEnergy();
log("Running checkRecipeGeneric(0)");
-
-
+
GT_Recipe tRecipe = findRecipe(
getBaseMetaTileEntity(), mLastRecipe, false,
- gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
-
+ gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
+
log("Running checkRecipeGeneric(1)");
// Remember last recipe - an optimization for findRecipe()
this.mLastRecipe = tRecipe;
@@ -708,6 +1027,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");
@@ -726,7 +1089,7 @@ GT_MetaTileEntity_MultiBlockBase {
log("tVoltage: "+tVoltage);
log("tRecipeEUt: "+tRecipeEUt);
// Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
- for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) {
+ for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
log("Broke at "+parallelRecipes+".");
break;
@@ -743,6 +1106,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);
@@ -835,7 +1199,7 @@ GT_MetaTileEntity_MultiBlockBase {
log("GOOD RETURN - 1");
return true;
-}
+ }
@@ -932,10 +1296,10 @@ GT_MetaTileEntity_MultiBlockBase {
ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
int aMaxParallelRecipes, int aEUPercent,
int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) {
-
+
long tVoltage = getMaxInputVoltage();
byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
-
+ long tEnergy = getMaxInputEnergy();
log("Running checkRecipeGeneric(0)");
GT_Recipe tRecipe = aRecipe != null ? aRecipe : findRecipe(
@@ -943,12 +1307,12 @@ GT_MetaTileEntity_MultiBlockBase {
gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
log("Running checkRecipeGeneric(1)");
-
+
//First we check whether or not we have an input cached for boosting.
//If not, we set it to the current recipe.
//If we do, we compare it against the current recipe, if thy are the same, we try return a boosted recipe, if not, we boost a new recipe.
boolean isRecipeInputTheSame = false;
-
+
//No cached recipe inputs, assume first run.
if (mInputVerificationForBoosting == null) {
mInputVerificationForBoosting = tRecipe.mInputs;
@@ -963,7 +1327,7 @@ GT_MetaTileEntity_MultiBlockBase {
isRecipeInputTheSame = false;
}
}
-
+
//Inputs are the same, let's see if there's a boosted version.
if (isRecipeInputTheSame) {
//Yes, let's just set that as the recipe
@@ -999,14 +1363,14 @@ GT_MetaTileEntity_MultiBlockBase {
mHasBoostedCurrentRecipe = false;
}
}
-
+
//Bad modify, let's just use the original recipe.
if (!mHasBoostedCurrentRecipe || mBoostedRecipe == null) {
tRecipe = aRecipe != null ? aRecipe : findRecipe(
getBaseMetaTileEntity(), mLastRecipe, false,
gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
}
-
+
// Remember last recipe - an optimization for findRecipe()
this.mLastRecipe = tRecipe;
@@ -1032,7 +1396,7 @@ GT_MetaTileEntity_MultiBlockBase {
log("tVoltage: "+tVoltage);
log("tRecipeEUt: "+tRecipeEUt);
// Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
- for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) {
+ for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
log("Broke at "+parallelRecipes+".");
break;
@@ -1188,6 +1552,7 @@ GT_MetaTileEntity_MultiBlockBase {
this.mChargeHatches.clear();
this.mDischargeHatches.clear();
this.mControlCoreBus.clear();
+ this.mAirIntakes.clear();
this.mMultiDynamoHatches.clear();
}
}
@@ -1252,22 +1617,22 @@ GT_MetaTileEntity_MultiBlockBase {
ItemStack guiSlot = this.mInventory[1];
return guiSlot;
}
-
+
protected boolean setGUIItemStack(ItemStack aNewGuiSlotContents) {
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;
}
return result;
}
-
+
protected boolean clearGUIItemSlot() {
return setGUIItemStack(null);
}
-
+
public ItemStack findItemInInventory(Item aSearchStack) {
return findItemInInventory(aSearchStack, 0);
@@ -1276,7 +1641,7 @@ GT_MetaTileEntity_MultiBlockBase {
public ItemStack findItemInInventory(Item aSearchStack, int aMeta) {
return findItemInInventory(ItemUtils.simpleMetaStack(aSearchStack, aMeta, 1));
}
-
+
public ItemStack findItemInInventory(ItemStack aSearchStack) {
if (aSearchStack != null && this.mInputBusses.size() > 0) {
for (GT_MetaTileEntity_Hatch_InputBus bus : this.mInputBusses) {
@@ -1325,54 +1690,63 @@ 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;
}
+ public void fixAllMaintenanceIssue() {
+ this.mCrowbar = true;
+ this.mWrench = true;
+ this.mHardHammer = true;
+ this.mSoftHammer = true;
+ this.mSolderingTool = true;
+ this.mScrewdriver = true;
+ }
+
public <E> boolean addToMachineListInternal(ArrayList<E> aList, final IMetaTileEntity aTileEntity,
final int aBaseCasingIndex) {
if (aTileEntity == null) {
return false;
}
-
+
//Check type
/*
* Class <?> aHatchType = ReflectionUtils.getTypeOfGenericObject(aList); if
* (!aHatchType.isInstance(aTileEntity)) { return false; }
*/
-
-
+
+
if (aList.isEmpty()) {
if (aTileEntity instanceof GT_MetaTileEntity_Hatch) {
if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) {
@@ -1387,13 +1761,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;
}
}
}
@@ -1546,6 +1922,20 @@ GT_MetaTileEntity_MultiBlockBase {
return addToMachineList(aTileEntity, aBaseCasingIndex);
}
+ public boolean addAirIntakeToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ }
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_AirIntake) {
+ this.mAirIntakes.add((GT_MetaTileEntity_Hatch_AirIntake)aMetaTileEntity);
+ }
+ return addToMachineList(aTileEntity, aBaseCasingIndex);
+ }
+
public boolean addFluidInputToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
if (aTileEntity == null) {
return false;
@@ -1569,6 +1959,10 @@ GT_MetaTileEntity_MultiBlockBase {
return false;
}
+ public boolean clearRecipeMapForAllInputHatches() {
+ return resetRecipeMapForAllInputHatches(null);
+ }
+
public boolean resetRecipeMapForAllInputHatches() {
return resetRecipeMapForAllInputHatches(this.getRecipeMap());
}
@@ -1588,17 +1982,22 @@ GT_MetaTileEntity_MultiBlockBase {
return cleared > 0;
}
public boolean resetRecipeMapForHatch(IGregTechTileEntity aTileEntity, GT_Recipe_Map aMap) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();;
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input || aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
- return resetRecipeMapForHatch((GT_MetaTileEntity_Hatch)aMetaTileEntity, aMap);
+ try {
+ if (aTileEntity == null) {
+ return false;
+ }
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input || aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
+ return resetRecipeMapForHatch((GT_MetaTileEntity_Hatch)aMetaTileEntity, aMap);
+ }
+ else {
+ return false;
+ }
}
- else {
+ catch (Throwable t) {
return false;
}
}
@@ -1611,12 +2010,23 @@ GT_MetaTileEntity_MultiBlockBase {
if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input || aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input){
((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = null;
- ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = aMap;
- log("Remapped Input Hatch to "+aMap.mNEIName);
+ ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = aMap;
+ if (aMap != null && aMap.mNEIName != null) {
+ log("Remapped Input Hatch to "+aMap.mNEIName+".");
+ }
+ else {
+ log("Cleared Input Hatch.");
+ }
}
else {
((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = null;
- ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = aMap;
+ ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = aMap;
+ if (aMap != null && aMap.mNEIName != null) {
+ log("Remapped Input Bus to "+aMap.mNEIName+".");
+ }
+ else {
+ log("Cleared Input Bus.");
+ }
}
return true;
}
@@ -1628,8 +2038,9 @@ GT_MetaTileEntity_MultiBlockBase {
@Override
public final void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
- resetRecipeMapForAllInputHatches();
+ clearRecipeMapForAllInputHatches();
onModeChangeByScrewdriver(aSide, aPlayer, aX, aY, aZ);
+ resetRecipeMapForAllInputHatches();
}
public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
@@ -1745,7 +2156,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)){
@@ -1784,20 +2195,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
@@ -2104,6 +2511,59 @@ GT_MetaTileEntity_MultiBlockBase {
return false;
}
+ @Override
+ public boolean depleteInput(final FluidStack aLiquid) {
+ if (aLiquid == null) {
+ return false;
+ }
+ for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
+ tHatch.mRecipeMap = this.getRecipeMap();
+ if (isValidMetaTileEntity(tHatch)) {
+ FluidStack tLiquid = tHatch.getFluid();
+ if (tLiquid == null || !tLiquid.isFluidEqual(aLiquid) || tLiquid.amount < aLiquid.amount) {
+ continue;
+ }
+ tLiquid = tHatch.drain(aLiquid.amount, false);
+ if (tLiquid != null && tLiquid.amount >= aLiquid.amount) {
+ tLiquid = tHatch.drain(aLiquid.amount, true);
+ return tLiquid != null && tLiquid.amount >= aLiquid.amount;
+ }
+ continue;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void onServerStart() {
+ super.onServerStart();
+ tryTickWaitTimerDown();
+ }
+
+ @Override
+ public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
+ super.onFirstTick(aBaseMetaTileEntity);
+ tryTickWaitTimerDown();
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ tryTickWaitTimerDown();
+ }
+
+ @Override
+ public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ super.onCreated(aStack, aWorld, aPlayer);
+ tryTickWaitTimerDown();
+ }
+
+ private final void tryTickWaitTimerDown() {
+ /*if (mStartUpCheck > 10) {
+ mStartUpCheck = 10;
+ }*/
+ }
+
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/objects/MultiblockRequirements.java b/src/Java/gtPlusPlus/xmod/gregtech/api/objects/MultiblockRequirements.java
index afdf36f930..10909081d1 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/objects/MultiblockRequirements.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/objects/MultiblockRequirements.java
@@ -2,35 +2,22 @@ package gtPlusPlus.xmod.gregtech.api.objects;
public class MultiblockRequirements {
- public final int mInputBusMinimum;
- public final int mInputHatchMinimum;
+ public int mInputBusMinimum = 0;
+ public int mInputHatchMinimum = 0;
- public final int mOutputBusMinimum;
- public final int mOutputHatchMinimum;
+ public int mOutputBusMinimum = 0;
+ public int mOutputHatchMinimum = 0;
- public final int mMaintMinimum;
+ public int mMaintMinimum = 1;
- public final int mEnergyHatchMinimum;
- public final int mDynamoHatchMinimum;
+ public int mEnergyHatchMinimum = 1;
+ public int mDynamoHatchMinimum = 0;
- public final MultiblockBlueprint mBlueprint;
-
- public static final int mControlCoreMinimum = 1;
+ public final int mMinimumCasingCount;
- /**
- *
- * @param aInputBusses
- * @param aOutputBusses
- * @param aInputHatches
- * @param aOutputHatches
- * @param aEnergyHatches
- * @param aDynamoHatches
- * @param aBlueprint - A data object containing the structural data for this Multiblock
- */
- public MultiblockRequirements(final int aInputBusses, final int aOutputBusses, final int aInputHatches, final int aOutputHatches, final int aEnergyHatches, final int aDynamoHatches, final MultiblockBlueprint aBlueprint) {
- this(aInputBusses, aOutputBusses, aInputHatches, aOutputHatches, aEnergyHatches, aDynamoHatches, 1, aBlueprint);
- }
+ public final MultiblockBlueprint mBlueprint;
+ //public static final int mControlCoreMinimum = 1;
/**
*
* @param aInputBusses
@@ -42,15 +29,80 @@ public class MultiblockRequirements {
* @param aMaintHatches
* @param aBlueprint - A data object containing the structural data for this Multiblock
*/
- public MultiblockRequirements(final int aInputBusses, final int aOutputBusses, final int aInputHatches, final int aOutputHatches, final int aEnergyHatches, final int aDynamoHatches, final int aMaintHatches, final MultiblockBlueprint aBlueprint) {
- mInputBusMinimum = aInputBusses;
- mOutputBusMinimum = aOutputBusses;
- mInputHatchMinimum = aInputHatches;
- mOutputHatchMinimum = aOutputHatches;
- mEnergyHatchMinimum = aEnergyHatches;
- mDynamoHatchMinimum = aDynamoHatches;
- mMaintMinimum = aMaintHatches;
+ public MultiblockRequirements(int aCasingCount, MultiblockBlueprint aBlueprint) {
+ mMinimumCasingCount = aCasingCount;
mBlueprint = aBlueprint;
+ }
+
+ public final int getInputBusMinimum() {
+ return this.mInputBusMinimum;
+ }
+
+ public final MultiblockRequirements setInputBusMinimum(int mInputBusMinimum) {
+ this.mInputBusMinimum = mInputBusMinimum;
+ return this;
+ }
+
+ public final int getInputHatchMinimum() {
+ return this.mInputHatchMinimum;
+ }
+
+ public final MultiblockRequirements setInputHatchMinimum(int mInputHatchMinimum) {
+ this.mInputHatchMinimum = mInputHatchMinimum;
+ return this;
+ }
+
+ public final int getOutputBusMinimum() {
+ return this.mOutputBusMinimum;
+ }
+
+ public final MultiblockRequirements setOutputBusMinimum(int mOutputBusMinimum) {
+ this.mOutputBusMinimum = mOutputBusMinimum;
+ return this;
+ }
+
+ public final int getOutputHatchMinimum() {
+ return this.mOutputHatchMinimum;
+ }
+
+ public final MultiblockRequirements setOutputHatchMinimum(int mOutputHatchMinimum) {
+ this.mOutputHatchMinimum = mOutputHatchMinimum;
+ return this;
+ }
+
+ public final int getMaintMinimum() {
+ return this.mMaintMinimum;
+ }
+
+ public final MultiblockRequirements setMaintMinimum(int mMaintMinimum) {
+ this.mMaintMinimum = mMaintMinimum;
+ return this;
+ }
+
+ public final int getEnergyHatchMinimum() {
+ return this.mEnergyHatchMinimum;
+ }
+
+ public final MultiblockRequirements setEnergyHatchMinimum(int mEnergyHatchMinimum) {
+ this.mEnergyHatchMinimum = mEnergyHatchMinimum;
+ return this;
+ }
+
+ public final int getDynamoHatchMinimum() {
+ return this.mDynamoHatchMinimum;
+ }
+
+ public final MultiblockRequirements setDynamoHatchMinimum(int mDynamoHatchMinimum) {
+ this.mDynamoHatchMinimum = mDynamoHatchMinimum;
+ return this;
+ }
+
+ public final MultiblockBlueprint getBlueprint() {
+ return this.mBlueprint;
+ }
+
+ public final int getMinimumCasingCount() {
+ return this.mMinimumCasingCount;
}
}
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 77f3a31020..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,11 +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;
@@ -44,78 +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
- StaticFields59.mGT6StylePipes = (boolean) StaticFields59.getFieldFromGregtechProxy("gt6Pipe");
-
-
- GT_Log.out.println("GT++ Mod: Registering the BaseMetaTileEntity.");
- GameRegistry.registerTileEntity(tBaseMetaTileEntity.getClass(), "BaseMetaTileEntity_GTPP");
- GameRegistry.registerTileEntity(tBaseMetaTileEntity2.getClass(), "BaseMetaTileEntity_GTPP2");
+ 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) {
@@ -128,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) {
@@ -157,7 +259,7 @@ public class Meta_GT_Proxy {
}
aPlasma = aGregMaterial.getPlasma(100);
}
-
+
//Just wildcard values
if (aMoltenFluid == null || aPlasma == null) {
if (aMoltenFluid == null) {
@@ -167,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));
@@ -182,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();
@@ -233,7 +335,7 @@ public class Meta_GT_Proxy {
return Meta_GT_Proxy.constructBaseMetaTileEntity();
}
}
-
+
public static BaseCustomTileEntity constructBaseMetaTileEntity() {
if (sBaseMetaTileEntityClass == null) {
try {
@@ -260,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);
}
@@ -295,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);
}
@@ -332,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");
@@ -371,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;
@@ -434,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) {
@@ -468,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);
}
@@ -493,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");
@@ -536,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 5116632cf1..b624649789 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java
@@ -35,7 +35,7 @@ extends GregtechMetaCasingBlocksAbstract {
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Low Pressure Turbine Casing");
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "High Pressure Turbine Casing");
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Vacuum Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Turbodyne Casing");
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "");
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "");
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", "");
@@ -51,8 +51,8 @@ extends GregtechMetaCasingBlocksAbstract {
GregtechItemList.Casing_Turbine_LP.set(new ItemStack(this, 1, 8));
GregtechItemList.Casing_Turbine_HP.set(new ItemStack(this, 1, 9));
GregtechItemList.Casing_Vacuum_Furnace.set(new ItemStack(this, 1, 10));
- /*GregtechItemList.Casing_ThermalContainment.set(new ItemStack(this, 1, 11));
- GregtechItemList.Casing_Autocrafter.set(new ItemStack(this, 1, 12));
+ GregtechItemList.Casing_RocketEngine.set(new ItemStack(this, 1, 11));
+ /*GregtechItemList.Casing_Autocrafter.set(new ItemStack(this, 1, 12));
GregtechItemList.Casing_CuttingFactoryFrame.set(new ItemStack(this, 1, 13));
GregtechItemList.Casing_TeslaTower.set(new ItemStack(this, 1, 14));
GregtechItemList.Casing_PLACEHOLDER_TreeFarmer.set(new ItemStack(this, 1, 15));*/
@@ -122,7 +122,7 @@ extends GregtechMetaCasingBlocksAbstract {
//Multitank Exterior Casing
case 11:
- return TexturesGtBlock.Casing_Material_Tantalloy61.getIcon();
+ return TexturesGtBlock.TEXTURE_CASING_ROCKETDYNE.getIcon();
//Reactor Casing I
case 12:
return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon();
@@ -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 aaacbcd3a0..6cac1fddea 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java
@@ -30,9 +30,15 @@ public class TexturesGtBlock {
public static class CustomIcon implements IIconContainer, Runnable {
protected IIcon mIcon;
protected String mIconName;
+ protected String mModID;
public CustomIcon(final String aIconName) {
+ this(CORE.MODID, aIconName);
+ }
+
+ public CustomIcon(final String aModID, final String aIconName) {
this.mIconName = aIconName;
+ this.mModID = aModID;
mCustomiconMap.put(this);
Logger.WARNING("Constructing a Custom Texture. " + this.mIconName);
GregTech_API.sGTBlockIconload.add(this);
@@ -50,7 +56,7 @@ public class TexturesGtBlock {
@Override
public void run() {
- this.mIcon = GregTech_API.sBlockIcons.registerIcon(CORE.MODID + ":" + this.mIconName);
+ this.mIcon = GregTech_API.sBlockIcons.registerIcon(this.mModID + ":" + this.mIconName);
Logger.WARNING("FIND ME _ Processing texture: "+this.getTextureFile().getResourcePath());
}
@@ -273,6 +279,8 @@ public class TexturesGtBlock {
public static final CustomIcon TEXTURE_CASING_AMAZON = new CustomIcon("TileEntities/CASING_AMAZON");
public static final CustomIcon TEXTURE_CASING_ADVANCED_CRYOGENIC = new CustomIcon("TileEntities/MACHINE_CASING_ADVANCED_CRYOGENIC");
public static final CustomIcon TEXTURE_CASING_ADVANCED_VOLCNUS = new CustomIcon("TileEntities/MACHINE_CASING_ADVANCED_VOLCANUS");
+ public static final CustomIcon TEXTURE_CASING_ROCKETDYNE = new CustomIcon("TileEntities/MACHINE_CASING_ROCKETDYNE");
+
public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II = new CustomIcon("iconsets/MACHINE_CASING_FUSION_3");
public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_INNER = new CustomIcon("iconsets/MACHINE_CASING_FUSION_COIL_II");
@@ -342,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");
@@ -555,10 +568,7 @@ public class TexturesGtBlock {
- public static Object Casing_Material_Turbine;
-
-
-
+ public static Object Casing_Material_Turbine;
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtCutomCovers.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtCutomCovers.java
new file mode 100644
index 0000000000..cc5cf3d55e
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtCutomCovers.java
@@ -0,0 +1,32 @@
+package gtPlusPlus.xmod.gregtech.common.blocks.textures;
+
+import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon;
+
+public class TexturesGtCutomCovers {
+
+ public static final CustomIcon[] TEXTURE_ZTONES_AGON = new CustomIcon[16];
+ public static final CustomIcon[] TEXTURE_ZTONES_ISZM = new CustomIcon[16];
+ public static final CustomIcon[] TEXTURE_ZTONES_KORP = new CustomIcon[16];
+ public static final CustomIcon[] TEXTURE_ZTONES_JELT = new CustomIcon[16];
+ public static final CustomIcon[] TEXTURE_ZTONES_BITT = new CustomIcon[16];
+
+ public static void init() {
+ generateZTones();
+ }
+
+ private static void generateZTones() {
+ // ZTONES
+ String[] aZtoneCoverTextureNames = new String[] { "agon", "iszm", "korp", "jelt", "bitt" };
+ int aArrayIndex = 0;
+ CustomIcon[][] aArrays = new CustomIcon[][] { TEXTURE_ZTONES_AGON, TEXTURE_ZTONES_ISZM, TEXTURE_ZTONES_KORP,
+ TEXTURE_ZTONES_JELT, TEXTURE_ZTONES_BITT };
+
+ for (CustomIcon[] t : aArrays) {
+ for (int s = 0; s < 16; s++) {
+ t[s] = new CustomIcon("Ztones", "sets/" + aZtoneCoverTextureNames[aArrayIndex] + "/"+aZtoneCoverTextureNames[aArrayIndex]+"_ (" + s + ")");
+ }
+ aArrayIndex++;
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java b/src/Java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java
new file mode 100644
index 0000000000..2fba1b0448
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java
@@ -0,0 +1,102 @@
+package gtPlusPlus.xmod.gregtech.common.covers;
+
+import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtCutomCovers.TEXTURE_ZTONES_AGON;
+import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtCutomCovers.TEXTURE_ZTONES_BITT;
+import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtCutomCovers.TEXTURE_ZTONES_ISZM;
+import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtCutomCovers.TEXTURE_ZTONES_JELT;
+import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtCutomCovers.TEXTURE_ZTONES_KORP;
+
+import cpw.mods.fml.common.Loader;
+import gtPlusPlus.core.lib.VanillaColours;
+import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon;
+import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtCutomCovers;
+import gtPlusPlus.xmod.gregtech.common.items.MetaCustomCoverItem;
+import gtPlusPlus.xmod.gregtech.common.items.covers.MetaItemCoverCasings;
+
+public class CoverManager {
+
+ // ZTones
+ public static MetaCustomCoverItem Cover_Agon;
+ public static MetaCustomCoverItem Cover_Iszm;
+ public static MetaCustomCoverItem Cover_Korp;
+ public static MetaCustomCoverItem Cover_Jelt;
+ public static MetaCustomCoverItem Cover_Bitt;
+
+ // GT
+ public static MetaItemCoverCasings Cover_Gt_Machine_Casing;
+
+ public static void generateCustomCovers() {
+
+ // init textures
+ TexturesGtCutomCovers.init();
+
+ // GT Machine Casings
+ Cover_Gt_Machine_Casing = new MetaItemCoverCasings();
+
+ if (Loader.isModLoaded("Ztones")) {
+ String[] aZtoneCoverTextureNames = new String[] { "agon", "iszm", "korp", "jelt", "bitt" };
+ MetaCustomCoverItem[] aZtoneCoverItems = new MetaCustomCoverItem[] { Cover_Agon, Cover_Iszm, Cover_Korp,
+ Cover_Jelt, Cover_Bitt };
+ CustomIcon[][] aArrays = new CustomIcon[][] { TEXTURE_ZTONES_AGON, TEXTURE_ZTONES_ISZM, TEXTURE_ZTONES_KORP,
+ TEXTURE_ZTONES_JELT, TEXTURE_ZTONES_BITT };
+ short[][][] aRGB = new short[][][] { ZTONES.RGB_AGON, ZTONES.RGB_ISZM, ZTONES.RGB_KORP, ZTONES.RGB_JELT,
+ ZTONES.RGB_BITT };
+ for (int y = 0; y < aZtoneCoverTextureNames.length; y++) {
+ aZtoneCoverItems[y] = new MetaCustomCoverItem("Ztones", 16, aZtoneCoverTextureNames[y], aArrays[y],
+ aRGB[y]);
+ }
+ }
+
+ }
+
+ final static class ZTONES {
+
+ private static final short[][] RGB_AGON = new short[][] { VanillaColours.DYE_WHITE.getAsShort(),
+ VanillaColours.DYE_YELLOW.getAsShort(), VanillaColours.DYE_LIME.getAsShort(),
+ VanillaColours.DYE_GREEN.getAsShort(), VanillaColours.DYE_CYAN.getAsShort(),
+ VanillaColours.DYE_LIGHT_BLUE.getAsShort(), VanillaColours.DYE_DARK_BLUE.getAsShort(),
+ VanillaColours.DYE_DARK_PURPLE.getAsShort(), VanillaColours.DYE_LIGHT_PURPLE.getAsShort(),
+ VanillaColours.DYE_PINK.getAsShort(), VanillaColours.DYE_RED.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_BROWN.getAsShort(),
+ VanillaColours.DYE_BLACK.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(),
+ VanillaColours.DYE_LIGHT_GRAY.getAsShort(), };
+ private static final short[][] RGB_ISZM = new short[][] { VanillaColours.DYE_LIGHT_GRAY.getAsShort(),
+ VanillaColours.DYE_WHITE.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(),
+ VanillaColours.DYE_DARK_BLUE.getAsShort(), VanillaColours.DYE_YELLOW.getAsShort(),
+ VanillaColours.DYE_DARK_BLUE.getAsShort(), VanillaColours.DYE_RED.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_CYAN.getAsShort(),
+ VanillaColours.DYE_YELLOW.getAsShort(), VanillaColours.DYE_RED.getAsShort(),
+ VanillaColours.DYE_CYAN.getAsShort(), VanillaColours.DYE_GREEN.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_LIGHT_BLUE.getAsShort(),
+ VanillaColours.DYE_DARK_PURPLE.getAsShort(),
+ };
+ private static final short[][] RGB_KORP = new short[][] { new short[] { 125, 125, 125 },
+ VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(),
+ VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(),
+ VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(),
+ VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(),
+ VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(),
+ VanillaColours.DYE_DARK_GRAY.getAsShort(), new short[] { 22, 156, 156 }, new short[] { 22, 156, 156 },
+ VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), };
+ private static final short[][] RGB_JELT = new short[][] { VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_ORANGE.getAsShort(), };
+ private static final short[][] RGB_BITT = new short[][] { VanillaColours.DYE_BLACK.getAsShort(),
+ VanillaColours.DYE_WHITE.getAsShort(), VanillaColours.DYE_YELLOW.getAsShort(),
+ VanillaColours.DYE_LIME.getAsShort(), VanillaColours.DYE_GREEN.getAsShort(),
+ VanillaColours.DYE_CYAN.getAsShort(), VanillaColours.DYE_LIGHT_BLUE.getAsShort(),
+ VanillaColours.DYE_LIGHT_BLUE.getAsShort(), VanillaColours.DYE_DARK_BLUE.getAsShort(),
+ VanillaColours.DYE_DARK_PURPLE.getAsShort(), VanillaColours.DYE_LIGHT_PURPLE.getAsShort(),
+ VanillaColours.DYE_PINK.getAsShort(), VanillaColours.DYE_RED.getAsShort(),
+ VanillaColours.DYE_RED.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(),
+ VanillaColours.DYE_BROWN.getAsShort(), };
+
+ }
+
+}
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
new file mode 100644
index 0000000000..65b59ce151
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java
@@ -0,0 +1,186 @@
+package gtPlusPlus.xmod.gregtech.common.covers;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import gregtech.api.interfaces.tileentity.ICoverable;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+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;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.Fluid;
+
+public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior {
+
+ private static final Map<String, Integer> sConnectionStateForEntityMap = new ConcurrentHashMap<String, Integer>();
+ private static final Map<String, String> sPrefixMap = new ConcurrentHashMap<String, String>();
+ private static final int VALUE_OFF = 0;
+ private static final int VALUE_ON = 1;
+
+ public static String generateUniqueKey(byte aSide, ICoverable aEntity) {
+ try {
+ BlockPos aPos = new BlockPos(aEntity.getIGregTechTileEntity(aEntity.getXCoord(), aEntity.getYCoord(), aEntity.getZCoord()));
+ ForgeDirection aDir = ForgeDirection.getOrientation(aSide);
+ String s = aEntity.getInventoryName()+"."+aPos.getUniqueIdentifier()+aDir.name();
+ return s;
+ }
+ catch (Throwable t) {}
+ XSTR x = new XSTR();
+ return "ERROR."+x.getSeed()+x.hashCode()+x.nextDouble()+".ID";
+ }
+
+ public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
+ EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ PlayerUtils.messagePlayer(aPlayer, LangUtils.trans("756", "Connectable: ") + getConnectionState(aCoverVariable));
+ return super.onCoverRightclick(aSide, aCoverID, aCoverVariable, aTileEntity, aPlayer, aX, aY, aZ);
+ }
+
+ public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
+ EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ return super.onCoverScrewdriverclick(aSide, aCoverID, aCoverVariable, aTileEntity, aPlayer, aX, aY, aZ);
+ }
+
+ public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return getConnectionState(aCoverVariable);
+ }
+
+ public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return getConnectionState(aCoverVariable);
+ }
+
+ public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
+ return getConnectionState(aCoverVariable);
+ }
+
+ public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
+ return getConnectionState(aCoverVariable);
+ }
+
+ public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) {
+ return getConnectionState(aCoverVariable);
+ }
+
+ public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) {
+ return getConnectionState(aCoverVariable);
+ }
+
+ public String getDescription(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return LangUtils.trans("756", "Connectable: ") + getConnectionState(aCoverVariable);
+ }
+
+ public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return 1;
+ }
+
+ @Override
+ public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
+ long aTimer) {
+ try {
+ String aKey = generateUniqueKey(aSide, aTileEntity);
+ Integer b = sConnectionStateForEntityMap.get(aKey);
+ //Logger.INFO("Val: "+aCoverVariable);
+ if (b != null && aCoverVariable != b) {
+ aCoverVariable = b;
+ }
+ if (b == null) {
+ b = aCoverVariable;
+ sConnectionStateForEntityMap.put(aKey, b);
+ trySetState(aSide, b == VALUE_ON ? VALUE_ON : VALUE_OFF, aTileEntity);
+ }
+ }
+ catch (Throwable t) {
+
+ }
+ return aCoverVariable;
+ }
+
+ @Override
+ public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return getConnectionState(aCoverVariable);
+ }
+
+ @Override
+ public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return getConnectionState(aCoverVariable);
+ }
+
+ @Override
+ public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return super.alwaysLookConnected(aSide, aCoverID, aCoverVariable, aTileEntity);
+ }
+
+ @Override
+ public byte getRedstoneInput(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable,
+ ICoverable aTileEntity) {
+ if (!getConnectionState(aCoverVariable)) {
+ return 0;
+ }
+ return super.getRedstoneInput(aSide, aInputRedstone, aCoverID, aCoverVariable, aTileEntity);
+ }
+
+ @Override
+ public void placeCover(byte aSide, ItemStack aCover, ICoverable aTileEntity) {
+ String aKey = generateUniqueKey(aSide, aTileEntity);
+ boolean state = getCoverConnections(aCover);
+ sPrefixMap.put(aKey, aCover.getUnlocalizedName());
+ Logger.INFO("Mapping key "+aKey+" to "+state);
+ sConnectionStateForEntityMap.put(aKey, state ? VALUE_ON : VALUE_OFF);
+ Logger.INFO("Key Value: "+(state ? VALUE_ON : VALUE_OFF));
+ //Try set cover state directly
+ //trySetState(aSide, state ? VALUE_ON : VALUE_OFF, aTileEntity);
+ super.placeCover(aSide, aCover, aTileEntity);
+ }
+
+ @Override
+ public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
+ boolean aForced) {
+ String aKey = generateUniqueKey(aSide, aTileEntity);
+ sConnectionStateForEntityMap.remove(aKey);
+ //Logger.INFO("Unmapping key "+aKey+".");
+ return true;
+ }
+
+ public static boolean getConnectionState(int aCoverVar) {
+ return aCoverVar == VALUE_ON;
+ }
+
+ private static final void trySetState(byte aSide, int aState, ICoverable aTile) {
+ //Try set cover state directly
+ if (aTile instanceof IGregTechTileEntity) {
+ IGregTechTileEntity gTileEntity = (IGregTechTileEntity) aTile;
+ if (gTileEntity != null) {
+ gTileEntity.setCoverDataAtSide(aSide, aState);
+ }
+ }
+ }
+
+
+ public static boolean getConnectionState(byte aSide, ICoverable aTile) {
+ String aKey = generateUniqueKey(aSide, aTile);
+ return getConnectionState(aKey);
+ }
+
+ public static boolean getConnectionState(String aKey) {
+ Integer b = sConnectionStateForEntityMap.get(aKey);
+ //Logger.INFO("Get State: "+b+" | "+aKey);
+ return b != null ? b == VALUE_ON : false;
+ }
+
+ public static final boolean getCoverConnections(final ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("CustomCoverMeta");
+ if (aNBT != null) {
+ return aNBT.getBoolean("AllowConnections");
+ }
+ }
+ return false;
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_VisualPlate.java b/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_VisualPlate.java
deleted file mode 100644
index 7d2ed2c21a..0000000000
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_VisualPlate.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package gtPlusPlus.xmod.gregtech.common.covers;
-
-import gregtech.api.interfaces.tileentity.ICoverable;
-import gregtech.api.util.GT_CoverBehavior;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraftforge.fluids.Fluid;
-
-public class GTPP_Cover_VisualPlate extends GT_CoverBehavior {
-
- public GTPP_Cover_VisualPlate() {
- }
-
- public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
- long aTimer) {
- return aCoverVariable;
- }
-
- public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
- EntityPlayer aPlayer, float aX, float aY, float aZ) {
- return aCoverVariable;
- }
-
- public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
- EntityPlayer aPlayer, float aX, float aY, float aZ) {
- return true;
- }
-
- public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return false;
- }
-
- public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return false;
- }
-
- public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return false;
- }
-
- public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return false;
- }
-
- public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
- return false;
- }
-
- public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
- return false;
- }
-
- public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) {
- return false;
- }
-
- public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) {
- return false;
- }
-
- public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return false;
- }
-
- public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return 0;
- }
-} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java
index bda75be793..70c7b2da23 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java
@@ -420,8 +420,10 @@ public class ChargingHelper {
if (stack == null) {
return false;
}
- return (Info.itemEnergy.getEnergyValue(stack) > 0.0D)
- || (ElectricItem.manager.discharge(stack, (1.0D / 0.0D), 4, true, true, true) > 0.0D);
+ else {
+ return false;
+ }
+ //return (Info.itemEnergy.getEnergyValue(stack) > 0.0D) || (ElectricItem.manager.discharge(stack, (1.0D / 0.0D), 4, true, true, true) > 0.0D);
}
}
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/MetaCustomCoverItem.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaCustomCoverItem.java
new file mode 100644
index 0000000000..7c3f764794
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaCustomCoverItem.java
@@ -0,0 +1,225 @@
+package gtPlusPlus.xmod.gregtech.common.items;
+
+import java.util.List;
+
+import org.apache.commons.lang3.StringUtils;
+
+import cofh.core.render.IconRegistry;
+import cpw.mods.fml.common.registry.GameRegistry;
+import gregtech.api.GregTech_API;
+import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.objects.GT_MultiTexture;
+import gregtech.api.objects.GT_RenderedTexture;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.client.renderer.CustomItemBlockRenderer;
+import gtPlusPlus.core.common.CommonProxy;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.sys.KeyboardUtils;
+import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon;
+import gtPlusPlus.xmod.gregtech.common.covers.GTPP_Cover_ToggleVisual;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.World;
+
+public class MetaCustomCoverItem extends Item {
+
+ protected final IIcon[] icons;
+ private final String mModID;
+ private final String mTextureSetName;
+ protected final IIconContainer[] mTextures;
+ private final short[][] mRGB;
+
+ public MetaCustomCoverItem(String aModId, int aTextureCount, String aTextureSetName, IIconContainer[] aTextures, short[][] aRGB) {
+ super();
+ icons = new IIcon[aTextureCount];
+ mModID = aModId;
+ mTextureSetName = Utils.sanitizeString(aTextureSetName);
+ mTextures = aTextures;
+ mRGB = aRGB;
+ this.setTextureName(CORE.MODID + ":" + "itemPlate");
+ this.setHasSubtypes(true);
+ String unlocalizedName = "itemCustomMetaCover." + mModID + "." + mTextureSetName;
+ this.setUnlocalizedName(unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setMaxStackSize(1);
+ GameRegistry.registerItem(this, unlocalizedName);
+ registerCover();
+ Logger.INFO("[Covers] Generated Custom covers for "+mModID+" using "+aTextureCount+" textures from "+mTextureSetName+".");
+ }
+
+ public boolean hide() {
+ return true;
+ }
+
+ private final void registerCover() {
+ //CommonProxy.registerItemRendererGlobal(this, new CustomItemBlockRenderer());
+ for (int i=0;i<icons.length;i++) {
+ ItemStack thisStack = ItemUtils.simpleMetaStack(this, i, 1);
+ if (i > 0 && hide()) {
+ ItemUtils.hideItemFromNEI(thisStack);
+ }
+ GregTech_API.registerCover(
+ thisStack,
+ new GT_MultiTexture(
+ new ITexture[]{
+ new GT_RenderedTexture(mTextures[i])
+ }),
+ new GTPP_Cover_ToggleVisual());
+ }
+ }
+
+ /*
+ * @Override public void registerIcons(IIconRegister reg) { for (int i = 0; i <
+ * icons.length; i++) { this.icons[i] = mTextures[i].getIcon(); } }
+ *
+ * @Override public IIcon getIconFromDamage(int meta) { return this.icons[meta];
+ * }
+ */
+
+ @Override
+ public void getSubItems(Item item, CreativeTabs tab, List list) {
+ for (int i = 0; i < icons.length; i++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack stack) {
+ return this.getUnlocalizedName() + "_" + stack.getItemDamage();
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack tItem) {
+ return StringUtils.capitalize(mTextureSetName) + " (" + tItem.getItemDamage() + ")"; //super.getItemStackDisplayName(tItem);
+ }
+
+ private static boolean createNBT(ItemStack rStack) {
+ final NBTTagCompound tagMain = new NBTTagCompound();
+ final NBTTagCompound tagNBT = new NBTTagCompound();
+ tagNBT.setLong("Damage", 0);
+ tagNBT.setBoolean("AllowConnections", false);
+ tagMain.setTag("CustomCoverMeta", tagNBT);
+ rStack.setTagCompound(tagMain);
+ return true;
+ }
+
+ public static final long getCoverDamage(final ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("CustomCoverMeta");
+ if (aNBT != null) {
+ return aNBT.getLong("Damage");
+ }
+ } else {
+ createNBT(aStack);
+ }
+ return 0L;
+ }
+
+ public static final boolean setCoverDamage(final ItemStack aStack, final long aDamage) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("CustomCoverMeta");
+ if (aNBT != null) {
+ aNBT.setLong("Damage", aDamage);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static final boolean getCoverConnections(final ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("CustomCoverMeta");
+ if (aNBT != null) {
+ return aNBT.getBoolean("AllowConnections");
+ }
+ } else {
+ createNBT(aStack);
+ }
+ return false;
+ }
+
+ public static final boolean setCoverConnections(final ItemStack aStack, final boolean aConnections) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("CustomCoverMeta");
+ if (aNBT != null) {
+ aNBT.setBoolean("AllowConnections", aConnections);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack) {
+ if (stack.getTagCompound() == null) {
+ createNBT(stack);
+ }
+ double currentDamage = getCoverDamage(stack);
+ double meta = stack.getItemDamage() == 0 ? 50 : 2500;
+ double durabilitypercent = currentDamage / meta;
+ return durabilitypercent;
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
+ if (KeyboardUtils.isShiftKeyDown()) {
+ boolean con = getCoverConnections(stack);
+ if (con) {
+ setCoverConnections(stack, false);
+ } else {
+ setCoverConnections(stack, true);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
+ boolean cons = getCoverConnections(stack);
+ list.add(EnumChatFormatting.GRAY + "Allows Connections: "+cons);
+ list.add(EnumChatFormatting.GRAY + "Shift Rmb to change state before applying");
+ super.addInformation(stack, player, list, bool);
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
+
+ @Override
+ public Item setFull3D() {
+ // TODO Auto-generated method stub
+ return super.setFull3D();
+ }
+
+ @Override
+ public boolean isFull3D() {
+ // TODO Auto-generated method stub
+ return super.isFull3D();
+ }
+
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
+ if (this.mRGB == null){
+ return super.getColorFromItemStack(stack, HEX_OxFFFFFF);
+ }
+ int aMeta = stack.getItemDamage();
+ return Utils.rgbtoHexValue(mRGB[aMeta][0], mRGB[aMeta][1], mRGB[aMeta][2]);
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java
index c9f4dd9ae2..db691cefc7 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java
@@ -29,7 +29,7 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaItem_X32;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gtPlusPlus.xmod.gregtech.common.covers.GTPP_Cover_Overflow;
-import gtPlusPlus.xmod.gregtech.common.covers.GTPP_Cover_VisualPlate;
+import gtPlusPlus.xmod.gregtech.common.covers.GTPP_Cover_ToggleVisual;
public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 {
@@ -333,10 +333,12 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 {
}
else {
aTierName = GT_Values.VN[i];
- mMachineCasingCovers[i].set(this.addItem(aFirstMachineCasingID++, aTierName+" Machine Plate Cover", "Looks visually like an "+aTierName+" machine casing, apply to pipe/cable as cover", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L)}));
- GregTech_API.registerCover(mMachineCasingCovers[i].get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[i][0]}), new GTPP_Cover_VisualPlate());
+ mMachineCasingCovers[i].set(this.addItem(aFirstMachineCasingID++, aTierName+" Machine Plate Cover", "Deprecated - Shapeless Craft to new version", new Object[]{}));
+ GregTech_API.registerCover(mMachineCasingCovers[i].get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[i][0]}), new GTPP_Cover_ToggleVisual());
}
}
+ GregtechItemList.Laser_Lens_WoodsGlass.set(this.addItem(140, "Wood's Glass Lens", "Allows UV & IF to pass through, blocks visible light spectrums", new Object[0]));
+
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java
index dbae4fe194..bc11cb6a11 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java
@@ -1,9 +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.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;
@@ -19,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(),
@@ -40,13 +53,33 @@ 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
- this.addTool(ELECTRIC_SNIPS, "Automatic Snips", "Hand-held electric wire cutter",
- new TOOL_Gregtech_ElectricSnips(),
- new Object[] { GregtechToolDictNames.craftingToolElectricSnips, ToolDictNames.craftingToolWireCutter,
- new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L),
- new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L),
- new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L) });
+ GregTech_API.registerTool(
+ this.addTool(ELECTRIC_SNIPS, "Automatic Snips", "Hand-held electric wire cutter",
+ new TOOL_Gregtech_ElectricSnips(),
+ new Object[] { GregtechToolDictNames.craftingToolElectricSnips, ToolDictNames.craftingToolWireCutter,
+ new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 4L),
+ new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 4L),
+ new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 4L) }), aWireCutterList);
+
// Electric Lighter
this.addTool(ELECTRIC_LIGHTER, "Pyromatic 9k", "Electric Fire!",
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/covers/MetaItemCoverCasings.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/covers/MetaItemCoverCasings.java
new file mode 100644
index 0000000000..7af057bc59
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/covers/MetaItemCoverCasings.java
@@ -0,0 +1,40 @@
+package gtPlusPlus.xmod.gregtech.common.items.covers;
+
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.Textures;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.xmod.gregtech.common.items.MetaCustomCoverItem;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.IIcon;
+
+public class MetaItemCoverCasings extends MetaCustomCoverItem {
+
+ public MetaItemCoverCasings() {
+ super(CORE.MODID, Textures.BlockIcons.MACHINECASINGS_SIDE.length, "Gt Machine Casings", Textures.BlockIcons.MACHINECASINGS_SIDE, null);
+ }
+
+ @Override
+ public void registerIcons(IIconRegister reg) {
+ for (int i = 0; i < icons.length; i++) {
+ this.icons[i] = reg.registerIcon(CORE.MODID+":"+"covers/"+i);
+ }
+ }
+
+ public boolean hide() {
+ return false;
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int meta) {
+ return this.icons[MathUtils.balance(meta, 0, 15)];
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack tItem) {
+ return EnumChatFormatting.LIGHT_PURPLE + GT_Values.VOLTAGE_NAMES[MathUtils.balance(tItem.getItemDamage(), 0, GT_Values.VOLTAGE_NAMES.length-1)]+" Machine Plate Cover"; //super.getItemStackDisplayName(tItem);
+ }
+
+}
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/requirements/RequirementsBasicCubic.java b/src/Java/gtPlusPlus/xmod/gregtech/common/requirements/RequirementsBasicCubic.java
index ba44acdcb5..e53a7e4738 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/requirements/RequirementsBasicCubic.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/requirements/RequirementsBasicCubic.java
@@ -5,7 +5,7 @@ import gtPlusPlus.xmod.gregtech.api.objects.MultiblockRequirements;
public class RequirementsBasicCubic extends MultiblockRequirements {
public RequirementsBasicCubic( ) {
- super(-1, -1, -1, -1, 1, 0, 1, null);
+ super(0, null);
}
}
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 e277b671c6..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
@@ -1,6 +1,9 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic;
import static gregtech.api.enums.GT_Values.V;
+import static gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils.mPollution;
+
+import org.apache.commons.lang3.ArrayUtils;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
@@ -40,6 +43,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi
protected boolean mHasPollution = false;
protected int SLOT_ROTOR = 4;
protected int SLOT_FILTER = 5;
+ protected static boolean mPollutionEnabled = true;
protected boolean mSaveRotor = false;
@@ -55,10 +59,12 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi
new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE),
new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB)
});
+ mPollutionEnabled = PollutionUtils.mPollution();
}
public GregtechMetaAtmosphericReconditioner(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
super(aName, aTier, 2, aDescription, aTextures, 2, 0, aGUIName, aNEIName);
+ mPollutionEnabled = PollutionUtils.mPollution();
}
/*public GregtechMetaAtmosphericReconditioner(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
@@ -75,10 +81,9 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi
@Override
public String[] getDescription() {
- boolean highTier = this.mTier >= 7;
-
+ boolean highTier = this.mTier >= 7;
- return new String[]{
+ String[] A = new String[]{
this.mDescription,
highTier ? "Will attempt to remove 1/4 pollution from 8 surrounding chunks" : "",
highTier ? "If these chunks are not loaded, they will be ignored" : "",
@@ -87,9 +92,19 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi
"Can be configured with a soldering iron to change modes",
"Low Efficiency: Removes half pollution, Turbine takes 50% dmg",
"High Efficiency: Removes full pollution, Turbine takes 100% dmg",
- "Turbine Rotor will not break in LE mode",
-
+ "Turbine Rotor will not break in LE mode",
};
+ if (!mPollutionEnabled) {
+ String[] B = new String[] {
+ "===============================================",
+ "Pollution is disabled, scrubbers will now have a bonus use",
+ "They are now able to remove ALL lingering pollution as GT ignores it",
+ "and it will linger forever!",
+ "===============================================",
+ };
+ A = ArrayUtils.addAll(A, B);
+ }
+ return A;
}
@Override
@@ -187,7 +202,19 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi
if (aBaseMetaTileEntity.isActive()){
//Do nothing if there is no pollution.
- if(this.mHasPollution && mCurrentPollution > 0){
+ if(this.mHasPollution && mCurrentPollution > 0){
+
+ //Only check every 30s.
+ if (!isIdle && aTick % (20L * 30) == 0L){
+ mPollutionEnabled = PollutionUtils.mPollution();
+ //Clear out pollution if it's disabled, because I am a nice gal.
+ if (!mPollution()) {
+ PollutionUtils.nullifyPollution(this.getBaseMetaTileEntity());
+ }
+ }
+
+
+
//Use a Turbine
if(hasRotor(stackRotor) && hasAirFilter(stackFilter)){
@@ -683,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_IndustrialCuttingMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java
index 5e852b5f76..6a154051d5 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java
@@ -100,6 +100,7 @@ extends GregtechMeta_MultiBlockBase {
@Override
public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
final byte tSide = this.getBaseMetaTileEntity().getBackFacing();
+ int aCasingCount = 0;
if ((this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 1)) && (this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 2) && (this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 3)))) {
for (byte i = 2; i < 6; i = (byte) (i + 1)) {
IGregTechTileEntity tTileEntity;
@@ -141,7 +142,12 @@ extends GregtechMeta_MultiBlockBase {
if (!isValidBlockForStructure(aTile, getCasingTextureIndex(), true, aBlock, aMeta, getCasingBlock(), getCasingMeta())) {
log("Bad Casing on Cutting Machine.");
return false;
- }
+ }
+ else {
+ if (aTile == null) {
+ aCasingCount++;
+ }
+ }
}
}
}
@@ -159,7 +165,7 @@ extends GregtechMeta_MultiBlockBase {
return false;
}
log("True");
- return true;
+ return aCasingCount >= 26;
}
@Override
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java
index f4f8a5fe78..9885db20d6 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java
@@ -58,7 +58,7 @@ extends GregtechMeta_MultiBlockBase {
"1x Output Bus",
"1x Input Hatch",
"1x Energy Hatch",
- "Maintenance Hatch must be at the back, centered",
+ //"Maintenance Hatch must be at the back, centered",
};
}
@@ -142,6 +142,7 @@ extends GregtechMeta_MultiBlockBase {
@Override
public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
final byte tSide = this.getBaseMetaTileEntity().getBackFacing();
+ int aCasingCount = 0;
if ((this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 1)) && (this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 2) && (this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 3)))) {
for (byte i = 2; i < 6; i = (byte) (i + 1)) {
IGregTechTileEntity tTileEntity;
@@ -183,7 +184,11 @@ extends GregtechMeta_MultiBlockBase {
log("Bad Casing on Extruder.");
return false;
}
-
+ else {
+ if (aTile == null) {
+ aCasingCount++;
+ }
+ }
}
}
}
@@ -200,8 +205,11 @@ extends GregtechMeta_MultiBlockBase {
log("False 5");
return false;
}
+
+
+
log("True");
- return true;
+ return aCasingCount >= 28;
}
@Override
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java
index 3087bf4703..b92e370a0b 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java
@@ -47,7 +47,7 @@ extends GregtechMeta_MultiBlockBase {
return new String[]{
"Controller Block for the Industrial Maceration Stack",
"60% faster than using single block machines of the same voltage",
- "Increased output chances on % outputs",
+ //"Increased output chances on % outputs",
"Processes 8*tier materials at a time",
"ULV = Tier 0, LV = Tier 1, etc.",
"-------------------------------------------------------",
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/GregtechMetaTileEntity_IndustrialSifter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java
index 38306d914d..8c62937bae 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java
@@ -48,7 +48,7 @@ extends GregtechMeta_MultiBlockBase {
"400% faster than single-block machines of the same voltage",
"Only uses 75% of the eu/t normally required",
"Processes four items per voltage tier",
- "Increased output chances on % outputs",
+ //"Increased output chances on % outputs",
"Size[WxHxL]: 5x3x5",
"Controller (Center Bottom)",
"1x Input Bus (Any top or bottom edge casing)",
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java
index 064dc8372b..82de41f186 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java
@@ -184,6 +184,8 @@ public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends GregtechMeta
return false;
}
+ private volatile int mGraceTimer = 2;
+
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
/*if (this.getBaseMetaTileEntity().isActive()) {
@@ -192,5 +194,19 @@ public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends GregtechMeta
}
} */
super.onPostTick(aBaseMetaTileEntity, aTick);
+
+ if (this.mStartUpCheck < 0) {
+ if (this.mMaxProgresstime > 0 && this.mProgresstime != 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) {
+ if (aTick % 10 == 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) {
+ if (!this.depleteInput(FluidUtils.getFluidStack("cryotheum", 10))) {
+ if (mGraceTimer-- == 0) {
+ this.causeMaintenanceIssue();
+ this.stopMachine();
+ mGraceTimer = 2;
+ }
+ }
+ }
+ }
+ }
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java
index d798691d04..1b92d30705 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java
@@ -1,24 +1,19 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-
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.metatileentity.implementations.GT_MetaTileEntity_Hatch;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance;
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.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
public class GregtechMetaTileEntity_IndustrialWireMill
extends GregtechMeta_MultiBlockBase {
@@ -53,7 +48,7 @@ extends GregtechMeta_MultiBlockBase {
"1x Input Bus",
"1x Output Bus",
"1x Energy Hatch",
- "Maintenance Hatch must be at the back, centered",
+ //"Maintenance Hatch must be at the back, centered",
};
}
@@ -108,6 +103,7 @@ extends GregtechMeta_MultiBlockBase {
@Override
public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
final byte tSide = this.getBaseMetaTileEntity().getBackFacing();
+ int aCasingCount = 0;
if ((this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 1)) && (this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 2) && (this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 3)))) {
for (byte i = 2; i < 6; i = (byte) (i + 1)) {
IGregTechTileEntity tTileEntity;
@@ -147,6 +143,11 @@ extends GregtechMeta_MultiBlockBase {
log("Bad Casing on Wiremill.");
return false;
}
+ else {
+ if (aTile == null) {
+ aCasingCount++;
+ }
+ }
}
}
}
@@ -168,7 +169,7 @@ extends GregtechMeta_MultiBlockBase {
return false;
}
log("True");
- return true;
+ return aCasingCount >= 32;
}
@Override
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 dd00c9731d..ab7fb79c4b 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
@@ -20,11 +20,10 @@ import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.StaticFields59;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
@@ -44,34 +43,13 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase
private int controllerY;
private static boolean mUsingPollutionOutputs = false;
- private static AutoMap<FluidStack> mPollutionFluidStacks = new AutoMap<FluidStack>();
-
- private static boolean setPollutionFluids() {
- FluidStack CD, CM, SD;
- CD = FluidUtils.getFluidStack("carbondioxide", 1000);
- CM = FluidUtils.getFluidStack("carbonmonoxide", 1000);
- SD = FluidUtils.getFluidStack("sulfuredioxide", 1000);
- if (mPollutionFluidStacks.size() == 0) {
- if (CD != null)
- mPollutionFluidStacks.put(CD);
- if (CM != null)
- mPollutionFluidStacks.put(CM);
- if (SD != null)
- mPollutionFluidStacks.put(SD);
- }
- if (mPollutionFluidStacks.size() > 0) {
- return true;
- }
- return false;
- }
-
+
public GregtechMetaTileEntity_Adv_EBF(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 11);
mHotFuelName = FluidUtils.getFluidStack("pyrotheum", 1).getLocalizedName();
mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings3Misc, 11);
mHatchName = ItemUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 968);
- mUsingPollutionOutputs = setPollutionFluids();
}
public GregtechMetaTileEntity_Adv_EBF(String aName) {
@@ -80,7 +58,6 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase
mHotFuelName = FluidUtils.getFluidStack("pyrotheum", 1).getLocalizedName();
mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings3Misc, 11);
mHatchName = ItemUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 968);
- mUsingPollutionOutputs = setPollutionFluids();
}
@Override
@@ -211,6 +188,8 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase
}
}
}
+
+ // TODO - Fix Casing Count
return true;
}
@@ -237,8 +216,9 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase
int targetHeight;
FluidStack tLiquid = aLiquid.copy();
boolean isOutputPollution = false;
+ mUsingPollutionOutputs = PollutionUtils.setPollutionFluids();
if (mUsingPollutionOutputs) {
- for (FluidStack pollutionFluidStack : mPollutionFluidStacks) {
+ for (FluidStack pollutionFluidStack : PollutionUtils.mPollutionFluidStacks) {
if (tLiquid.isFluidEqual(pollutionFluidStack)) {
isOutputPollution = true;
break;
@@ -287,6 +267,7 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase
long tVoltage = getMaxInputVoltage();
byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ long tEnergy = getMaxInputEnergy();
Logger.WARNING("Running checkRecipeGeneric(0)");
GT_Recipe tRecipe = this.getRecipeMap().findRecipe(getBaseMetaTileEntity(), mLastRecipe, false,
@@ -309,12 +290,14 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase
// EU discount
float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
int tHeatCapacityDivTiers = (mHeatingCapacity - tRecipe.mSpecialValue) / 900;
+ if (tHeatCapacityDivTiers > 0)
+ tRecipeEUt = (int) (tRecipeEUt * (Math.pow(0.95, tHeatCapacityDivTiers)));
float tTotalEUt = 0.0f;
int parallelRecipes = 0;
// Count recipes to do in parallel, consuming input items and fluids and
// considering input voltage limits
- for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) {
+ for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
Logger.WARNING("Broke at " + parallelRecipes + ".");
break;
@@ -352,9 +335,6 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase
this.mMaxProgresstime /= (tHeatCapacityDivTiers >= rInt ? 4 : 2);
}
}
-
- if (tHeatCapacityDivTiers > 0)
- this.mEUt = (int) (this.mEUt * (Math.pow(0.95, tHeatCapacityDivTiers)));
if (this.mEUt > 0) {
this.mEUt = (-this.mEUt);
}
@@ -429,23 +409,26 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase
}
- private volatile int mGraceTimer = 100;
+ private volatile int mGraceTimer = 2;
- @SuppressWarnings("unused")
@Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (this.mMaxProgresstime > 0 && this.mProgresstime != 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) {
- if (aTick % 10 == 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) {
- if (!this.depleteInput(FluidUtils.getFluidStack("pyrotheum", 5))) {
- this.causeMaintenanceIssue();
- this.stopMachine();
- }
- if (false) { // To be replaced with a config option or something
- this.explodeMultiblock();
- }
- }
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ //Try dry Pyrotheum after all other logic
+ if (this.mStartUpCheck < 0) {
+ if (this.mMaxProgresstime > 0 && this.mProgresstime != 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) {
+ if (aTick % 10 == 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) {
+ if (!this.depleteInput(FluidUtils.getFluidStack("pyrotheum", 5))) {
+ if (mGraceTimer-- == 0) {
+ this.causeMaintenanceIssue();
+ this.stopMachine();
+ mGraceTimer = 2;
+ }
+ }
+ }
+ }
}
- super.onPostTick(aBaseMetaTileEntity, aTick);
+
}
@Override
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_Cyclotron.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java
index de5d731dd5..ed6c913e6b 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java
@@ -6,7 +6,6 @@ import gregtech.GT_Mod;
import gregtech.api.enums.Dyes;
import gregtech.api.enums.TAE;
import gregtech.api.enums.Textures;
-import gregtech.api.gui.GT_Container_MultiMachine;
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -22,13 +21,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.common.gui.GT_GUIContainer_FusionReactor;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.item.chemistry.IonParticles;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
-import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_Cyclotron;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import net.minecraft.block.Block;
@@ -71,18 +68,19 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas
@Override
public String getCustomGUIResourceName() {
- return "FusionComputer";
+ return null;
}
@Override
public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new CONTAINER_Cyclotron(aPlayerInventory, aBaseMetaTileEntity);
+ return super.getServerGUI(aID, aPlayerInventory, aBaseMetaTileEntity);
+ //return new CONTAINER_Cyclotron(aPlayerInventory, aBaseMetaTileEntity);
}
@Override
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_FusionReactor(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "FusionComputer.png", Recipe_GT.Gregtech_Recipe_Map.sCyclotronRecipes.mNEIName);
- //return null;
+ return super.getClientGUI(aID, aPlayerInventory, aBaseMetaTileEntity);
+ //return new GUI_Cyclotron(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), Recipe_GT.Gregtech_Recipe_Map.sCyclotronRecipes.mNEIName);
}
@Override
@@ -171,12 +169,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas
return false;
}
}
- mWrench = true;
- mScrewdriver = true;
- mSoftHammer = true;
- mHardHammer = true;
- mSolderingTool = true;
- mCrowbar = true;
+ this.fixAllMaintenanceIssue();
log("Built Cyclotron.");
turnCasingActive(true);
return true;
@@ -318,7 +311,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas
/*if (CORE.DEVENV) {
return this.checkRecipeGeneric();
}*/
-
+ this.fixAllMaintenanceIssue();
//log("Recipe Check.");
ArrayList<ItemStack> tItemList = getStoredInputs();
@@ -409,6 +402,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas
//Time Counter
this.mTotalRunTime++;
+ this.fixAllMaintenanceIssue();
onRunningTick(null);
@@ -432,6 +426,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas
mChargeHatches.clear();
mDischargeHatches.clear();
mControlCoreBus.clear();
+ mAirIntakes.clear();
mMultiDynamoHatches.clear();
mMachine = aFormCheck;
}
@@ -499,7 +494,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas
stopMachine();
}
}
- doRandomMaintenanceDamage();
+ //doRandomMaintenanceDamage();
aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mWrench ? 0 : 1) | (mScrewdriver ? 0 : 2) | (mSoftHammer ? 0 : 4) | (mHardHammer ? 0 : 8)
| (mSolderingTool ? 0 : 16) | (mCrowbar ? 0 : 32) | (mMachine ? 0 : 64));
aBaseMetaTileEntity.setActive(mMaxProgresstime > 0);
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java
new file mode 100644
index 0000000000..bc36cb32a1
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java
@@ -0,0 +1,502 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.TAE;
+import gregtech.api.enums.Textures;
+import gregtech.api.gui.GT_GUIContainer_MultiMachine;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler;
+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 gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.block.ModBlocks;
+import gtPlusPlus.core.item.chemistry.RocketFuels;
+import gtPlusPlus.core.material.MISC_MATERIALS;
+import gtPlusPlus.core.util.minecraft.FluidUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_AirIntake;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
+import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.fluids.FluidStack;
+
+public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_MultiBlockBase
+{
+ protected int fuelConsumption;
+ protected int fuelValue;
+ protected int fuelRemaining;
+ protected int freeFuelTicks = 0;
+ protected boolean boostEu;
+
+ public static String mLubricantName = "Carbon Dioxide";
+ public static String mCoolantName = "Liquid Hydrogen";
+
+ public static String mCasingName = "Turbodyne Casing";
+ public static String mIntakeHatchName = "Tungstensteel Turbine Casing";
+ public static String mGearboxName = "Inconel Reinforced Casing";
+
+
+ private final static int CASING_ID = TAE.getIndexFromPage(3, 11);
+
+ public GregtechMetaTileEntity_LargeRocketEngine(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ this.fuelConsumption = 0;
+ this.fuelValue = 0;
+ this.fuelRemaining = 0;
+ this.boostEu = false;
+ }
+
+ public GregtechMetaTileEntity_LargeRocketEngine(final String aName) {
+ super(aName);
+ this.fuelConsumption = 0;
+ this.fuelValue = 0;
+ this.fuelRemaining = 0;
+ this.boostEu = false;
+ }
+
+ @Override
+ public String[] getTooltip() {
+ if (mCasingName.toLowerCase().contains(".name")) {
+ mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 11);
+ }
+ if (mIntakeHatchName.toLowerCase().contains(".name")) {
+ mIntakeHatchName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 11);
+ }
+ if (mGearboxName.toLowerCase().contains(".name")) {
+ mGearboxName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings3Misc, 1);
+ }
+ if (mLubricantName.toLowerCase().contains(".")) {
+ mLubricantName = FluidUtils.getFluidStack("carbondioxide", 1).getLocalizedName();
+ }
+ if (mCoolantName.toLowerCase().contains(".")) {
+ mCoolantName = FluidUtils.getFluidStack("liquidhydrogen", 1).getLocalizedName();
+ }
+ return new String[] {
+ "Controller Block for the Large Combustion Engine",
+ "Supply Rocket Fuels and 1000L of "+mLubricantName+" per hour to run",
+ "Supply 40L of "+mCoolantName+" per second to boost output (optional)",
+ "Consumes upto 5000L of Air per second",
+ "Default: Produces "+GT_Values.V[5]+"EU/t at 100% efficiency",
+ "Boosted: Produces "+(GT_Values.V[5]*3)+"EU/t at 150% efficiency",
+ "Size(WxHxD): 3x3x10, Controller (front centered)",
+ "3x3x10 of Stable "+mCasingName+" (hollow, Min 64!)",
+ "8x "+mGearboxName+" inside the Hollow Casing",
+ "1x Dynamo Hatch (Top Middle, Max 8)",
+ "8x Air Intake Hatch (one of the Casings next to a Gear Box, top row allowed)",
+ "2x Input Hatch (Rocket Fuel/Booster) (one of the Casings next to a Gear Box, top row not allowed)",
+ "1x Maintenance Hatch (one of the Casings next to a Gear Box)",
+ "1x Muffler Hatch (Back Centre)",
+ };
+ }
+
+ @Override
+ public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[CASING_ID], new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active : TexturesGtBlock.Overlay_Machine_Controller_Advanced) };
+ }
+ return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[CASING_ID] };
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(final ItemStack aStack) {
+ return this.getMaxEfficiency(aStack) > 0;
+ }
+
+ @Override
+ public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
+ return super.getClientGUI(aID, aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ public int getAir() {
+ if (this.mAirIntakes.isEmpty() || this.mAirIntakes.size() <= 0) {
+ return 0;
+ }
+ else {
+ int totalAir = 0;
+ FluidStack airstack = FluidUtils.getFluidStack("air", 1);
+ for (GT_MetaTileEntity_Hatch_AirIntake u : this.mAirIntakes) {
+ if (u != null) {
+ FluidStack f = u.mFluid;
+ if (f.isFluidEqual(airstack)) {
+ totalAir += f.amount;
+ }
+ }
+ }
+ return totalAir;
+ }
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ final ArrayList<FluidStack> tFluids = this.getStoredFluids();
+ FluidStack air = FluidUtils.getFluidStack("air", 1);
+
+ int aircount = getAir() ;
+ if (aircount < (boostEu ? 500 : 200)) {
+ //Logger.INFO("Not Enough Air to Run "+aircount);
+ return false;
+ }
+ else {
+ boolean hasIntakeAir = this.depleteInput(FluidUtils.getFluidStack(air, boostEu ? 500 : 200));
+ if (!hasIntakeAir) {
+ //Logger.INFO("Could not consume Air to run "+aircount);
+ return false;
+ }
+ }
+ //Logger.INFO("Running "+aircount);
+
+ final Collection<GT_Recipe> tRecipeList = Recipe_GT.Gregtech_Recipe_Map.sRocketFuels.mRecipeList;
+ if (tFluids.size() > 0 && tRecipeList != null) {
+ for (final FluidStack hatchFluid1 : tFluids) {
+ if (hatchFluid1.isFluidEqual(air)) {
+ continue;
+ }
+ for (final GT_Recipe aFuel : tRecipeList) {
+ final FluidStack tLiquid;
+ tLiquid = aFuel.mFluidInputs[0];
+ if (hatchFluid1.isFluidEqual(tLiquid)) {
+
+ final int n = (int) (this.boostEu ? ((GT_Values.V[5]*2) / aFuel.mSpecialValue) : (GT_Values.V[5] / aFuel.mSpecialValue));
+
+ if (!consumeFuel(aFuel)) {
+ continue;
+ }
+
+ //Logger.INFO("Consumed some input fuel");
+ this.boostEu = consumeLOH();
+ //Logger.INFO("Did we consume LOH? "+boostEu);
+
+ if (tFluids.contains(MISC_MATERIALS.CARBON_DIOXIDE.getFluid(this.boostEu ? 2 : 1)) || tFluids.contains(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 2 : 1)))) {
+ //Logger.INFO("Found CO2");
+ if (this.mRuntime % 72 == 0 || this.mRuntime == 0) {
+ if (!consumeCO2()) {
+ return false;
+ }
+ }
+ this.fuelValue = aFuel.mSpecialValue;
+ this.fuelRemaining = hatchFluid1.amount;
+ this.mEUt = (int) ((this.mEfficiency < 2000) ? 0 : GT_Values.V[5]);
+ this.mProgresstime = 1;
+ this.mMaxProgresstime = 1;
+ this.mEfficiencyIncrease = 5;
+ return true;
+ }
+ return false;
+ }
+ }
+ }
+ }
+ this.mEUt = 0;
+ this.mEfficiency = 0;
+ return false;
+ }
+
+ /**
+ * Consumes Fuel if required. Free Fuel Ticks are handled here.
+ * @param aFuel
+ * @return
+ */
+ public boolean consumeFuel(GT_Recipe aFuel) {
+ if (freeFuelTicks > 0) {
+ freeFuelTicks--;
+ return true;
+ }
+ else {
+ Logger.INFO("Consuming fuel.");
+ freeFuelTicks = 0;
+ int value = aFuel.mSpecialValue * 3000;
+ Logger.INFO("Value: "+value);
+ value /= GT_Values.V[4];
+ value /= 10;
+ Logger.INFO("Value: "+value);
+ FluidStack tLiquid = FluidUtils.getFluidStack(aFuel.mFluidInputs[0], value);
+ if (!this.depleteInput(tLiquid)) {
+ return false;
+ }
+ else {
+ this.fuelConsumption = value;
+ this.freeFuelTicks = value*2;
+ Logger.INFO("Consumed "+value+"L. Waiting "+freeFuelTicks+" ticks to consume more.");
+ return true;
+ }
+ }
+ }
+
+ public boolean consumeCO2() {
+ if (this.depleteInput(MISC_MATERIALS.CARBON_DIOXIDE.getFluid(this.boostEu ? 2 : 1)) || this.depleteInput(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 2 : 1)))) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ public boolean consumeLOH() {
+ return this.depleteInput(FluidUtils.getFluidStack(RocketFuels.Liquid_Hydrogen, 2));
+ }
+
+ @Override
+ public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
+ byte tSide = getBaseMetaTileEntity().getBackFacing();
+ int tX = getBaseMetaTileEntity().getXCoord();
+ int tY = getBaseMetaTileEntity().getYCoord();
+ int tZ = getBaseMetaTileEntity().getZCoord();
+ final int MAX_LENGTH = 8;
+ for (int length=0;length<MAX_LENGTH;length++) {
+ if(getBaseMetaTileEntity().getBlockAtSideAndDistance(tSide, length+1) != getGearboxBlock()) {
+ Logger.INFO("Bad Gearbox Block");
+ return false;
+ }
+ if(getBaseMetaTileEntity().getMetaIDAtSideAndDistance(tSide, length+1) != getGearboxMeta()) {
+ Logger.INFO("Bad Gearbox Meta");
+ return false;
+ }
+ }
+ Logger.INFO("Found "+MAX_LENGTH+" "+mGearboxName+"s.");
+ for (byte i = -1; i < 2; i = (byte) (i + 1)) {
+ for (byte j = -1; j < 2; j = (byte) (j + 1)) {
+ if ((i != 0) || (j != 0)) {
+ for (byte aLength = 0; aLength < (MAX_LENGTH+2); aLength = (byte) (aLength + 1)) { // Length
+
+
+ final int fX = tX - (tSide == 5 ? 1 : tSide == 4 ? -1 : i),
+ fZ = tZ - (tSide == 2 ? -1 : tSide == 3 ? 1 : i),
+ aY = tY + j,
+ aX = tX + (tSide == 5 ? aLength : tSide == 4 ? -aLength : i),
+ aZ = tZ + (tSide == 2 ? -aLength : tSide == 3 ? aLength : i);
+
+
+ //Why check for air in world when each intake requires 1 air block?
+ //final Block frontAir = getBaseMetaTileEntity().getBlock(fX, aY, fZ);
+ //final String frontAirName = frontAir.getUnlocalizedName();
+ //if(!(getBaseMetaTileEntity().getAir(fX, aY, fZ) || frontAirName.equalsIgnoreCase("tile.air") || frontAirName.equalsIgnoreCase("tile.railcraft.residual.heat"))) {
+ //Logger.INFO("Bad Air Check");
+ //return false; //Fail if vent blocks are obstructed
+ //}
+
+ if (((i == 0) || (j == 0)) && ((aLength > 0) && (aLength <= MAX_LENGTH))) {
+ Logger.INFO("Checking for Hatches. "+aLength);
+ //Top Row
+ if (j == 1) {
+ if (addDynamoToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ), getCasingTextureIndex())) {
+ // Do Nothing
+ }
+ else if (addAirIntakeToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ), getCasingTextureIndex())) {
+ // Do Nothing
+ }
+ else if (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta()) {
+ // Do nothing
+ }
+ else {
+ Logger.INFO("Top Row - "+aLength+" | Did not find casing or Dynamo");
+ return false;
+ }
+ }
+ else {
+ IGregTechTileEntity aCheck = getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ);
+ if (aCheck != null) {
+ final IMetaTileEntity bCheck = aCheck.getMetaTileEntity();
+ // Only allow Dynamos on Top
+ if (bCheck instanceof GT_MetaTileEntity_Hatch_Dynamo) {
+ Logger.INFO("Found dynamo in disallowed location | "+aX+", "+aY+", "+aZ+" | "+i+", "+j+", "+aLength);
+ return false;
+ }
+ }
+ if (addAirIntakeToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ), getCasingTextureIndex())) {
+ // Do Nothing
+ }
+ else if (addInputToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ), getCasingTextureIndex())) {
+ // Do Nothing
+ }
+ else if (addOutputToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ), getCasingTextureIndex())) {
+ // Do Nothing
+ }
+ else if (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta()) {
+ // Do nothing
+ }
+ else {Logger.INFO("Bad block.");
+ return false;
+ }
+
+ }
+ Logger.INFO("Passed check. "+aLength);
+
+ } else if (aLength == 0) {
+ Logger.INFO("Searching for Gearbox");
+ if (addMaintenanceToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ), getCasingTextureIndex())) {
+ // Do Nothing
+ }
+ else if(!(getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta())) {
+ Logger.INFO("Bad Missing Casing || Bad Meta");
+ return false;
+ }
+ else {
+ Logger.INFO("Found "+mCasingName+".");
+ }
+ } else if (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta()) {
+ Logger.INFO("Found Casing.");
+ // Do nothing
+ } else {
+ Logger.INFO("Bad XXX");
+ return false;
+ }
+ }
+ }
+ }
+ }
+
+ this.mMufflerHatches.clear();
+ IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), MAX_LENGTH+1);
+ if ((tTileEntity != null) && (tTileEntity.getMetaTileEntity() != null)) {
+ if ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Muffler)) {
+ this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) tTileEntity.getMetaTileEntity());
+ this.updateTexture(tTileEntity, getCasingTextureIndex());
+ }
+ }
+
+ if (this.mDynamoHatches.size() <= 0 || this.mDynamoHatches.isEmpty()) {
+ Logger.INFO("Wrong count for Dynamos");
+ return false;
+ }
+ if (this.mMufflerHatches.size() != 1 || this.mMufflerHatches.isEmpty()) {
+ Logger.INFO("Wrong count for Mufflers");
+ return false;
+ }
+ if (this.mAirIntakes.size() < 8 || this.mAirIntakes.isEmpty()) {
+ Logger.INFO("Wrong count for Air Intakes | "+this.mAirIntakes.size());
+ return false;
+ }
+ if (this.mMaintenanceHatches.size() < 1 || this.mMaintenanceHatches.isEmpty()) {
+ Logger.INFO("Wrong count for Maint. Hatches");
+ return false;
+ }
+
+
+ Logger.INFO("Formed Rocket Engine.");
+ return true;
+ }
+
+ public Block getCasingBlock() {
+ return ModBlocks.blockCasings4Misc;
+ }
+
+ public byte getCasingMeta() {
+ return 11;
+ }
+
+ public Block getIntakeBlock() {
+ return GregTech_API.sBlockCasings4;
+ }
+
+ public byte getIntakeMeta() {
+ return 12;
+ }
+
+ public Block getGearboxBlock() {
+ return ModBlocks.blockCasings3Misc;
+ }
+
+ public byte getGearboxMeta() {
+ return 1;
+ }
+
+ public byte getCasingTextureIndex() {
+ return (byte) CASING_ID;
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_LargeRocketEngine(this.mName);
+ }
+
+ @Override
+ public void saveNBTData(final NBTTagCompound aNBT) {
+ aNBT.setInteger("freeFuelTicks", freeFuelTicks);
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(final NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ freeFuelTicks = aNBT.getInteger("freeFuelTicks");
+ }
+
+ @Override
+ public int getDamageToComponent(final ItemStack aStack) {
+ return 1;
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return this.boostEu ? 30000 : 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(final ItemStack aStack) {
+ return this.boostEu ? 150 : 75;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public String[] getExtraInfoData() {
+ return new String[] {
+ "Rocket Engine",
+ "Current Air: "+getAir(),
+ "Current Pollution: " + getPollutionPerTick(null),
+ "Time until next fuel consumption: "+freeFuelTicks,
+ "Current Output: " + this.mEUt * this.mEfficiency / 10000 + " EU/t",
+ "Fuel Consumption: " + this.fuelConsumption + "L/t",
+ "Fuel Value: " + this.fuelValue + " EU/L",
+ "Fuel Remaining: " + this.fuelRemaining + " Litres",
+ "Current Efficiency: " + this.mEfficiency / 100 + "%",
+ (this.getIdealStatus() == this.getRepairStatus()) ? "No Maintainance issues" : "Needs Maintainance" };
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Rocket Engine";
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 1;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+}
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 b23d34019e..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
@@ -2,6 +2,7 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage;
import java.util.ArrayList;
+import gregtech.api.enums.GT_Values;
import gregtech.api.enums.TAE;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
@@ -15,10 +16,12 @@ import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.handler.BookHandler;
+import gtPlusPlus.core.lib.CORE;
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;
@@ -64,14 +67,16 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe
return new String[]{
"[BUG] GUI does not work until structure is assembled correctly. (Do Not Report issue)",
"Consumes " + this.ENERGY_TAX + "% of the average voltage of all energy type hatches",
+ "Does not require maintenance",
"Can be built with variable height between " + (CELL_HEIGHT_MIN + 2) + "-" + (CELL_HEIGHT_MAX + 2) + "",
"Hatches can be placed nearly anywhere",
"HV Energy/Dynamo Hatches are the lowest tier you can use",
- "Controller (Bottom, Centre)",
- "Size(WxHxD): External 5xHx5, Sub-Station External Casings",
- "Size(WxHxD): Internal 3x(H-2)x3, Vanadium Redox Power Cells",
- "Read '"+BookHandler.ItemBookWritten_MultiPowerStorage.getDisplayName()+"' for more info.",
- };
+ CORE.GTNH ? "Supports voltages >= UHV using MAX tier components." : "Supports upto "+GT_Values.VOLTAGE_NAMES[GT_Values.VOLTAGE_NAMES.length-1],
+ "Controller (Bottom, Centre)",
+ "Size(WxHxD): External 5xHx5, Sub-Station External Casings",
+ "Size(WxHxD): Internal 3x(H-2)x3, Vanadium Redox Power Cells",
+ "Read '"+BookHandler.ItemBookWritten_MultiPowerStorage.getDisplayName()+"' for more info.",
+ };
}
@Override
@@ -116,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) {
@@ -124,14 +131,14 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe
return 4;
} else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 4) {
return 5;
- } else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 5) {
+ } else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 5) {
return 6;
} else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 6) {
return 7;
} else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 7) {
return 8;
} else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 8) {
- return 9;
+ return CORE.GTNH ? GT_Values.V.length : 9;
} else {
return -1;
}
@@ -299,7 +306,7 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe
}
// Only set this here, after the machine check is 100% passed.
-
+ this.fixAllMaintenanceIssue();
this.mBatteryCapacity = getCapacityFromCellTier(tOverallCellTier) * tCellCount;
return true;
}
@@ -373,9 +380,10 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe
this.mMaxProgresstime = 1;
this.mEUt = 0;
this.mEfficiencyIncrease = 10000;
+ this.fixAllMaintenanceIssue();
return true;
}
-
+
@Override
public int getMaxParallelRecipes() {
return 1;
@@ -493,7 +501,7 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe
} else {
storedEnergyText = EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.getEUVar()) + EnumChatFormatting.RESET;
}
-
+
int errorCode = this.getBaseMetaTileEntity().getErrorDisplayID();
boolean mMaint = (errorCode != 0);
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricSnips.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricSnips.java
index bc0c821478..3da1763634 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricSnips.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricSnips.java
@@ -1,41 +1,22 @@
package gtPlusPlus.xmod.gregtech.common.tools;
-import java.util.Arrays;
-import java.util.List;
-
import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Materials;
import gregtech.api.enums.Textures.ItemIcons;
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.items.GT_MetaGenerated_Tool;
-import gregtech.common.items.behaviors.Behaviour_None;
-import gregtech.common.tools.GT_Tool;
+import gregtech.common.tools.GT_Tool_WireCutter;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools;
-import net.minecraft.block.Block;
-import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.monster.EntityIronGolem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.AchievementList;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IChatComponent;
-import net.minecraftforge.event.world.BlockEvent;
public class TOOL_Gregtech_ElectricSnips
-extends GT_Tool {
-
- public static final List<String> mEffectiveList = Arrays.asList(new String[]{EntityIronGolem.class.getName(), "EntityTowerGuardian"});
-
+extends GT_Tool_WireCutter {
- @Override
- public float getNormalDamageAgainstEntity(final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, final EntityPlayer aPlayer) {
- String tName = aEntity.getClass().getName();
- tName = tName.substring(tName.lastIndexOf(".") + 1);
- return (mEffectiveList.contains(tName)) || (tName.contains("Golem")) ? aOriginalDamage * 2.0F : aOriginalDamage;
- }
@Override
public int getToolDamagePerBlockBreak() {
@@ -78,77 +59,6 @@ extends GT_Tool {
}
@Override
- public String getCraftingSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(1));
- }
-
- @Override
- public String getEntityHitSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(2));
- }
-
- @Override
- public String getBreakingSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(0));
- }
-
- @Override
- public String getMiningSound() {
- return null;
- }
-
- @Override
- public boolean canBlock() {
- return false;
- }
-
- public boolean isWrench(){
- return false;
- }
-
- @Override
- public boolean isCrowbar() {
- return false;
- }
-
- @Override
- public boolean isWeapon() {
- return true;
- }
-
- @Override
- public boolean isMinableBlock(final Block aBlock, final byte aMetaData) {
- final String tTool = aBlock.getHarvestTool(aMetaData);
- return (tTool != null) && (tTool.equals("sword") || tTool.equals("cutter"));
- }
-
-
- @Override
- public int convertBlockDrops(final List<ItemStack> aDrops, final ItemStack aStack, final EntityPlayer aPlayer, final Block aBlock, final int aX, final int aY, final int aZ, final byte aMetaData, final int aFortune, final boolean aSilkTouch, final BlockEvent.HarvestDropsEvent aEvent) {
- int rConversions = 0;
- /*GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, new ItemStack[]{new ItemStack(aBlock, 1, aMetaData)});
- if ((tRecipe == null) || (aBlock.hasTileEntity(aMetaData))) {
- for (final ItemStack tDrop : aDrops) {
- tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, new ItemStack[]{GT_Utility.copyAmount(1L, new Object[]{tDrop})});
- if (tRecipe != null) {
- final ItemStack tHammeringOutput = tRecipe.getOutput(0);
- if (tHammeringOutput != null) {
- rConversions += tDrop.stackSize;
- tDrop.stackSize *= tHammeringOutput.stackSize;
- tHammeringOutput.stackSize = tDrop.stackSize;
- GT_Utility.setStack(tDrop, tHammeringOutput);
- }
- }
- }
- } else {
- aDrops.clear();
- aDrops.add(tRecipe.getOutput(0));
- rConversions++;
- }*/
- return rConversions;
- }
-
- @Override
public ItemStack getBrokenItem(final ItemStack aStack) {
return null;
}
@@ -163,8 +73,7 @@ extends GT_Tool {
return !aIsToolHead
? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa
: GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa;
- }
-
+ }
@@ -183,15 +92,5 @@ extends GT_Tool {
public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) {
return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " has been Snipped out of existence by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE);
}
-
- @Override
- public void onStatsAddedToTool(final GT_MetaGenerated_Tool aItem, final int aID) {
- aItem.addItemBehavior(aID, new Behaviour_None());
- }
-
- @Override
- public boolean isGrafter() {
- return false;
- }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingAngelGrinder.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingAngleGrinder.java
index 1d20b56551..bf4e9b1390 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingAngelGrinder.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingAngleGrinder.java
@@ -19,8 +19,8 @@ import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegis
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
import net.minecraft.item.ItemStack;
-public class ProcessingAngelGrinder implements Interface_OreRecipeRegistrator, Runnable {
- public ProcessingAngelGrinder() {
+public class ProcessingAngleGrinder implements Interface_OreRecipeRegistrator, Runnable {
+ public ProcessingAngleGrinder() {
GregtechOrePrefixes.toolAngleGrinder.add(this);
}
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 7bc0eacd4f..40994040bd 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java
@@ -1,61 +1,230 @@
package gtPlusPlus.xmod.gregtech.loaders;
import java.util.HashSet;
-import java.util.Set;
import gregtech.api.enums.GT_Values;
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.core.material.Material;
-import gtPlusPlus.core.material.MaterialGenerator;
-
-public class RecipeGen_FluidCanning extends RecipeGen_Base {
+import gtPlusPlus.api.objects.Logger;
+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 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;
- public RecipeGen_FluidCanning(GT_Recipe g) {
- this(g, true);
+ private final boolean isValid;
+
+ 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(GT_Recipe g, boolean extracting) {
- recipe = g;
- mRecipeGenMap.add(this);
- disableOptional = extracting;
+
+ 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;
+ FluidStack aFluidOutput;
+
+ // Safety check on the duration
+ if (aDuration == null || aDuration <= 0) {
+ aDuration = (aFluidIn != null) ? (aFluidIn.amount / 62) : ((aFluidOut != null) ? (aFluidOut.amount / 62) : 10);
+ }
+
+ // Safety check on the EU
+ if (aEUt == null || aEUt <= 0) {
+ if (aExtracting) {
+ aEUt = 2;
+ }
+ else {
+ aEUt = 1;
+ }
+ }
+
+ // Set Item stacks correctly, invert if extraction recipe.
+ if (aExtracting) {
+ aInput = aFull;
+ aOutput = aEmpty;
+ aFluidInput = GT_Values.NF;
+ aFluidOutput = aFluidIn;
+ }
+ else {
+ aInput = aEmpty;
+ aOutput = aFull;
+ aFluidInput = aFluidIn;
+ aFluidOutput = aFluidOut != null ? aFluidOut : GT_Values.NF;
+ }
+
+ //Check validity
+
+ Recipe_GT aRecipe = new Recipe_GT(
+ true,
+ new ItemStack[] { aInput },
+ new ItemStack[] { aOutput },
+ null,
+ new int[] {10000},
+ new FluidStack[] { aFluidInput },
+ new FluidStack[] { aFluidOutput },
+ aDuration,
+ aEUt,
+ 0);
+
+
+ // 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;
+ disableOptional = aExtracting;
+ 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 (recipe != null) {
- //Used to store Fluid extraction state
+ if (isValid && recipe != null) {
+ //Logger.INFO("Processing "+(disableOptional ? "Extracting" : "Canning")+" Recipe.");
if (this.disableOptional) {
- GT_Values.RA.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.mSpecialValue, //Chance
- recipe.mDuration, //Duration
- recipe.mEUt //Eu Tick
- );
+ addFluidExtractionRecipe(recipe);
}
else {
- GT_Values.RA.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
- recipe.mFluidOutputs.length == 1 ? recipe.mFluidOutputs[0] : null //Fluid Output
- );
-
+ addFluidCannerRecipe(recipe);
}
+ }
+ }
- }
+ 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));
+ }
+ 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();
+ }
+ return result;
+ }
+
+ 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));
+ }
+ 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();
+ }
+ 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 b2236fdd6c..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 (GT_Values.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 (GT_Values.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 (GT_Values.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 (GT_Values.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 (GT_Values.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 1cb999241a..9b7e1d708d 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java
@@ -55,9 +55,6 @@ public class RecipeGen_Ore extends RecipeGen_Base {
//if (material.getMaterialComposites().length > 1){
Logger.MATERIALS("[Recipe Generator Debug] ["+material.getLocalizedName()+"]");
int tVoltageMultiplier = MaterialUtils.getVoltageForTier(material.vTier);
- if (tVoltageMultiplier < 120) {
- tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 480 : 120;
- }
final ItemStack dustStone = ItemUtils.getItemStackOfAmountFromOreDict("dustStone", 1);
Material bonusA = null; //Ni
@@ -222,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)){
@@ -362,7 +360,7 @@ public class RecipeGen_Ore extends RecipeGen_Base {
mInternalOutputs[4],
mInternalOutputs[5],
mChances,
- 20*1*(tVoltageMultiplier/10),
+ (int) Math.max(material.getMass() * 3L * 1, 1),
tVoltageMultiplier)){
Logger.MATERIALS("[Electrolyzer] Generated Electrolyzer recipe for "+matDust.getDisplayName());
}
@@ -445,7 +443,7 @@ public class RecipeGen_Ore extends RecipeGen_Base {
null,
mInternalOutputs,
mChances,
- 20*1*(tVoltageMultiplier/10),
+ (int) Math.max(material.getMass() * 4L * 1, 1),
tVoltageMultiplier)){
Logger.MATERIALS("[Dehydrator] Generated Dehydrator recipe for "+matDust.getDisplayName());
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java
index f0c2785e1b..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) && GT_Values.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 7ef3b0b6dd..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;
@@ -24,6 +28,7 @@ import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.data.ArrayUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.api.interfaces.internal.IGregtech_RecipeAdder;
import gtPlusPlus.xmod.gregtech.common.StaticFields59;
import gtPlusPlus.xmod.gregtech.recipes.machines.RECIPEHANDLER_MatterFabricator;
@@ -679,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 {
@@ -705,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 {
@@ -717,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);
+
}
@@ -725,6 +744,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
mAssemblyLine = null;
mLargeChemReactor = null;
mScannerTT = null;
+ mPyroOven = null;
}
@@ -786,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,
@@ -874,6 +894,25 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
}
@Override
+ public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, int aCircuit, FluidStack inputFluid, FluidStack outputFluid, ItemStack output, ItemStack output2, int time, int eu) {
+ if (aCircuit < 0 || aCircuit > 24) {
+ aCircuit = 22;
+ }
+ GT_Recipe aSpecialRecipe = new Recipe_GT(
+ false,
+ new ItemStack[] {input1, input2},
+ new ItemStack[] {output, output2},
+ CI.getNumberedCircuit(aCircuit),
+ new int[] {},
+ new FluidStack[] {inputFluid},
+ new FluidStack[] {outputFluid},
+ time,
+ eu,
+ 0);
+ return GT_Recipe.GT_Recipe_Map.sChemicalRecipes.mRecipeList.add(aSpecialRecipe);
+ }
+
+ @Override
public boolean addMultiblockChemicalRecipe(ItemStack[] itemStacks, FluidStack[] fluidStacks, FluidStack[] fluidStacks2, ItemStack[] outputs, int time, int eu) {
if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || mLargeChemReactor == null) {
return false;
@@ -970,14 +1009,30 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
}
@Override
- public void addFluidExtractionRecipe(ItemStack input, Object input2, FluidStack output, int aTime, int aEu, int aSpecial) {
- MaterialGenerator.addFluidExtractionRecipe(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 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);
+ }
/**
* Adds a Fusion reactor Recipe
@@ -1096,7 +1151,158 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
}
}
-
+ @Override
+ public boolean addUvLaserRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int time, long eu) {
+ // Generate Special Laser Recipe
+ GT_Recipe u = new Recipe_GT(
+ false,
+ new ItemStack[] {
+ aInput1,
+ aInput2,
+ },
+ new ItemStack[] {
+ aOutput
+ },
+ GregtechItemList.Laser_Lens_WoodsGlass.get(1),
+ new int[] {
+ 10000
+ },
+ new FluidStack[] {},
+ new FluidStack[] {},
+ time,
+ (int) eu,
+ 0);
+ return GT_Recipe.GT_Recipe_Map.sLaserEngraverRecipes.mRecipeList.add(u);
+ }
+
+ @Override
+ public boolean addIrLaserRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int time, long eu) {
+ return addUvLaserRecipe(aInput1, aInput2, aOutput, time, eu);
+ }
+
+
+ @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/recipes/RecipesToRemove.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/RecipesToRemove.java
index 06373c9e1d..35714aee26 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/RecipesToRemove.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/RecipesToRemove.java
@@ -1,10 +1,10 @@
package gtPlusPlus.xmod.gregtech.recipes;
-import gregtech.api.enums.Materials;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.Recipe_GT;
import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.material.ELEMENT;
+import gtPlusPlus.core.material.Material;
+import gtPlusPlus.core.material.ORES;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
@@ -28,7 +28,7 @@ public class RecipesToRemove {
Logger.INFO("Removed vanilla GT Rare Earth processing.");
//Set the Chemical Symbol for Rare Earth now that we are giving it custom outputs
//Best not to set this unless the original recipe is removed.
- Materials.RareEarth.mChemicalFormula = "("
+ /*Materials.RareEarth.mChemicalFormula = "("
+ELEMENT.getInstance().YTTRIUM.vChemicalSymbol
+ELEMENT.getInstance().NEODYMIUM.vChemicalSymbol
+ELEMENT.getInstance().LANTHANUM.vChemicalSymbol
@@ -38,7 +38,18 @@ public class RecipesToRemove {
+ELEMENT.getInstance().YTTERBIUM.vChemicalSymbol
+ELEMENT.getInstance().SAMARIUM.vChemicalSymbol
+ELEMENT.getInstance().GADOLINIUM.vChemicalSymbol+
- ")";
+ ")";*/
+
+ Material[] aLowTierOutputMaterials = new Material[] {
+ ORES.GREENOCKITE
+ };
+
+
+
+
+
+
+
}
}
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/GregtechConduits.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java
index 38589eaac1..abc5558444 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java
@@ -7,23 +7,28 @@ import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
-import gregtech.api.enums.*;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
-import gtPlusPlus.core.material.*;
+import gtPlusPlus.core.material.ALLOY;
+import gtPlusPlus.core.material.ELEMENT;
+import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.minecraft.*;
-import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.core.util.minecraft.FluidUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.minecraft.MaterialUtils;
+import gtPlusPlus.core.util.minecraft.RecipeUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
-import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Heat;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GregtechMetaPipeEntityFluid;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GregtechMetaPipeEntity_Cable;
-import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GregtechMetaTileEntityGeothermalGenerator;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
@@ -101,9 +106,9 @@ public class GregtechConduits {
//Generate Heat Pipes
- GregtechItemList.HeatPipe_Tier_1.set(new GT_MetaPipeEntity_Heat(31021, "gtpp.pipe.heat.basic.01", "Lead Heat Pipe (500C)", Materials.Lead, 500).getStackForm(1L));
- GregtechItemList.HeatPipe_Tier_2.set(new GT_MetaPipeEntity_Heat(31022, "gtpp.pipe.heat.basic.02", "Iron Heat Pipe (500C)", Materials.Iron, 500).getStackForm(1L));
- GregtechItemList.HeatPipe_Tier_3.set(new GT_MetaPipeEntity_Heat(31023, "gtpp.pipe.heat.basic.03", "Silver Heat Pipe (1500C)", Materials.Silver, 1500).getStackForm(1L));
+ //GregtechItemList.HeatPipe_Tier_1.set(new GT_MetaPipeEntity_Heat(31021, "gtpp.pipe.heat.basic.01", "Lead Heat Pipe (500C)", Materials.Lead, 500).getStackForm(1L));
+ //GregtechItemList.HeatPipe_Tier_2.set(new GT_MetaPipeEntity_Heat(31022, "gtpp.pipe.heat.basic.02", "Iron Heat Pipe (500C)", Materials.Iron, 500).getStackForm(1L));
+ //GregtechItemList.HeatPipe_Tier_3.set(new GT_MetaPipeEntity_Heat(31023, "gtpp.pipe.heat.basic.03", "Silver Heat Pipe (1500C)", Materials.Silver, 1500).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 5f5b43e36f..2d548a57b7 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java
@@ -12,8 +12,10 @@ 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;
public class GregtechRocketFuelGenerator {
@@ -28,6 +30,33 @@ public class GregtechRocketFuelGenerator {
}
private static void run1() {
+ 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', aDieselEngine,
+ 'P', ItemList.Electric_Piston_IV,
+ 'E', ItemList.Field_Generator_EV,
+ 'C', OrePrefixes.circuit.get(Materials.Master),
+ 'W', OrePrefixes.cableGt08.get(Materials.Platinum),
+ 'G', ALLOY.MARAGING350.getGear(1)});
+
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Casing_RocketEngine.get(1L),
+ CI.bitsd,
+ new Object[]{
+ "PhP", "RFR", "PWP",
+ 'R', OrePrefixes.pipeLarge.get(Materials.TungstenSteel),
+ 'F', ItemList.Casing_RobustTungstenSteel,
+ 'P', ALLOY.NITINOL_60.getGear(1)});
+
GregtechItemList.Rocket_Engine_EV.set(new GregtechMetaTileEntityRocketFuelGenerator(793,
"advancedgenerator.rocketFuel.tier.01", "Basic Rocket Engine", 4).getStackForm(1L));
GregtechItemList.Rocket_Engine_IV.set(new GregtechMetaTileEntityRocketFuelGenerator(794,
@@ -37,7 +66,7 @@ public class GregtechRocketFuelGenerator {
if (!CORE.GTNH) {
GT_ModHandler.addCraftingRecipe(GregtechItemList.Rocket_Engine_EV.get(1L, new Object[0]),
GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
+ | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
new Object[]{"PCP", "EME", "GWG", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('P'),
ItemList.Electric_Piston_EV, Character.valueOf('E'), ItemList.Electric_Motor_EV,
Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Ultimate), Character.valueOf('W'),
@@ -46,7 +75,7 @@ public class GregtechRocketFuelGenerator {
GT_ModHandler.addCraftingRecipe(GregtechItemList.Rocket_Engine_IV.get(1L, new Object[0]),
GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
+ | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
new Object[]{"PCP", "EME", "GWG", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('P'),
ItemList.Electric_Piston_IV, Character.valueOf('E'), ItemList.Electric_Motor_IV,
Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Superconductor),
@@ -56,7 +85,7 @@ public class GregtechRocketFuelGenerator {
if (CORE.GTNH) {
GT_ModHandler.addCraftingRecipe(GregtechItemList.Rocket_Engine_EV.get(1L, new Object[0]),
GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
+ | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
new Object[]{"PCP", "EME", "GWG", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('P'),
ItemList.Electric_Piston_EV, Character.valueOf('E'), ItemList.Electric_Motor_EV,
Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('W'),
@@ -65,7 +94,7 @@ public class GregtechRocketFuelGenerator {
GT_ModHandler.addCraftingRecipe(GregtechItemList.Rocket_Engine_IV.get(1L, new Object[0]),
GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
+ | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
new Object[]{"PCP", "EME", "GWG", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('P'),
ItemList.Electric_Piston_IV, Character.valueOf('E'), ItemList.Electric_Motor_IV,
Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Master),
@@ -77,7 +106,7 @@ public class GregtechRocketFuelGenerator {
if (!CORE.GTNH) {
GT_ModHandler.addCraftingRecipe(GregtechItemList.Rocket_Engine_LuV.get(1L, new Object[0]),
GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
+ | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
new Object[]{"PCP", "EME", "GWG", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('P'),
INGREDIENT_1, Character.valueOf('E'), INGREDIENT_2, Character.valueOf('C'),
OrePrefixes.circuit.get(Materials.Infinite), Character.valueOf('W'),
@@ -86,13 +115,13 @@ public class GregtechRocketFuelGenerator {
}
if (CORE.GTNH) {
GT_ModHandler.addCraftingRecipe(GregtechItemList.Rocket_Engine_LuV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[]{"PCP", "EME", "GWG", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('P'),
- INGREDIENT_1, Character.valueOf('E'), INGREDIENT_2, Character.valueOf('C'),
- OrePrefixes.circuit.get(Materials.Ultimate), Character.valueOf('W'),
- OrePrefixes.cableGt02.get(Materials.Tungsten), Character.valueOf('G'),
- ALLOY.ZERON_100.getGear(1)});
+ GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[]{"PCP", "EME", "GWG", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('P'),
+ INGREDIENT_1, Character.valueOf('E'), INGREDIENT_2, Character.valueOf('C'),
+ OrePrefixes.circuit.get(Materials.Ultimate), Character.valueOf('W'),
+ OrePrefixes.cableGt02.get(Materials.Tungsten), Character.valueOf('G'),
+ ALLOY.ZERON_100.getGear(1)});
}
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperChests.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperChests.java
index 84de99a368..dcf52a5008 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperChests.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperChests.java
@@ -6,7 +6,8 @@ import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
-
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_ConnectableCrate;
import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_TieredChest;
@@ -15,39 +16,54 @@ public class GregtechSuperChests {
public static void run() {
int mId = 946;
- GregtechItemList.Super_Chest_LV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.tier.01", "Super Chest I", 1)).getStackForm(1L));
- GregtechItemList.Super_Chest_MV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.tier.02", "Super Chest II", 2)).getStackForm(1L));
- GregtechItemList.Super_Chest_HV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.tier.03", "Super Chest III", 3)).getStackForm(1L));
- GregtechItemList.Super_Chest_EV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.tier.04", "Super Chest IV", 4)).getStackForm(1L));
- GregtechItemList.Super_Chest_IV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.tier.05", "Super Chest V", 5)).getStackForm(1L));
-
-
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Super_Chest_LV.get(1L, new Object[0]), bitsd,
- new Object[]{"DPD", "PMP", "DGD", Character.valueOf('M'), ItemList.Hull_LV, Character.valueOf('G'),
- ItemList.Automation_ChestBuffer_LV, Character.valueOf('D'),
- OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('P'),
- OrePrefixes.plate.get(Materials.Invar)});
-
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Super_Chest_MV.get(1L, new Object[0]), bitsd,
- new Object[]{"DPD", "PMP", "DGD", Character.valueOf('M'), ItemList.Hull_MV, Character.valueOf('G'),
- ItemList.Automation_ChestBuffer_MV, Character.valueOf('D'), OrePrefixes.circuit.get(Materials.Good),
- Character.valueOf('P'), OrePrefixes.plate.get(Materials.Aluminium)});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Super_Chest_HV.get(1L, new Object[0]), bitsd,
- new Object[]{"DPD", "PMP", "DGD", Character.valueOf('M'), ItemList.Hull_HV, Character.valueOf('G'),
- ItemList.Automation_ChestBuffer_HV, Character.valueOf('D'), OrePrefixes.circuit.get(Materials.Advanced),
- Character.valueOf('P'), OrePrefixes.plate.get(Materials.StainlessSteel)});
+ String aSuffix = "";
+ if (CORE.GTNH) {
+ aSuffix = " [Disabled]";
+ }
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Super_Chest_EV.get(1L, new Object[0]), bitsd,
- new Object[]{"DPD", "PMP", "DGD", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('G'),
- ItemList.Automation_ChestBuffer_EV, Character.valueOf('D'), OrePrefixes.circuit.get(Materials.Data),
- Character.valueOf('P'), OrePrefixes.plate.get(Materials.Titanium)});
+ GregtechItemList.Super_Chest_LV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.tier.01", "Super Chest I"+aSuffix, 1)).getStackForm(1L));
+ GregtechItemList.Super_Chest_MV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.tier.02", "Super Chest II"+aSuffix, 2)).getStackForm(1L));
+ GregtechItemList.Super_Chest_HV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.tier.03", "Super Chest III"+aSuffix, 3)).getStackForm(1L));
+ GregtechItemList.Super_Chest_EV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.tier.04", "Super Chest IV"+aSuffix, 4)).getStackForm(1L));
+ GregtechItemList.Super_Chest_IV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.tier.05", "Super Chest V"+aSuffix, 5)).getStackForm(1L));
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Super_Chest_IV.get(1L, new Object[0]), bitsd,
- new Object[]{"DPD", "PMP", "DGD", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('G'),
- ItemList.Automation_ChestBuffer_IV, Character.valueOf('D'),
- OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('P'),
- OrePrefixes.plate.get(Materials.Tungsten)});
+ // Do not add Recipes for GTNH, hide them from NEI instead.
+ if (CORE.GTNH) {
+ ItemUtils.hideItemFromNEI(GregtechItemList.Super_Chest_LV.get(1L));
+ ItemUtils.hideItemFromNEI(GregtechItemList.Super_Chest_MV.get(1L));
+ ItemUtils.hideItemFromNEI(GregtechItemList.Super_Chest_HV.get(1L));
+ ItemUtils.hideItemFromNEI(GregtechItemList.Super_Chest_EV.get(1L));
+ ItemUtils.hideItemFromNEI(GregtechItemList.Super_Chest_IV.get(1L));
+ }
+ else {
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Super_Chest_LV.get(1L, new Object[0]), bitsd,
+ new Object[]{"DPD", "PMP", "DGD", Character.valueOf('M'), ItemList.Hull_LV, Character.valueOf('G'),
+ ItemList.Automation_ChestBuffer_LV, Character.valueOf('D'),
+ OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('P'),
+ OrePrefixes.plate.get(Materials.Invar)});
+
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Super_Chest_MV.get(1L, new Object[0]), bitsd,
+ new Object[]{"DPD", "PMP", "DGD", Character.valueOf('M'), ItemList.Hull_MV, Character.valueOf('G'),
+ ItemList.Automation_ChestBuffer_MV, Character.valueOf('D'), OrePrefixes.circuit.get(Materials.Good),
+ Character.valueOf('P'), OrePrefixes.plate.get(Materials.Aluminium)});
+
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Super_Chest_HV.get(1L, new Object[0]), bitsd,
+ new Object[]{"DPD", "PMP", "DGD", Character.valueOf('M'), ItemList.Hull_HV, Character.valueOf('G'),
+ ItemList.Automation_ChestBuffer_HV, Character.valueOf('D'), OrePrefixes.circuit.get(Materials.Advanced),
+ Character.valueOf('P'), OrePrefixes.plate.get(Materials.StainlessSteel)});
+
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Super_Chest_EV.get(1L, new Object[0]), bitsd,
+ new Object[]{"DPD", "PMP", "DGD", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('G'),
+ ItemList.Automation_ChestBuffer_EV, Character.valueOf('D'), OrePrefixes.circuit.get(Materials.Data),
+ Character.valueOf('P'), OrePrefixes.plate.get(Materials.Titanium)});
+
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Super_Chest_IV.get(1L, new Object[0]), bitsd,
+ new Object[]{"DPD", "PMP", "DGD", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('G'),
+ ItemList.Automation_ChestBuffer_IV, Character.valueOf('D'),
+ OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('P'),
+ OrePrefixes.plate.get(Materials.Tungsten)});
+ }
//Test Thing
GregtechItemList.CrateStorage.set((new GT_MetaTileEntity_ConnectableCrate(GT_MetaTileEntity_ConnectableCrate.mCrateID, "crate.tier.01", "Interconnecting Storage Crate", 0)).getStackForm(1L));