aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/api
diff options
context:
space:
mode:
authorhuajijam <strhuaji@gmail.com>2019-03-18 20:48:01 +0800
committerGitHub <noreply@github.com>2019-03-18 20:48:01 +0800
commit847934e3f0ba597f6d43d5fafdd0e6192d007585 (patch)
treec82b2784655f51b48c430d0cdd22e70b0523aa11 /src/Java/gtPlusPlus/xmod/gregtech/api
parent40d7e5da9f5b84213e2c3e4596fdc69b94bd523e (diff)
parentf93d9fb323a5aee2ed5c30320998f26bc177d707 (diff)
downloadGT5-Unofficial-847934e3f0ba597f6d43d5fafdd0e6192d007585.tar.gz
GT5-Unofficial-847934e3f0ba597f6d43d5fafdd0e6192d007585.tar.bz2
GT5-Unofficial-847934e3f0ba597f6d43d5fafdd0e6192d007585.zip
just fix more bugs
just fix more bugs
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java16
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java18
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java3
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java20
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java24
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java12
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java13
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java153
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java107
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/objects/MultiblockLayer.java10
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java3
15 files changed, 286 insertions, 105 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
index c228364149..83abe22568 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
@@ -84,8 +84,13 @@ public enum GregtechItemList implements GregtechItemContainer {
//Computer Cube
Gregtech_Computer_Cube,
- //Custom Batteries (Unused)
- Battery_Gem_1, Battery_Gem_2, Battery_Gem_3,
+ //Casings for batteries
+ Battery_Casing_Gem_1, Battery_Casing_Gem_2,
+ Battery_Casing_Gem_3, Battery_Casing_Gem_4,
+
+ //Custom Batteries
+ Battery_Gem_1, Battery_Gem_2,
+ Battery_Gem_3, Battery_Gem_4,
//Compressed Fusion MK3
Compressed_Fusion_Reactor,
@@ -99,6 +104,11 @@ public enum GregtechItemList implements GregtechItemContainer {
//End Game Laser Engraver Lens
Laser_Lens_Special,
+ //Bombs
+ Bomb_Cast, Bomb_Cast_Molten,
+ Bomb_Cast_Set, Bomb_Cast_Broken,
+ Bomb_Cast_Mold,
+
//----------------------------------------------------------------------------
@@ -556,7 +566,7 @@ public enum GregtechItemList implements GregtechItemContainer {
*/
//Fluid Void Covers
- Cover_Overflow_ULV, Cover_Overflow_LV, Cover_Overflow_MV, Cover_Overflow_HV, Cover_Overflow_EV, Cover_Overflow_IV,
+ Cover_Overflow_ULV, Cover_Overflow_LV, Cover_Overflow_MV, Cover_Overflow_HV, Cover_Overflow_EV, Cover_Overflow_IV,
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 d5b484e314..721facd8d0 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
@@ -141,7 +141,23 @@ public interface IGregtech_RecipeAdder {
public boolean addLFTRRecipe(ItemStack aInput1, FluidStack aInput2, ItemStack aOutput1, FluidStack aOutput2, int aDuration, int aEUt);
public boolean addLFTRRecipe(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int aDuration, int aEUt);
-
+
+ /**
+ * Adds a custom Semifluid fuel for the GT++ SemiFluid Generators.
+ * @param aFuelItem - A Fluidstack to be consumed.
+ * @param aFuelValue - Fuel value in thousands (1 = 1000)
+ * @return - Was the Fuel added?
+ */
+ public boolean addSemifluidFuel(FluidStack aFuelItem, int aFuelValue);
+
+ /**
+ * Adds a custom Semifluid fuel for the GT++ SemiFluid Generators.
+ * @param aFuelItem - A Fluidstack to be consumed.
+ * @param aFuelValue - Fuel value in thousands (1 = 1000)
+ * @return - Was the Fuel added?
+ */
+ public boolean addSemifluidFuel(ItemStack aFuelItem, int aFuelValue);
+
public boolean addFissionFuel(
FluidStack aInput1, FluidStack aInput2, FluidStack aInput3,
FluidStack aInput4, FluidStack aInput5, FluidStack aInput6,
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java
index 47e4a7ae53..e637365c1e 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java
@@ -12,6 +12,7 @@ import gregtech.api.util.GT_Utility;
import gregtech.common.GT_Pollution;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
import ic2.api.Direction;
import net.minecraft.item.ItemStack;
@@ -88,7 +89,7 @@ public class BaseCustomTileEntity extends BaseMetaTileEntity {
}
}
- GT_Pollution.addPollution(this, 100000);
+ PollutionUtils.addPollution(this, 100000);
this.mMetaTileEntity.doExplosion(aAmount);
}
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 b0dc635aee..19ba932a02 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
@@ -361,17 +361,7 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
@Override
public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
if (aBaseMetaTileEntity.isClientSide()) return true;
- if(!GT_Mod.gregtechproxy.mForceFreeFace) {
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
- for(byte i=0;i < 6; i++){
- if(aBaseMetaTileEntity.getAirAtSide(i)){
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
- }
- GT_Utility.sendChatToPlayer(aPlayer,"No free Side!");
+ aBaseMetaTileEntity.openGUI(aPlayer);
return true;
}
@@ -461,7 +451,8 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
}
if (mProgresstime > 5) mStuttering = false;
XSTR aXSTR = new XSTR();
- if(GT_Mod.gregtechproxy.mAprilFool && aXSTR.nextInt(5000)==0)GT_Utility.sendSoundToPlayers(aBaseMetaTileEntity.getWorld(), GregTech_API.sSoundList.get(5), 10.0F, -1.0F, aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord());
+ //Dumb April Fools Shit
+ // if(GT_Mod.gregtechproxy.mAprilFool && aXSTR.nextInt(5000)==0)GT_Utility.sendSoundToPlayers(aBaseMetaTileEntity.getWorld(), GregTech_API.sSoundList.get(5), 10.0F, -1.0F, aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord());
} else {
if (!mStuttering) {
stutterProcess();
@@ -726,7 +717,7 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
if (aSide == getBaseMetaTileEntity().getFrontFacing() || aSide == mMainFacing) {
mAllowInputFromOutputSide = !mAllowInputFromOutputSide;
- GT_Utility.sendChatToPlayer(aPlayer, mAllowInputFromOutputSide ? trans("095","Input from Output Side allowed") : trans("096","Input from Output Side forbidden"));
+ GT_Utility.sendChatToPlayer(aPlayer, mAllowInputFromOutputSide ? "Input from Output Side allowed" : "Input from Output Side forbidden");
}
}
@@ -790,9 +781,6 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[mTier], new FluidStack[]{getFillableStack()}, getSpecialSlot(), getAllInputs());
if (tRecipe == null) return DID_NOT_FIND_RECIPE;
- if (GT_Mod.gregtechproxy.mLowGravProcessing && tRecipe.mSpecialValue == -100 &&
- !isValidForLowGravity(tRecipe,getBaseMetaTileEntity().getWorld().provider.dimensionId))
- return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe;
if (!canOutput(tRecipe)) {
mOutputBlocked++;
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java
index d5180ef4e1..18665538d0 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java
@@ -27,7 +27,7 @@ public class GT_MetaTileEntity_BasicMachine_GTPP_Recipe extends GT_MetaTileEntit
GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage,
int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName,
String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) {
- super(aName, aTier, aDescription, aRecipes, aInputSlots, aOutputSlots, aTankCapacity, aAmperage, aGUIParameterA,
+ super(aName, aTier, aDescription[0], aRecipes, aInputSlots, aOutputSlots, aTankCapacity, aAmperage, aGUIParameterA,
aGUIParameterB, aTextures, aGUIName, aNEIName, aSound, aSharedTank, aRequiresFluidForFiltering, aSpecialEffect);
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java
index fe0ffd5dc8..7a532807c8 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java
@@ -8,16 +8,20 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
+import gtPlusPlus.api.objects.minecraft.BlockPos;
import gtPlusPlus.core.item.general.ItemControlCore;
import gtPlusPlus.xmod.gregtech.common.StaticFields59;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
public class GT_MetaTileEntity_Hatch_ControlCore extends GT_MetaTileEntity_Hatch {
public GT_Recipe_Map mRecipeMap = null;
+
+ public BlockPos mControllerLocation;
public GT_MetaTileEntity_Hatch_ControlCore(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier, getSlots(aTier), "Core determines maximum tier machine will operate at");
@@ -113,4 +117,24 @@ public class GT_MetaTileEntity_Hatch_ControlCore extends GT_MetaTileEntity_Hatch
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return aSide == getBaseMetaTileEntity().getFrontFacing() && (aStack != null && aStack.getItem() instanceof ItemControlCore);
}
+
+ public boolean setOwner(TileEntity aTileEntity) {
+ if (mControllerLocation != null) {
+ return false;
+ }
+ else {
+ mControllerLocation = new BlockPos(aTileEntity);
+ return true;
+ }
+ }
+
+ public boolean setOwner(IGregTechTileEntity aTileEntity) {
+ if (mControllerLocation != null) {
+ return false;
+ }
+ else {
+ mControllerLocation = new BlockPos(aTileEntity);
+ return true;
+ }
+ }
}
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 e427587be0..9b730c84a3 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
@@ -2,7 +2,8 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo;
-
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -47,7 +48,14 @@ public class GT_MetaTileEntity_Hatch_DynamoBuffer extends GT_MetaTileEntity_Hatc
@Override
public String[] getDescription() {
- String[] g = new String[]{"Generating electric Energy from Multiblocks", "Stores "+maxEUStore()+"EU", "Puts out up to 4 Amps", "Does not accept more than "+this.maxEUOutput()+"EU/t as input", "Large Turbines only supply 1A to this, other Multiblocks can inject more amps"};
+ String[] g;
+ if (CORE.GTNH || (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && Utils.getGregtechVersionAsInt() >= 50932)) {
+ g = new String[]{"Dynamo with internal storage and additional Amp capacity", "Capacity: "+maxEUStore()+"EU", "Voltage: "+this.maxEUOutput(), "Amperage In: 4", "Amperage Out: 4"};
+
+ }
+ else {
+ g = new String[]{"Dynamo with internal storage and additional Amp capacity", "Stores "+maxEUStore()+"EU", "Amperage In: 4", "Amperage Out: 4", "Does not accept more than "+this.maxEUOutput()+"EU/t as input", "Large Turbines only supply 1A to this, other Multiblocks can inject more amps"};
+ }
return g;
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java
index 2b7f44be59..0d4d8b6cdd 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java
@@ -184,7 +184,7 @@ public class GT_MetaTileEntity_Hatch_Naquadah extends GT_MetaTileEntity_Hatch_In
a2 = F2.getByte(this);
}
}
- catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException n) {}
+ catch (IllegalArgumentException | IllegalAccessException n) {}
int textureIndex = a1 | a2 << 7;
byte texturePointer = (byte) (a1 & 127);
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java
index aeae474fb7..bed80d8d13 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java
@@ -9,6 +9,7 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
@@ -19,7 +20,7 @@ import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
-public class GT_MetaTileEntity_Hatch_Plasma extends GT_MetaTileEntity_Hatch_Input {
+public class GT_MetaTileEntity_Hatch_Plasma extends GT_MetaTileEntity_Hatch_Output {
public final AutoMap<Fluid> mFluidsToUse = new AutoMap<Fluid>();
public final int mFluidCapacity;
@@ -49,11 +50,9 @@ public class GT_MetaTileEntity_Hatch_Plasma extends GT_MetaTileEntity_Hatch_Inpu
//Get all Plasmas, but the easiest way to do this is to just ask the Fluid Registry what exists and filter through them lazily.
Field fluidNameCache;
- try {
- fluidNameCache = ReflectionUtils.getField(FluidRegistry.class, "fluidNames");
- } catch (NoSuchFieldException e) {
- fluidNameCache = null;
- }
+
+ fluidNameCache = ReflectionUtils.getField(FluidRegistry.class, "fluidNames");
+
AutoMap<String> mValidPlasmaNameCache = new AutoMap<String>();
if (fluidNameCache != null) {
try {
@@ -198,7 +197,7 @@ public class GT_MetaTileEntity_Hatch_Plasma extends GT_MetaTileEntity_Hatch_Inpu
a2 = F2.getByte(this);
}
}
- catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException n) {}
+ catch (IllegalArgumentException | IllegalAccessException n) {}
int textureIndex = a1 | a2 << 7;
byte texturePointer = (byte) (a1 & 127);
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 96df4dbfd0..5e41af86af 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
@@ -28,7 +28,7 @@ public class GT_MetaTileEntity_SuperBus_Input extends GT_MetaTileEntity_Hatch_In
}
public GT_MetaTileEntity_SuperBus_Input(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
+ super(aName, aTier, aDescription[0], aTextures);
}
/**
@@ -65,7 +65,7 @@ public class GT_MetaTileEntity_SuperBus_Input extends GT_MetaTileEntity_Hatch_In
}
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_SuperBus_Input(this.mName, this.mTier, this.mDescriptionArray, this.mTextures);
+ return new GT_MetaTileEntity_SuperBus_Input(this.mName, this.mTier, this.mDescription, this.mTextures);
}
public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
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 d09b71ee35..4fac3d36d8 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
@@ -26,7 +26,7 @@ public class GT_MetaTileEntity_SuperBus_Output extends GT_MetaTileEntity_Hatch_O
}
public GT_MetaTileEntity_SuperBus_Output(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
+ super(aName, aTier, aDescription[0], aTextures);
}
/**
@@ -43,7 +43,7 @@ public class GT_MetaTileEntity_SuperBus_Output extends GT_MetaTileEntity_Hatch_O
}
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_SuperBus_Output(this.mName, this.mTier, this.mDescriptionArray, this.mTextures);
+ return new GT_MetaTileEntity_SuperBus_Output(this.mName, this.mTier, this.mDescription, this.mTextures);
}
public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
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 04c1cf34cc..9393ca08be 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
@@ -16,6 +16,7 @@ import org.apache.commons.lang3.ArrayUtils;
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
+import gregtech.api.enums.TAE;
import gregtech.api.gui.GT_Container_MultiMachine;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -38,7 +39,10 @@ import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
+import gtPlusPlus.GTplusplus;
+import gtPlusPlus.GTplusplus.INIT_PHASE;
import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.minecraft.BlockPos;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
@@ -68,6 +72,7 @@ extends
GT_MetaTileEntity_MultiBlockBase {
+ public static final boolean DEBUG_DISABLE_CORES_TEMPORARILY = true;
static {
@@ -199,7 +204,7 @@ GT_MetaTileEntity_MultiBlockBase {
}
}
- int tTier = requireControlCores ? this.getControlCoreTier() : -1;
+ int tTier = this.getControlCoreTier();
mInfo.add(getMachineTooltip());
@@ -265,6 +270,10 @@ GT_MetaTileEntity_MultiBlockBase {
private final String aRequiresCoreModule = "1x Core Module";
private final String aRequiresMaint = "1x Maintanence Hatch";*/
+ public final static String TAG_HIDE_HATCHES = "TAG_HIDE_HATCHES";
+ public final static String TAG_HIDE_POLLUTION = "TAG_HIDE_POLLUTION";
+ public final static String TAG_HIDE_MACHINE_TYPE = "TAG_HIDE_MACHINE_TYPE";
+
@Override
public final String[] getDescription() {
/*if (aCachedToolTip != null) {
@@ -287,22 +296,62 @@ GT_MetaTileEntity_MultiBlockBase {
String aRequiresCoreModule = "1x Core Module";
String aRequiresMaint = "1x Maintanence Hatch";
- String[] x = getTooltip();
- //Add Stock Tooltip to bottom of list
- String[] z;
- if (getPollutionPerTick(null) > 0) {
- z = new String[] {
- aRequiresMaint,
- aRequiresCoreModule,
- aRequiresMuffler,
- getPollutionTooltip(),
- getMachineTooltip()};
+ String[] x = getTooltip();
+
+ //Filter List, toggle switches, rebuild map without flags
+ boolean showHatches = true;
+ boolean showMachineType = true;
+ boolean showPollution = getPollutionPerTick(null) > 0;
+ AutoMap<String> aTempMap = new AutoMap<String>();
+ for (int ee = 0; ee < x.length; ee++) {
+ String hh = x[ee];
+ if (hh.equals(TAG_HIDE_HATCHES)) {
+ showHatches = false;
+ }
+ else if (hh.equals(TAG_HIDE_POLLUTION)) {
+ showPollution = false;
+ }
+ else if (hh.equals(TAG_HIDE_MACHINE_TYPE)) {
+ showMachineType = false;
+ }
+ else {
+ aTempMap.put(x[ee]);
+ }
}
- else {
- z = new String[] {
- aRequiresMaint,
- aRequiresCoreModule,
- getMachineTooltip(),};
+ //Rebuild
+ x = new String[aTempMap.size()];
+ for (int ee = 0; ee < x.length; ee++) {
+ x[ee] = aTempMap.get(ee);
+ }
+
+
+ //Assemble ordered map for misc tooltips
+ AutoMap<String> aOrderedMap = new AutoMap<String>();
+ if (showHatches) {
+ aOrderedMap.put(aRequiresMaint);
+ aOrderedMap.put(aRequiresCoreModule);
+ if (showPollution) {
+ aOrderedMap.put(aRequiresMuffler);
+ }
+ }
+
+ if (showMachineType) {
+ aOrderedMap.put(getMachineTooltip());
+ }
+
+ if (showPollution) {
+ aOrderedMap.put(getPollutionTooltip());
+ }
+
+
+
+
+
+ //Add Stock Tooltip to bottom of list
+ String[] z;
+ z = new String[aOrderedMap.size()];
+ for (int ee = 0; ee < z.length; ee++) {
+ z[ee] = aOrderedMap.get(ee);
}
int a2, a3;
@@ -435,7 +484,12 @@ GT_MetaTileEntity_MultiBlockBase {
public void log(String s) {
boolean isDebugLogging = CORE.DEBUG;
- boolean reset = false;
+ boolean reset = true;
+
+ if (!isDebugLogging) {
+ return;
+ }
+
if (aLogger == null || reset) {
if (isDebugLogging) {
try {
@@ -501,8 +555,8 @@ GT_MetaTileEntity_MultiBlockBase {
//Control Core to control the Multiblocks behaviour.
int aControlCoreTier = getControlCoreTier();
-
- //If no core, return false;
+
+ //If no core, return false;
if (aControlCoreTier == 0 && requireControlCores) {
log("No control core found.");
return false;
@@ -587,7 +641,7 @@ GT_MetaTileEntity_MultiBlockBase {
//Only Overclock as high as the control circuit.
byte tTierOld = tTier;
- tTier = requireControlCores ? (byte) aControlCoreTier : tTierOld;
+ tTier = getControlCoreTier() > 0 ? (byte) aControlCoreTier : tTierOld;
// Overclock
if (this.mEUt <= 16) {
@@ -859,10 +913,15 @@ GT_MetaTileEntity_MultiBlockBase {
public <E> boolean addToMachineListInternal(ArrayList<E> aList, final IMetaTileEntity aTileEntity,
- final int aBaseCasingIndex) {
+ final int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ }
if (aList.isEmpty()) {
if (aTileEntity instanceof GT_MetaTileEntity_Hatch) {
- log("Adding " + aTileEntity.getInventoryName() + " at " + new BlockPos(aTileEntity.getBaseMetaTileEntity()).getLocationString());
+ if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) {
+ log("Adding " + aTileEntity.getInventoryName() + " at " + new BlockPos(aTileEntity.getBaseMetaTileEntity()).getLocationString());
+ }
updateTexture(aTileEntity, aBaseCasingIndex);
return aList.add((E) aTileEntity);
}
@@ -875,13 +934,17 @@ GT_MetaTileEntity_MultiBlockBase {
BlockPos aPos = new BlockPos(b);
if (b != null && aPos != null) {
if (aCurPos.equals(aPos)) {
- log("Found Duplicate "+b.getInventoryName()+" at " + aPos.getLocationString());
+ if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) {
+ log("Found Duplicate "+b.getInventoryName()+" at " + aPos.getLocationString());
+ }
return false;
}
}
}
if (aTileEntity instanceof GT_MetaTileEntity_Hatch) {
- log("Adding " + aCur.getInventoryName() + " at " + aCurPos.getLocationString());
+ if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) {
+ log("Adding " + aCur.getInventoryName() + " at " + aCurPos.getLocationString());
+ }
updateTexture(aTileEntity, aBaseCasingIndex);
return aList.add((E) aTileEntity);
}
@@ -892,10 +955,10 @@ GT_MetaTileEntity_MultiBlockBase {
public int getControlCoreTier() {
//Always return best tier if config is off.
- boolean aCoresConfig = gtPlusPlus.core.lib.CORE.ConfigSwitches.requireControlCores;
+ /*boolean aCoresConfig = gtPlusPlus.core.lib.CORE.ConfigSwitches.requireControlCores;
if (!aCoresConfig) {
return 10;
- }
+ }*/
if (mControlCoreBus.isEmpty()) {
log("No Control Core Modules Found.");
@@ -936,9 +999,16 @@ GT_MetaTileEntity_MultiBlockBase {
log("Tried to add a secondary control core module.");
return false;
}
-
- log("Adding control core module.");
- return addToMachineListInternal(mControlCoreBus, aMetaTileEntity, aBaseCasingIndex);
+
+ GT_MetaTileEntity_Hatch_ControlCore Module = (GT_MetaTileEntity_Hatch_ControlCore) aMetaTileEntity;
+
+ if (Module != null) {
+ if (Module.setOwner(aTileEntity)) {
+ log("Adding control core module.");
+ return addToMachineListInternal(mControlCoreBus, aMetaTileEntity, aBaseCasingIndex);
+ }
+ }
+ return false;
}
@Override
@@ -1085,7 +1155,8 @@ 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;
+ ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = aMap;
+ log("Remapped Input Hatch to "+aMap.mNEIName);
}
else {
((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = null;
@@ -1117,7 +1188,6 @@ GT_MetaTileEntity_MultiBlockBase {
* Enable Texture Casing Support if found in GT 5.09
*/
- @SuppressWarnings("deprecation")
public boolean updateTexture(final IGregTechTileEntity aTileEntity, int aCasingID){
final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
if (aMetaTileEntity == null) {
@@ -1138,7 +1208,7 @@ GT_MetaTileEntity_MultiBlockBase {
if (aMetaTileEntity == null) {
return false;
}
- Method mProper = Class.forName("gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch").getDeclaredMethod("updateTexture", int.class);
+ Method mProper = ReflectionUtils.getMethod(GT_MetaTileEntity_Hatch.class, "updateTexture", int.class);
if (mProper != null){
if (GT_MetaTileEntity_Hatch.class.isInstance(aMetaTileEntity)){
mProper.setAccessible(true);
@@ -1146,7 +1216,6 @@ GT_MetaTileEntity_MultiBlockBase {
log("Good Method Call for updateTexture.");
return true;
}
-
}
else {
log("Bad Method Call for updateTexture.");
@@ -1167,7 +1236,7 @@ GT_MetaTileEntity_MultiBlockBase {
log("updateTexture returning false. 1");
return false;
}
- catch (NoSuchMethodException | SecurityException | ClassNotFoundException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
log("updateTexture returning false.");
log("updateTexture returning false. 2");
e.printStackTrace();
@@ -1221,15 +1290,12 @@ GT_MetaTileEntity_MultiBlockBase {
@SuppressWarnings("rawtypes")
public boolean isThisHatchMultiDynamo(Object aMetaTileEntity){
Class mDynamoClass;
- try {
- mDynamoClass = Class.forName("com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti");
+ mDynamoClass = ReflectionUtils.getClass("com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti");
if (mDynamoClass != null){
if (mDynamoClass.isInstance(aMetaTileEntity)){
return true;
}
}
- }
- catch (ClassNotFoundException e) {}
return false;
}
@@ -1510,7 +1576,7 @@ GT_MetaTileEntity_MultiBlockBase {
public final boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
boolean aStructureCheck = checkMultiblock(aBaseMetaTileEntity, aStack);
- boolean aHasCore = (requireControlCores ? (this.getControlCoreBus() != null) : true);
+ boolean aHasCore = DEBUG_DISABLE_CORES_TEMPORARILY; //(requireControlCores ? (this.getControlCoreBus() != null) : true);
return aStructureCheck && aHasCore;
}
@@ -1521,6 +1587,11 @@ GT_MetaTileEntity_MultiBlockBase {
Block aFoundBlock, int aFoundMeta, Block aExpectedBlock, int aExpectedMeta) {
boolean isHatch = false;
if (aBaseMetaTileEntity != null) {
+
+ if (aCasingID < 64) {
+ aCasingID = TAE.GTPP_INDEX(aCasingID);
+ }
+
isHatch = this.addToMachineList(aBaseMetaTileEntity, aCasingID);
if (isHatch) {
return true;
@@ -1562,7 +1633,9 @@ GT_MetaTileEntity_MultiBlockBase {
}
else if (aFoundBlock != aExpectedBlock) {
log("A1 - Found: "+aFoundBlock.getLocalizedName()+":"+aFoundMeta+", Expected: "+aExpectedBlock.getLocalizedName()+":"+aExpectedMeta);
- log("Loc: "+(new BlockPos(aBaseMetaTileEntity).getLocationString()));
+ if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) {
+ log("Loc: "+(new BlockPos(aBaseMetaTileEntity).getLocationString()));
+ }
return false;
}
else if (aFoundMeta != aExpectedMeta) {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java
index a88d6a4832..b6e7b35d68 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java
@@ -4,10 +4,6 @@ import static gregtech.api.enums.GT_Values.V;
import java.util.Collection;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -15,9 +11,12 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
-
import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_BasicTank {
@@ -144,7 +143,7 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_
@Override
public boolean isOutputFacing(final byte aSide) {
- return true;
+ return this.getBaseMetaTileEntity().getFrontFacing() == aSide;
}
@Override
@@ -154,7 +153,7 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_
@Override
public long maxEUOutput() {
- return this.getBaseMetaTileEntity().isAllowedToWork() ? V[this.mTier] : 0;
+ return V[this.mTier];
}
@Override
@@ -164,22 +163,22 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_
@Override
public boolean doesFillContainers() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
+ return false;
}
@Override
public boolean doesEmptyContainers() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
+ return true;
}
@Override
public boolean canTankBeFilled() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
+ return true;
}
@Override
public boolean canTankBeEmptied() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
+ return false;
}
@Override
@@ -199,6 +198,61 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_
@Override
public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+
+
+ //super.onPostTick(aBaseMetaTileEntity, aTick);
+
+ /*if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aTick % 10L == 0L) {
+ int tFuelValue;
+ if (this.mFluid == null) {
+ if (aBaseMetaTileEntity.getUniversalEnergyStored() < this.maxEUOutput() + this.getMinimumStoredEU()) {
+ this.mInventory[this.getStackDisplaySlot()] = null;
+ } else {
+ if (this.mInventory[this.getStackDisplaySlot()] == null) {
+ this.mInventory[this.getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1);
+ }
+
+ this.mInventory[this.getStackDisplaySlot()].setStackDisplayName("Generating: "
+ + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + " EU");
+ }
+ } else {
+ tFuelValue = this.getFuelValue(this.mFluid);
+ int tConsumed = this.consumedFluidPerOperation(this.mFluid);
+ if (tFuelValue > 0 && tConsumed > 0 && this.mFluid.amount > tConsumed) {
+ long tFluidAmountToUse = Math.min((long) (this.mFluid.amount / tConsumed),
+ (this.maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / (long) tFuelValue);
+ if (tFluidAmountToUse > 0L && aBaseMetaTileEntity
+ .increaseStoredEnergyUnits(tFluidAmountToUse * (long) tFuelValue, true)) {
+ PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollution());
+ this.mFluid.amount = (int) ((long) this.mFluid.amount - tFluidAmountToUse * (long) tConsumed);
+ }
+ }
+ }
+
+ if (this.mInventory[this.getInputSlot()] != null
+ && aBaseMetaTileEntity.getUniversalEnergyStored() < this.maxEUOutput() * 20L
+ + this.getMinimumStoredEU()
+ && GT_Utility.getFluidForFilledItem(this.mInventory[this.getInputSlot()], true) == null) {
+ tFuelValue = this.getFuelValue(this.mInventory[this.getInputSlot()]);
+ if (tFuelValue > 0) {
+ ItemStack tEmptyContainer = this.getEmptyContainer(this.mInventory[this.getInputSlot()]);
+ if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), tEmptyContainer)) {
+ aBaseMetaTileEntity.increaseStoredEnergyUnits((long) tFuelValue, true);
+ aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
+ PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollution());
+ }
+ }
+ }
+ }
+
+ if (aBaseMetaTileEntity.isServerSide()) {
+ aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity
+ .getUniversalEnergyStored() >= this.maxEUOutput() + this.getMinimumStoredEU());
+ }*/
+
+
+
+
if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && ((aTick % 10) == 0)) {
if (this.mFluid == null) {
if (aBaseMetaTileEntity.getUniversalEnergyStored() < (this.maxEUOutput() + this.getMinimumStoredEU())) {
@@ -211,16 +265,14 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_
}
} else {
final int tFuelValue = this.getFuelValue(this.mFluid), tConsumed = this.consumedFluidPerOperation(this.mFluid);
- if ((tFuelValue > 0) && (tConsumed > 0) && (this.mFluid.amount > tConsumed)) {
+ if ((tFuelValue > 0) && (tConsumed > 0) && (this.mFluid.amount >= tConsumed)) {
final long tFluidAmountToUse = Math.min(this.mFluid.amount / tConsumed, (((this.maxEUOutput() * 20) + this.getMinimumStoredEU()) - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue);
- if ((tFluidAmountToUse > 0) && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)){
- if (this.useFuel){
- this.mFluid.amount -= tFluidAmountToUse * tConsumed;
- this.useFuel = false;
- }
- else {
- this.useFuel = true;
- }
+ if ((tFluidAmountToUse > 0) && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)){
+ useFuel = Utils.invertBoolean(useFuel);
+ int aSafeFloor= (int) Math.max(((tFluidAmountToUse * tConsumed)/3), 1);
+ int toConsumeTrue = (int) (useFuel ? aSafeFloor : 0);
+ //Logger.INFO("True consumption: "+toConsumeTrue+" | Consuming this tick? "+useFuel);
+ this.mFluid.amount -= toConsumeTrue;
PollutionUtils.addPollution(getBaseMetaTileEntity(), 10 * getPollution());
}
}
@@ -260,14 +312,25 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_
FluidStack tLiquid;
final Collection<GT_Recipe> tRecipeList = this.getRecipes().mRecipeList;
if (tRecipeList != null) {
+ //Logger.INFO("Step A");
for (final GT_Recipe tFuel : tRecipeList) {
- if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null) {
+ //Logger.INFO("Step B");
+ if ((tLiquid = tFuel.mFluidInputs[0]) != null) {
+ //Logger.INFO("Step C");
if (aLiquid.isFluidEqual(tLiquid)) {
- return (int) (((long) tFuel.mSpecialValue * this.getEfficiency() * this.consumedFluidPerOperation(tLiquid)) / 100);
+ //Logger.INFO("Found some fuel?");
+ int aperOp = this.consumedFluidPerOperation(tLiquid);
+ int aConsume = (int) (((long) tFuel.mSpecialValue * this.getEfficiency() * aperOp) / 100);
+ //Logger.INFO("Fuel Value: "+tFuel.mSpecialValue);
+ //Logger.INFO("Efficiency: "+getEfficiency());
+ //Logger.INFO("Consumed per op: "+aperOp);
+ //Logger.INFO("Consuming "+aConsume);
+ return aConsume;
}
}
}
}
+ //Logger.INFO("No Fuel Value | Valid? "+(aLiquid != null));
return 0;
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/objects/MultiblockLayer.java b/src/Java/gtPlusPlus/xmod/gregtech/api/objects/MultiblockLayer.java
index 88b4c7bc99..c5554a6679 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/objects/MultiblockLayer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/objects/MultiblockLayer.java
@@ -17,6 +17,7 @@ import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import net.minecraft.block.Block;
import net.minecraft.block.BlockAir;
import net.minecraft.init.Blocks;
@@ -124,10 +125,11 @@ public class MultiblockLayer {
GT_MetaTileEntity_Hatch.class
};
}
- else {
- try {
+ else {
+ Class aDataHatch = ReflectionUtils.getClass("gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_DataAccess");
+ if (aDataHatch != null) {
aHatchTypeClass = new Class[] {
- Class.forName("gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_DataAccess"),
+ aDataHatch,
GT_MetaTileEntity_Hatch_Dynamo.class,
GT_MetaTileEntity_Hatch_Energy.class,
GT_MetaTileEntity_Hatch_Input.class,
@@ -138,7 +140,7 @@ public class MultiblockLayer {
GT_MetaTileEntity_Hatch_OutputBus.class,
GT_MetaTileEntity_Hatch.class
};
- } catch (ClassNotFoundException e) {
+ } else {
aHatchTypeClass = new Class[] {
GT_MetaTileEntity_Hatch_Dynamo.class,
GT_MetaTileEntity_Hatch_Energy.class,
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java b/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java
index d5327a6a99..3e0084139e 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java
@@ -38,12 +38,9 @@ public class GregtechOreDictUnificator {
private static boolean mRunThroughTheList = true;
static {
- try {
if (ReflectionUtils.getField(GT_OreDictUnificator.class, "sUnificationTable") == null) {
GregTech_API.sItemStackMappings.add(sUnificationTable);
}
- }
- catch (NoSuchFieldException e) {}
}
/**