aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAlexdoru <57050655+Alexdoru@users.noreply.github.com>2024-09-17 01:46:30 +0200
committerboubou19 <miisterunknown@gmail.com>2024-09-17 22:55:46 +0200
commitc999c4c8175713713994169dbcd3f2cf64189a37 (patch)
treeda55415b7bc2ac64057f7fa0200dcc94ae4c6eb6 /src/main
parentfba2d98e733d02caef585bed6910894ed5abf375 (diff)
downloadGT5-Unofficial-c999c4c8175713713994169dbcd3f2cf64189a37.tar.gz
GT5-Unofficial-c999c4c8175713713994169dbcd3f2cf64189a37.tar.bz2
GT5-Unofficial-c999c4c8175713713994169dbcd3f2cf64189a37.zip
remove reflection from MTEAdvFusionMk4 and MTEAdvFusionMk5
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvFusionMk4.java36
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvFusionMk5.java36
2 files changed, 22 insertions, 50 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvFusionMk4.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvFusionMk4.java
index eed5159271..7c2735c6e1 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvFusionMk4.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvFusionMk4.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced;
-import java.lang.reflect.Method;
-
import net.minecraft.block.Block;
import net.minecraftforge.common.util.ForgeDirection;
@@ -13,7 +11,6 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.logic.ProcessingLogic;
import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.MTEHatch;
import gregtech.api.metatileentity.implementations.MTEHatchEnergy;
import gregtech.api.metatileentity.implementations.MTEHatchInput;
import gregtech.api.metatileentity.implementations.MTEHatchOutput;
@@ -25,17 +22,10 @@ import gregtech.api.util.MultiblockTooltipBuilder;
import gregtech.common.tileentities.machines.multi.MTEFusionComputer;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.lib.GTPPCore;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
public class MTEAdvFusionMk4 extends MTEFusionComputer {
- public static final Method mUpdateHatchTexture;
-
- static {
- mUpdateHatchTexture = ReflectionUtils.getMethod(MTEHatch.class, "updateTexture", int.class);
- }
-
public MTEAdvFusionMk4(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
@@ -160,24 +150,20 @@ public class MTEAdvFusionMk4 extends MTEFusionComputer {
@Override
public boolean turnCasingActive(final boolean status) {
- try {
- if (this.mEnergyHatches != null) {
- for (final MTEHatchEnergy hatch : this.mEnergyHatches) {
- mUpdateHatchTexture.invoke(hatch, (status ? TAE.getIndexFromPage(2, 14) : 53));
- }
+ if (this.mEnergyHatches != null) {
+ for (final MTEHatchEnergy hatch : this.mEnergyHatches) {
+ hatch.updateTexture((status ? TAE.getIndexFromPage(2, 14) : 53));
}
- if (this.mOutputHatches != null) {
- for (final MTEHatchOutput hatch2 : this.mOutputHatches) {
- mUpdateHatchTexture.invoke(hatch2, (status ? TAE.getIndexFromPage(2, 14) : 53));
- }
+ }
+ if (this.mOutputHatches != null) {
+ for (final MTEHatchOutput hatch : this.mOutputHatches) {
+ hatch.updateTexture(status ? TAE.getIndexFromPage(2, 14) : 53);
}
- if (this.mInputHatches != null) {
- for (final MTEHatchInput hatch3 : this.mInputHatches) {
- mUpdateHatchTexture.invoke(hatch3, (status ? TAE.getIndexFromPage(2, 14) : 53));
- }
+ }
+ if (this.mInputHatches != null) {
+ for (final MTEHatchInput hatch : this.mInputHatches) {
+ hatch.updateTexture(status ? TAE.getIndexFromPage(2, 14) : 53);
}
- } catch (Throwable t) {
- return false;
}
return true;
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvFusionMk5.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvFusionMk5.java
index 9ed65ffa08..52928268cf 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvFusionMk5.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvFusionMk5.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced;
-import java.lang.reflect.Method;
-
import net.minecraft.block.Block;
import net.minecraftforge.common.util.ForgeDirection;
@@ -13,7 +11,6 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.logic.ProcessingLogic;
import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.MTEHatch;
import gregtech.api.metatileentity.implementations.MTEHatchEnergy;
import gregtech.api.metatileentity.implementations.MTEHatchInput;
import gregtech.api.metatileentity.implementations.MTEHatchOutput;
@@ -25,17 +22,10 @@ import gregtech.api.util.MultiblockTooltipBuilder;
import gregtech.common.tileentities.machines.multi.MTEFusionComputer;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.lib.GTPPCore;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
public class MTEAdvFusionMk5 extends MTEFusionComputer {
- public static final Method mUpdateHatchTexture;
-
- static {
- mUpdateHatchTexture = ReflectionUtils.getMethod(MTEHatch.class, "updateTexture", int.class);
- }
-
public MTEAdvFusionMk5(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
@@ -160,24 +150,20 @@ public class MTEAdvFusionMk5 extends MTEFusionComputer {
@Override
public boolean turnCasingActive(final boolean status) {
- try {
- if (this.mEnergyHatches != null) {
- for (final MTEHatchEnergy hatch : this.mEnergyHatches) {
- mUpdateHatchTexture.invoke(hatch, (status ? TAE.getIndexFromPage(3, 6) : 53));
- }
+ if (this.mEnergyHatches != null) {
+ for (final MTEHatchEnergy hatch : this.mEnergyHatches) {
+ hatch.updateTexture(status ? TAE.getIndexFromPage(3, 6) : 53);
}
- if (this.mOutputHatches != null) {
- for (final MTEHatchOutput hatch2 : this.mOutputHatches) {
- mUpdateHatchTexture.invoke(hatch2, (status ? TAE.getIndexFromPage(3, 6) : 53));
- }
+ }
+ if (this.mOutputHatches != null) {
+ for (final MTEHatchOutput hatch : this.mOutputHatches) {
+ hatch.updateTexture(status ? TAE.getIndexFromPage(3, 6) : 53);
}
- if (this.mInputHatches != null) {
- for (final MTEHatchInput hatch3 : this.mInputHatches) {
- mUpdateHatchTexture.invoke(hatch3, (status ? TAE.getIndexFromPage(3, 6) : 53));
- }
+ }
+ if (this.mInputHatches != null) {
+ for (final MTEHatchInput hatch : this.mInputHatches) {
+ hatch.updateTexture(status ? TAE.getIndexFromPage(3, 6) : 53);
}
- } catch (Throwable t) {
- return false;
}
return true;
}