aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2018-10-26 01:04:30 +0100
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2018-10-26 01:04:30 +0100
commitb9ad7d46f1f1993add94ad7b561e1fea94a4e0d1 (patch)
treeff509e8d7226ad3bd789cc38dd9bb9d8ca0a4553 /src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity
parent7e09b5381593a23aeff0a0bab03926a8c1e2b87d (diff)
downloadGT5-Unofficial-b9ad7d46f1f1993add94ad7b561e1fea94a4e0d1.tar.gz
GT5-Unofficial-b9ad7d46f1f1993add94ad7b561e1fea94a4e0d1.tar.bz2
GT5-Unofficial-b9ad7d46f1f1993add94ad7b561e1fea94a4e0d1.zip
% Updated 5.08 compatibility.
> Created StaticFields59.java to hold static copies of fields gotten from gt 5.09 classes. ^ Version bump.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ThreadedBuffer.java9
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java35
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java51
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java1
6 files changed, 76 insertions, 28 deletions
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 dd930e798c..eb1c3cc1f7 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
@@ -37,7 +37,7 @@ public class GT_MetaTileEntity_Hatch_Naquadah extends GT_MetaTileEntity_Hatch_In
public GT_MetaTileEntity_Hatch_Naquadah(final String aName, final String[] aDescription,
final ITexture[][][] aTextures) {
- super(aName, 6, aDescription, aTextures);
+ super(aName, 6, aDescription[0], aTextures);
mFluidCapacity = 32000;
initHatch();
}
@@ -92,7 +92,7 @@ public class GT_MetaTileEntity_Hatch_Naquadah extends GT_MetaTileEntity_Hatch_In
}
public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return (MetaTileEntity) new GT_MetaTileEntity_Hatch_Naquadah(this.mName, this.mDescriptionArray, this.mTextures);
+ return (MetaTileEntity) new GT_MetaTileEntity_Hatch_Naquadah(this.mName, this.mDescription, this.mTextures);
}
@Override
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ThreadedBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ThreadedBuffer.java
index 9642ff63ee..3e6d2f5d13 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ThreadedBuffer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ThreadedBuffer.java
@@ -37,7 +37,7 @@ public abstract class GT_MetaTileEntity_ThreadedBuffer extends GT_MetaTileEntity
public GT_MetaTileEntity_ThreadedBuffer(final int aID, final String aName, final String aNameRegional, final int aTier,
final int aInvSlotCount, final String[] aDescription) {
- super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
+ super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription[0]);
this.bOutput = false;
this.bRedstoneIfFull = false;
this.bInvert = false;
@@ -59,7 +59,7 @@ public abstract class GT_MetaTileEntity_ThreadedBuffer extends GT_MetaTileEntity
public GT_MetaTileEntity_ThreadedBuffer(final String aName, final int aTier, final int aInvSlotCount,
final String[] aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, aInvSlotCount, aDescription, aTextures);
+ super(aName, aTier, aInvSlotCount, aDescription[0], aTextures);
this.bOutput = false;
this.bRedstoneIfFull = false;
this.bInvert = false;
@@ -292,10 +292,9 @@ public abstract class GT_MetaTileEntity_ThreadedBuffer extends GT_MetaTileEntity
this.mTargetStackSize = 64;
}
if (this.mTargetStackSize == 0) {
- GT_Utility.sendChatToPlayer(aPlayer, this.trans("098", "Do not regulate Item Stack Size"));
+ GT_Utility.sendChatToPlayer(aPlayer, "Do not regulate Item Stack Size");
} else {
- GT_Utility.sendChatToPlayer(aPlayer,
- this.trans("099", "Regulate Item Stack Size to: ") + this.mTargetStackSize);
+ GT_Utility.sendChatToPlayer(aPlayer, "Regulate Item Stack Size to: " + this.mTargetStackSize);
}
}
}
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 938febfea7..9eea6b4a28 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java
@@ -15,38 +15,53 @@ import gregtech.api.objects.GT_RenderedTexture;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
public class GregtechMetaPipeEntityFluid extends GT_MetaPipeEntity_Fluid {
+
+
+ public static final boolean mGt6Pipe;
+
+ static {
+ Boolean aGt6 = (Boolean) Meta_GT_Proxy.getFieldFromGregtechProxy(false, "gt6Pipe");
+ if (aGt6 != null) {
+ mGt6Pipe = aGt6;
+ }
+ else {
+ mGt6Pipe = false;
+ }
+ }
+
public final GT_Materials mMaterial;
- private boolean mCheckConnections;
+ private boolean mCheckConnections;
+
public GregtechMetaPipeEntityFluid(int aID, String aName, String aNameRegional, float aThickNess, GT_Materials aMaterial,
int aCapacity, int aHeatResistance, boolean aGasProof) {
this(aID, aName, aNameRegional, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1);
}
+
+ public GregtechMetaPipeEntityFluid(final String aName, final float aThickNess, final GT_Materials aMaterial, final int aCapacity, final int aHeatResistance, final boolean aGasProof) {
+ this(aName, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1);
+ }
public GregtechMetaPipeEntityFluid(int aID, String aName, String aNameRegional, float aThickNess, GT_Materials aMaterial,
int aCapacity, int aHeatResistance, boolean aGasProof, int aFluidTypes) {
super(aID, aName, aNameRegional, aThickNess, null, aCapacity, aHeatResistance, aGasProof);
this.mLastReceivedFrom = 0;
this.oLastReceivedFrom = 0;
- this.mCheckConnections = !GT_Mod.gregtechproxy.gt6Pipe;
- this.mDisableInput = 0;
+ this.mCheckConnections = !mGt6Pipe;
this.mMaterial = aMaterial;
- this.addInfo(aID);
}
- public GregtechMetaPipeEntityFluid(final String aName, final float aThickNess, final GT_Materials aMaterial, final int aCapacity, final int aHeatResistance, final boolean aGasProof) {
- this(aName, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1);
- }
+
public GregtechMetaPipeEntityFluid(String aName, float aThickNess, GT_Materials aMaterial, int aCapacity,
int aHeatResistance, boolean aGasProof, int aFluidTypes) {
- super(aName, aThickNess, null, aCapacity, aHeatResistance, aGasProof, aFluidTypes);
+ super(aName, aThickNess, null, aCapacity, aHeatResistance, aGasProof);
this.mLastReceivedFrom = 0;
this.oLastReceivedFrom = 0;
- this.mCheckConnections = !GT_Mod.gregtechproxy.gt6Pipe;
- this.mDisableInput = 0;
+ this.mCheckConnections = !mGt6Pipe;
this.mMaterial = aMaterial;
}
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 c664936a0b..839fb3a14a 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
@@ -35,7 +35,7 @@ public class GT_MetaTileEntity_Hatch_CustomFluidBase extends GT_MetaTileEntity_H
}
public GT_MetaTileEntity_Hatch_CustomFluidBase(Fluid aFluid, int aAmount, final String aName, final String[] aDescription, final ITexture[][][] aTextures) {
- super(aName, 6, aDescription, aTextures);
+ super(aName, 6, aDescription[0], aTextures);
this.mRecipeMap = null;
this.mLockedFluid = aFluid;
this.mFluidCapacity = aAmount;
@@ -112,6 +112,6 @@ public class GT_MetaTileEntity_Hatch_CustomFluidBase extends GT_MetaTileEntity_H
}
public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return (MetaTileEntity) new GT_MetaTileEntity_Hatch_CustomFluidBase(this.mLockedFluid, this.mFluidCapacity, this.mName, this.mDescriptionArray, this.mTextures);
+ return (MetaTileEntity) new GT_MetaTileEntity_Hatch_CustomFluidBase(this.mLockedFluid, this.mFluidCapacity, this.mName, this.mDescription, this.mTextures);
}
} \ No newline at end of file
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 ba348f3aab..7c099f49ef 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
@@ -32,7 +32,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Outpu
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_ItemStack;
-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;
@@ -43,6 +42,7 @@ 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.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_MultiMachine;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_Multi_Basic_Slotted;
@@ -62,6 +62,24 @@ public abstract class GregtechMeta_MultiBlockBase
extends
GT_MetaTileEntity_MultiBlockBase {
+
+
+
+ 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);
+ Method a09 = findRecipe09 = ReflectionUtils.getMethod(GT_Recipe_Map.class, "findRecipe", IHasWorldObjectAndCoords.class, GT_Recipe.class, boolean.class, boolean.class, long.class, FluidStack[].class, ItemStack.class, ItemStack[].class);
+ Logger.INFO("Found .08 findRecipe method? "+(a08 != null));
+ Logger.INFO("Found .09 findRecipe method? "+(a09 != null));
+
+ //gregtech.api.util.GT_Recipe.GT_Recipe_Map.findRecipe(IHasWorldObjectAndCoords, GT_Recipe, boolean, long, FluidStack[], ItemStack, ItemStack...)
+
+ }
+
+ //Find Recipe Methods
+ private static final Method findRecipe08;
+ private static final Method findRecipe09;
+
public GT_Recipe mLastRecipe;
private boolean mInternalCircuit = false;
protected long mTotalRunTime = 0;
@@ -329,7 +347,7 @@ GT_MetaTileEntity_MultiBlockBase {
//Control Core to control the Multiblocks behaviour.
int aControlCoreTier = getControlCoreTier();
-
+
//If no core, return false;
if (aControlCoreTier == 0) {
return false;
@@ -350,7 +368,7 @@ GT_MetaTileEntity_MultiBlockBase {
if (tTier > aControlCoreTier) {
return false;
}
-
+
GT_Recipe tRecipe = findRecipe(
getBaseMetaTileEntity(), mLastRecipe, false,
@@ -410,11 +428,11 @@ GT_MetaTileEntity_MultiBlockBase {
this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
-
+
//Only Overclock as high as the control circuit.
byte tTierOld = tTier;
tTier = (byte) aControlCoreTier;
-
+
// Overclock
if (this.mEUt <= 16) {
this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
@@ -713,7 +731,7 @@ GT_MetaTileEntity_MultiBlockBase {
}
return false;
}
-
+
public int getControlCoreTier() {
if (mControlCoreBus.size() == 0) {
return 0;
@@ -1229,17 +1247,34 @@ GT_MetaTileEntity_MultiBlockBase {
catch (Throwable t) {
log("Invalid recipe lookup.");
}
+
+
if (mRecipeResult == null) {
- return this.getRecipeMap().findRecipe(aTileEntity, aRecipe, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids, aSpecialSlot, aInputs);
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ try {
+ return (GT_Recipe) findRecipe08.invoke(getRecipeMap(), aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ return null;
+ }
+ }
+ else {
+ try {
+ return (GT_Recipe) findRecipe09.invoke(getRecipeMap(), aTileEntity, aRecipe, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids, aSpecialSlot, aInputs);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ return null;
+ }
+ }
}
else {
return mRecipeResult;
}
- }
+ }
+
+
/**
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 bef16c0bf7..c1915fb14a 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
@@ -14,7 +14,6 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
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.common.GT_Pollution;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;