aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorTec <daniel112092@gmail.com>2019-10-01 19:28:28 +0200
committerTec <daniel112092@gmail.com>2019-10-01 19:28:28 +0200
commitdcb3b15eb849054ff8809fb78e67439efe7a6c02 (patch)
treed90397faceed17d8a751c704df7b430eacaa38ce /src/main/java
parentd03246bde24eaeb06a18b70797977e3d670981a9 (diff)
downloadGT5-Unofficial-dcb3b15eb849054ff8809fb78e67439efe7a6c02.tar.gz
GT5-Unofficial-dcb3b15eb849054ff8809fb78e67439efe7a6c02.tar.bz2
GT5-Unofficial-dcb3b15eb849054ff8809fb78e67439efe7a6c02.zip
Fix ParamTxt
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/github/technus/tectech/Util.java5
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ParamText.java50
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java20
3 files changed, 15 insertions, 60 deletions
diff --git a/src/main/java/com/github/technus/tectech/Util.java b/src/main/java/com/github/technus/tectech/Util.java
index f73bb30c52..088cbd8c82 100644
--- a/src/main/java/com/github/technus/tectech/Util.java
+++ b/src/main/java/com/github/technus/tectech/Util.java
@@ -37,7 +37,6 @@ import org.apache.commons.lang3.StringUtils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
-import java.io.Serializable;
import java.lang.reflect.Field;
import java.util.*;
import java.util.regex.Matcher;
@@ -454,7 +453,6 @@ public final class Util {
*/
//endregion
-
//Check Machine Structure based on string[][] (effectively char[][][]), ond offset of the controller
//This only checks for REGULAR BLOCKS!
public static boolean StructureCheckerExtreme(
@@ -497,8 +495,7 @@ public final class Util {
if (block < ' ') {//Control chars allow skipping
b -= block;
break;
- } else if (block > '@') //characters allow to skip check A-1 skip, B-2 skips etc.
- {
+ } else if (block > '@') {//characters allow to skip check A-1 skip, B-2 skips etc.
a += block - '@';
}//else if (block < '+')//used to mark THINGS
// a++;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ParamText.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ParamText.java
index 6a93fac487..c9c84cfbc0 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ParamText.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ParamText.java
@@ -1,19 +1,12 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
import com.github.technus.tectech.CommonValues;
-import com.github.technus.tectech.Util;
import com.github.technus.tectech.loader.NetworkDispatcher;
import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_ParamText;
import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_ParamText;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
-import gregtech.api.objects.GT_RenderedTexture;
-import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
@@ -25,32 +18,16 @@ import net.minecraftforge.fluids.FluidStack;
/**
* Created by danie_000 on 15.12.2016.
*/
-public class GT_MetaTileEntity_Hatch_ParamText extends GT_MetaTileEntity_Hatch {
- public int param = -1;
+public class GT_MetaTileEntity_Hatch_ParamText extends GT_MetaTileEntity_Hatch_Param {
public String value0s="";
public String value1s="";
- public double value0D = 0;
- public double value1D = 0;
- public double input0D = 0;
- public double input1D = 0;
- private static Textures.BlockIcons.CustomIcon ScreenON;
- private static Textures.BlockIcons.CustomIcon ScreenOFF;
public GT_MetaTileEntity_Hatch_ParamText(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 0, "For parametrization of Multiblocks");
- Util.setTier(aTier,this);
+ super(aID,aName,aNameRegional,aTier);
}
public GT_MetaTileEntity_Hatch_ParamText(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, 0, aDescription, aTextures);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister aBlockIconRegister) {
- super.registerIcons(aBlockIconRegister);
- ScreenOFF = new Textures.BlockIcons.CustomIcon("iconsets/PARAM");
- ScreenON = new Textures.BlockIcons.CustomIcon("iconsets/PARAM_ACTIVE");
+ super(aName, aTier, aDescription, aTextures);
}
@Override
@@ -66,16 +43,6 @@ public class GT_MetaTileEntity_Hatch_ParamText extends GT_MetaTileEntity_Hatch {
return new GT_GUIContainer_ParamText(aPlayerInventory, aBaseMetaTileEntity);
}
- @Override
- public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(ScreenON)};
- }
-
- @Override
- public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(ScreenOFF)};
- }
-
//@Override
//public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
// if (aBaseMetaTileEntity.isClientSide() && (aTick % 20L == 0L)) {
@@ -131,23 +98,14 @@ public class GT_MetaTileEntity_Hatch_ParamText extends GT_MetaTileEntity_Hatch {
@Override
public void saveNBTData(NBTTagCompound aNBT) {
super.saveNBTData(aNBT);
- aNBT.setDouble("eValue0D", value0D);
- aNBT.setDouble("eValue1D", value1D);
- aNBT.setDouble("eInput0D", input0D);
- aNBT.setDouble("eInput1D", input1D);
- aNBT.setInteger("eParam", param);
aNBT.setString("eIeValue0S", value0s);
aNBT.setString("eIeValue1S", value1s);
+ aNBT.removeTag("ePointer");
}
@Override
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
- value0D = aNBT.getDouble("eValue0D");
- value1D = aNBT.getDouble("eValue1D");
- input0D = aNBT.getDouble("eInput0D");
- input1D = aNBT.getDouble("eInput1D");
- param = aNBT.getInteger("eParam");
value0s = aNBT.getString("eIeValue0S");
if (value0s==null){
value0s="";
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java
index ee21f81e06..edb581179e 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java
@@ -108,6 +108,15 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB
}
@Override
+ protected void parametersInstantiation_EM() {
+ Parameters.Group hatch_0 = parametrization.getGroup(0);
+ overclock = hatch_0.makeInParameter(0, 1, OC_NAME, OC_STATUS);
+ overvolt = hatch_0.makeInParameter(1, 1, OV_NAME, OV_STATUS);
+ maxCurrentTemp = hatch_0.makeOutParameter(0, 0, MAX_TEMP_NAME, MAX_TEMP_STATUS);
+ availableData = hatch_0.makeOutParameter(1, 0, COMPUTE_NAME, COMPUTE_STATUS);
+ }
+
+ @Override
public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
for (GT_MetaTileEntity_Hatch_Rack rack : eRacks) {
if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) {
@@ -278,15 +287,6 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB
}
@Override
- protected void parametersInstantiation_EM() {
- Parameters.Group hatch_0 = parametrization.getGroup(0);
- overclock = hatch_0.makeInParameter(0, 1, OC_NAME, OC_STATUS);
- overvolt = hatch_0.makeInParameter(1, 1, OV_NAME, OV_STATUS);
- maxCurrentTemp = hatch_0.makeOutParameter(0, 0, MAX_TEMP_NAME, MAX_TEMP_STATUS);
- availableData = hatch_0.makeOutParameter(1, 0, COMPUTE_NAME, COMPUTE_STATUS);
- }
-
- @Override
protected void extraExplosions_EM() {
for (MetaTileEntity tTileEntity : eRacks) {
tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]);
@@ -341,7 +341,7 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB
StructureBuilderExtreme(cap, blockType, blockMeta, 1, 2, -1, igt, this, hintsOnly);
byte offset = -2;
- for (int rackSlices = stackSize > 12 ? 12 : stackSize; rackSlices > 0; rackSlices--) {
+ for (int rackSlices = Math.min(stackSize, 12); rackSlices > 0; rackSlices--) {
StructureBuilderExtreme(slice, blockType, blockMeta, 1, 2, offset--, igt, this, hintsOnly);
}