aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2019-02-28 20:06:01 +0000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2019-02-28 20:06:01 +0000
commit4f435ae75b176a9d90c7afa6b1ff40e9ba9c286a (patch)
treef9707c4551b6134030374580cacfd1aec4b0c9d7 /src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity
parent1c20e21e7678f9a546fff9bf873c80c35a841cf8 (diff)
downloadGT5-Unofficial-4f435ae75b176a9d90c7afa6b1ff40e9ba9c286a.tar.gz
GT5-Unofficial-4f435ae75b176a9d90c7afa6b1ff40e9ba9c286a.tar.bz2
GT5-Unofficial-4f435ae75b176a9d90c7afa6b1ff40e9ba9c286a.zip
+ Added a new debug tool.
+ Added support for Crops++. + Added Custom Crops & framework to support more in future. + Added basic support for all GT++ Materials within Tinkers Construct. [WIP] + Moderately bad attempt at generating custom Plasma Cooling recipes in the Adv. Vacuum Freezer. [WIP #424] % Reworked logic for Material.java handling Durability, Tool Quality & Harvest Level. % Adjusted frequency of structural checks on the Cyclotron, Now 100x less frequent. % Cleaned up ReflectionUtils.java and made all getters cache their results, for much faster access. % Attempted to adjust logic of FFPP, but I probably broke it. [WIP] % Moved static array of Element Names from IonParticles.java -> ELEMENT.java. $ Greatly improved reflective performance across the mod.
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.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java10
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java18
3 files changed, 12 insertions, 18 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 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 30c1bc2b29..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
@@ -50,11 +50,9 @@ public class GT_MetaTileEntity_Hatch_Plasma extends GT_MetaTileEntity_Hatch_Outp
//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 {
@@ -199,7 +197,7 @@ public class GT_MetaTileEntity_Hatch_Plasma extends GT_MetaTileEntity_Hatch_Outp
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/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
index b55157e763..7103c81980 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
@@ -482,9 +482,9 @@ GT_MetaTileEntity_MultiBlockBase {
public void log(String s) {
boolean isDebugLogging = CORE.DEBUG;
- boolean reset = false;
+ boolean reset = true;
if (aLogger == null || reset) {
- if (isDebugLogging) {
+ if (true) {
try {
aLogger = Logger.class.getMethod("INFO", String.class);
} catch (NoSuchMethodException | SecurityException e) {}
@@ -1141,7 +1141,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;
@@ -1173,7 +1174,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) {
@@ -1194,7 +1194,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);
@@ -1202,7 +1202,6 @@ GT_MetaTileEntity_MultiBlockBase {
log("Good Method Call for updateTexture.");
return true;
}
-
}
else {
log("Bad Method Call for updateTexture.");
@@ -1223,7 +1222,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();
@@ -1277,15 +1276,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;
}