aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity
diff options
context:
space:
mode:
authormiozune <miozune@gmail.com>2023-05-30 18:51:40 +0900
committerGitHub <noreply@github.com>2023-05-30 11:51:40 +0200
commita233067dc677cac0f1ac52829cf8446e51d4ca43 (patch)
tree5147718d8d7640fbb40e75018fb8673c94edd615 /src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity
parentfcaa54247a8d23455bc754434902506904c60df6 (diff)
downloadGT5-Unofficial-a233067dc677cac0f1ac52829cf8446e51d4ca43.tar.gz
GT5-Unofficial-a233067dc677cac0f1ac52829cf8446e51d4ca43.tar.bz2
GT5-Unofficial-a233067dc677cac0f1ac52829cf8446e51d4ca43.zip
Cleanup reservoir hatch tooltip (#644)
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity')
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java53
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java6
2 files changed, 11 insertions, 48 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java
index 34eb5ccf16..80939fd49d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
-import java.lang.reflect.Field;
-
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -17,11 +15,10 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
import gregtech.api.objects.GT_RenderedTexture;
-import gtPlusPlus.api.objects.Logger;
+import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.random.XSTR;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.FluidUtils;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
public abstract class GT_MetaTileEntity_Hatch_FluidGenerator extends GT_MetaTileEntity_Hatch_Input {
@@ -38,9 +35,6 @@ public abstract class GT_MetaTileEntity_Hatch_FluidGenerator extends GT_MetaTile
super(aName, aTier, aDescription, aTextures);
}
- private static String[] S;
- private static Field F;
-
public abstract String[] getCustomTooltip();
public abstract Fluid getFluidToGenerate();
@@ -51,44 +45,13 @@ public abstract class GT_MetaTileEntity_Hatch_FluidGenerator extends GT_MetaTile
@Override
public synchronized String[] getDescription() {
- try {
- if (F == null || S == null) {
- Field t = ReflectionUtils.getField(this.getClass(), "mDescriptionArray");
- if (t != null) {
- F = t;
- } else {
- F = ReflectionUtils.getField(this.getClass(), "mDescription");
- }
- if (S == null && F != null) {
- Object o = F.get(this);
- if (o instanceof String[]) {
- S = (String[]) o;
- } else if (o instanceof String) {
- S = new String[] { (String) o };
- }
- }
- }
- } catch (Throwable t) {
- Logger.INFO("1");
- t.printStackTrace();
- }
- try {
- if (S != null) {
- String[] aCustomTips = getCustomTooltip();
- final String[] desc = new String[S.length + aCustomTips.length + 1];
- System.arraycopy(S, 0, desc, 0, S.length);
- for (int i = 0; i < aCustomTips.length; i++) {
- desc[S.length + i] = aCustomTips[i];
- }
- desc[S.length + aCustomTips.length] = CORE.GT_Tooltip.get();
- return desc;
- }
- } catch (Throwable t) {
- Logger.INFO("2");
- t.printStackTrace();
- }
-
- return new String[] { "Broken Tooltip - Report on Github" };
+ mDescriptionArray[1] = "Capacity: " + GT_Utility.formatNumbers(getCapacity()) + "L";
+ String[] aCustomTips = getCustomTooltip();
+ final String[] desc = new String[mDescriptionArray.length + aCustomTips.length + 1];
+ System.arraycopy(mDescriptionArray, 0, desc, 0, mDescriptionArray.length);
+ System.arraycopy(aCustomTips, 0, desc, mDescriptionArray.length, aCustomTips.length);
+ desc[mDescriptionArray.length + aCustomTips.length] = CORE.GT_Tooltip.get();
+ return desc;
}
@Override
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java
index 2e16d7783e..6945e4928d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java
@@ -30,7 +30,7 @@ public class GT_MetaTileEntity_Hatch_Reservoir extends GT_MetaTileEntity_Hatch_F
@Override
public String[] getCustomTooltip() {
String[] aTooltip = new String[2];
- aTooltip[0] = "Infinite water supply hatch with 100ML capacity";
+ aTooltip[0] = "Infinite water supply hatch";
aTooltip[1] = "Fills to max capacity every 5 seconds";
return aTooltip;
}
@@ -42,7 +42,7 @@ public class GT_MetaTileEntity_Hatch_Reservoir extends GT_MetaTileEntity_Hatch_F
@Override
public int getAmountOfFluidToGenerate() {
- return 1000000000;
+ return 2_000_000_000;
}
@Override
@@ -52,7 +52,7 @@ public class GT_MetaTileEntity_Hatch_Reservoir extends GT_MetaTileEntity_Hatch_F
@Override
public int getCapacity() {
- return 2000000000;
+ return 2_000_000_000;
}
@Override