aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTec <daniel112092@gmail.com>2018-03-16 23:27:32 +0100
committerTec <daniel112092@gmail.com>2018-03-16 23:27:32 +0100
commit8e64ebc4b26ca0e8981d2aeaf0b5c3d00617447c (patch)
treea951fa9c7691c97e8a549385f6d92a6c19abf81b
parent5c9f4ad7dae628462d3b9978776e0df92bc6845d (diff)
downloadGT5-Unofficial-8e64ebc4b26ca0e8981d2aeaf0b5c3d00617447c.tar.gz
GT5-Unofficial-8e64ebc4b26ca0e8981d2aeaf0b5c3d00617447c.tar.bz2
GT5-Unofficial-8e64ebc4b26ca0e8981d2aeaf0b5c3d00617447c.zip
add led tooltip api
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java10
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java106
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java30
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Electrolyzer.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_PrecisionLaser.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Scanner.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java61
10 files changed, 192 insertions, 27 deletions
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java
index a1e11e8ff4..208c890cd4 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java
@@ -40,8 +40,6 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase
private static final double URANIUM_INGOT_MASS_DIFF = 1.6114516E10;
private static final double MASS_TO_EU=ConfigUtil.getFloat(MainConfig.get(), "balance/energy/generator/nuclear")*800000.0/URANIUM_INGOT_MASS_DIFF;//*20
- private float temp=0;
-
//region structure
private static final String[][] shape = new String[][]{
{"0C0","A ","A . ","A ","0C0",},
@@ -130,7 +128,7 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase
return startRecipe(map);
}else if(eSafeVoid){
contents.clear();
- temp=0;
+ mEUt=0;
}else if(contents.hasStacks()){
return startRecipe(null);
}
@@ -163,9 +161,9 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase
contents.tickContent(1,0,1);
- System.out.println("MASS DIFF = " +((mass-contents.getMass())*MASS_TO_EU));
- temp+=(mass-contents.getMass())*MASS_TO_EU;
- System.out.println("TOTAL = " +temp);
+ mEUt=(int)((mass-contents.getMass())*MASS_TO_EU);
+ System.out.println("EUt = " +mEUt);
+ if(mEUt<0) mEUt=0;
//todo move not actually decaying crap, beware of energy using decays?
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java
index 0992601f6d..8c9dab2c2e 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java
@@ -1,9 +1,14 @@
package com.github.technus.tectech.thing.metaTileEntity.multi.base;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.client.gui.FontRenderer;
import net.minecraft.entity.player.InventoryPlayer;
import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+import java.util.List;
import static com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM.*;
import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
@@ -13,9 +18,9 @@ import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
*/
public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Machine {
- String mName = "";
+ private String mName;
private static byte counter = 0;
- public final boolean ePowerPassButton, eSafeVoidButton, allowedToWorkButton;
+ private final boolean ePowerPassButton, eSafeVoidButton, allowedToWorkButton;
public GT_GUIContainer_MultiMachineEM(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile, boolean enablePowerPass, boolean enableSafeVoid, boolean enablePowerButton) {
super(new GT_Container_MultiMachineEM(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "multimachines/" + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
@@ -73,6 +78,10 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach
fontRendererObj.drawString("Running perfectly.", 10, -10, 16448255);
}
}
+
+ int x = (width - xSize) / 2;
+ int y = (height - ySize) / 2;
+ LEDtooltips(par1-x, par2-y+26);
}
}
@@ -214,4 +223,97 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach
break;
}
}
+
+ private void LEDtooltips(float x,float y){
+ //drawHoveringText(Arrays.asList(""+x,""+y), -1, -11, fontRendererObj);
+ if(mContainer.mTileEntity!=null){
+ IMetaTileEntity mte=mContainer.mTileEntity.getMetaTileEntity();
+ if(mte instanceof GT_MetaTileEntity_MultiblockBase_EM){
+ int su = 8, sv = 6, u=11,v=96;
+ if(x<u || y<v) return;
+ v+=sv;
+ for(int hatch=0;hatch<10;hatch++){
+ for(int param=0;param<2;param++){
+ if(x<(u+=su)){
+ if(y<v){
+ hoveringText(((GT_MetaTileEntity_MultiblockBase_EM) mte).getFullLedDescriptionIn(hatch,param), u-su-1, v-11, fontRendererObj);
+ return;
+ }else if(y>=v && y<v+sv){
+ hoveringText(((GT_MetaTileEntity_MultiblockBase_EM) mte).getFullLedDescriptionOut(hatch,param), u-su-1, v+sv-11, fontRendererObj);
+ return;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private void hoveringText(List strings, int x, int y, FontRenderer font) {
+ if (!strings.isEmpty()) {
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ //RenderHelper.disableStandardItemLighting();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glDisable(GL11.GL_DEPTH_TEST);
+ int k = 0;
+
+ for (Object aP_146283_1_ : strings) {
+ String s = (String) aP_146283_1_;
+ int l = font.getStringWidth(s);
+
+ if (l > k) {
+ k = l;
+ }
+ }
+
+ int x2 = x + 12;
+ int y2 = y - 12;
+ int i1 = 8;
+
+ if (strings.size() > 1) {
+ i1 += 2 + (strings.size() - 1) * 10;
+ }
+
+ if (x2 + k > this.width) {
+ x2 -= 28 + k;
+ }
+
+ if (y2 + i1 + 6 > this.height) {
+ y2 = this.height - i1 - 6;
+ }
+
+ //this.zLevel = 300.0F;
+ //itemRender.zLevel = 300.0F;
+ int j1 = 0xf0001040;//bg
+ this.drawGradientRect(x2 - 3, y2 - 4, x2 + k + 3, y2 - 3, j1, j1);
+ this.drawGradientRect(x2 - 3, y2 + i1 + 3, x2 + k + 3, y2 + i1 + 4, j1, j1);
+ this.drawGradientRect(x2 - 3, y2 - 3, x2 + k + 3, y2 + i1 + 3, j1, j1);
+ this.drawGradientRect(x2 - 4, y2 - 3, x2 - 3, y2 + i1 + 3, j1, j1);
+ this.drawGradientRect(x2 + k + 3, y2 - 3, x2 + k + 4, y2 + i1 + 3, j1, j1);
+ int k1 = 0x500040ff;//border bright
+ int l1 = (k1 & 0xfefefe) >> 1 | k1 & 0xff000000;//border dark???
+ this.drawGradientRect(x2 - 3, y2 - 3 + 1, x2 - 3 + 1, y2 + i1 + 3 - 1, k1, l1);
+ this.drawGradientRect(x2 + k + 2, y2 - 3 + 1, x2 + k + 3, y2 + i1 + 3 - 1, k1, l1);
+ this.drawGradientRect(x2 - 3, y2 - 3, x2 + k + 3, y2 - 3 + 1, k1, k1);
+ this.drawGradientRect(x2 - 3, y2 + i1 + 2, x2 + k + 3, y2 + i1 + 3, l1, l1);
+
+ for (int i2 = 0; i2 < strings.size(); ++i2) {
+ String s1 = (String) strings.get(i2);
+ font.drawStringWithShadow(s1, x2, y2, -1);
+
+ if (i2 == 0) {
+ y2 += 2;
+ }
+
+ y2 += 10;
+ }
+
+ //this.zLevel = 0.0F;
+ //itemRender.zLevel = 0.0F;
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+ //RenderHelper.enableStandardItemLighting();
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ }
+ }
} \ No newline at end of file
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java
index b7b61e3cb8..1c208f704e 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java
@@ -9,9 +9,9 @@ import com.github.technus.tectech.elementalMatter.core.stacks.cElementalInstance
import com.github.technus.tectech.elementalMatter.core.tElementalException;
import com.github.technus.tectech.thing.metaTileEntity.IFrontRotation;
import com.github.technus.tectech.thing.metaTileEntity.hatch.*;
-import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.RotationMessage;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.RotationPacketDispatcher;
+import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -37,9 +37,7 @@ import net.minecraftforge.fluids.FluidStack;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.*;
import static com.github.technus.tectech.CommonValues.*;
import static com.github.technus.tectech.Util.*;
@@ -448,6 +446,30 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
//region tooltip and scanner result
/**
+ *
+ * @param hatchNo
+ * @param paramID
+ * @return
+ */
+ public ArrayList<String> getFullLedDescriptionIn(int hatchNo, int paramID){
+ ArrayList<String> list=new ArrayList<>();
+ list.add("ID" + hatchNo + ":" + paramID + ":I");
+ return list;
+ }
+
+ /**
+ *
+ * @param hatchNo
+ * @param paramID
+ * @return
+ */
+ public ArrayList<String> getFullLedDescriptionOut(int hatchNo, int paramID){
+ ArrayList<String> list=new ArrayList<>();
+ list.add("ID" + hatchNo + ":" + paramID + ":O");
+ return list;
+ }
+
+ /**
* TOOLTIP
* @return strings in tooltip
*/
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java
index fe40178e88..1c4a1381be 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java
@@ -16,7 +16,7 @@ import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE;
/**
* Created by danie_000 on 24.12.2017.
*/
-public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behaviour {
+public class Behaviour_Centrifuge extends GT_MetaTileEntity_EM_machine.Behaviour {
private final float radius, maxRPM, maxRCF, maxForce, maxCapacity;
private final byte tier;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Electrolyzer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Electrolyzer.java
index 236b79c85b..cf3282b117 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Electrolyzer.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Electrolyzer.java
@@ -6,7 +6,7 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockCont
/**
* Created by danie_000 on 24.12.2017.
*/
-public class Behaviour_Electrolyzer implements GT_MetaTileEntity_EM_machine.Behaviour {
+public class Behaviour_Electrolyzer extends GT_MetaTileEntity_EM_machine.Behaviour {
final int tier;
public Behaviour_Electrolyzer(int tier){
this.tier=tier;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java
index 1d28db92c8..662d674c64 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java
@@ -12,7 +12,7 @@ import static com.github.technus.tectech.Util.V;
/**
* Created by danie_000 on 24.12.2017.
*/
-public class Behaviour_ElectromagneticSeparator implements GT_MetaTileEntity_EM_machine.Behaviour {
+public class Behaviour_ElectromagneticSeparator extends GT_MetaTileEntity_EM_machine.Behaviour {
private final byte tier;
private final int ticks;
private final byte precisionFull;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_PrecisionLaser.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_PrecisionLaser.java
index 1cca03ec17..efe84e10ec 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_PrecisionLaser.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_PrecisionLaser.java
@@ -6,7 +6,7 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockCont
/**
* Created by danie_000 on 24.12.2017.
*/
-public class Behaviour_PrecisionLaser implements GT_MetaTileEntity_EM_machine.Behaviour {
+public class Behaviour_PrecisionLaser extends GT_MetaTileEntity_EM_machine.Behaviour {
final int tier;
public Behaviour_PrecisionLaser(int tier){
this.tier=tier;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java
index 09249a3d95..49b598cbc2 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java
@@ -6,7 +6,7 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockCont
/**
* Created by danie_000 on 24.12.2017.
*/
-public class Behaviour_Recycler implements GT_MetaTileEntity_EM_machine.Behaviour {
+public class Behaviour_Recycler extends GT_MetaTileEntity_EM_machine.Behaviour {
final int tier;
public Behaviour_Recycler(int tier){
this.tier=tier;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Scanner.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Scanner.java
index 020a71da5c..aff35cd7fa 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Scanner.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Scanner.java
@@ -6,7 +6,7 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockCont
/**
* Created by danie_000 on 24.12.2017.
*/
-public class Behaviour_Scanner implements GT_MetaTileEntity_EM_machine.Behaviour {
+public class Behaviour_Scanner extends GT_MetaTileEntity_EM_machine.Behaviour {
final int tier;
public Behaviour_Scanner(int tier){
this.tier=tier;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java
index e97f3a00b4..eb8b7f2a90 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java
@@ -18,6 +18,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.util.ForgeDirection;
+import java.util.ArrayList;
import java.util.BitSet;
import java.util.HashMap;
@@ -32,6 +33,8 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa
public static final String machine = "EM Machinery";
+ private Behaviour currentBehaviour;
+
//region structure
private static final String[][] shape = new String[][]{
{"B0", "A ", "0 - 0", "A ", "B0",},
@@ -95,11 +98,27 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa
@Override
public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if(aBaseMetaTileEntity.isActive() && (aTick & 0x2)==0 && aBaseMetaTileEntity.isClientSide()){
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX*2+aBaseMetaTileEntity.getXCoord();
- int yDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY*2+aBaseMetaTileEntity.getYCoord();
- int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ*2+aBaseMetaTileEntity.getZCoord();
- aBaseMetaTileEntity.getWorld().markBlockRangeForRenderUpdate(xDir,yDir,zDir,xDir,yDir,zDir);
+ if(aBaseMetaTileEntity.isClientSide() && (aTick & 0x2)==0){
+ currentBehaviour = GT_MetaTileEntity_EM_machine.map.get(new Util.TT_ItemStack(mInventory[1]));
+ if(aBaseMetaTileEntity.isActive()){
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX*2+aBaseMetaTileEntity.getXCoord();
+ int yDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY*2+aBaseMetaTileEntity.getYCoord();
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ*2+aBaseMetaTileEntity.getZCoord();
+ aBaseMetaTileEntity.getWorld().markBlockRangeForRenderUpdate(xDir,yDir,zDir,xDir,yDir,zDir);
+ }
+ }
+ if(aBaseMetaTileEntity.isServerSide() && (aTick & 0xf)==0){
+ currentBehaviour = GT_MetaTileEntity_EM_machine.map.get(new Util.TT_ItemStack(mInventory[1]));
+ if (currentBehaviour == null) {
+ setStatusOfParameterIn(0,0,GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED);
+ setStatusOfParameterIn(0,1,GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED);
+ setStatusOfParameterIn(1,0,GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED);
+ setStatusOfParameterIn(1,1,GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED);
+ setStatusOfParameterIn(2,0,GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED);
+ setStatusOfParameterIn(2,1,GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED);
+ setStatusOfParameterIn(3,0,GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED);
+ setStatusOfParameterIn(3,1,GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED);
+ }
}
}
@@ -111,7 +130,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa
@Override
public boolean checkRecipe_EM(ItemStack itemStack) {
- Behaviour currentBehaviour = GT_MetaTileEntity_EM_machine.map.get(new Util.TT_ItemStack(itemStack));
+ currentBehaviour = GT_MetaTileEntity_EM_machine.map.get(new Util.TT_ItemStack(itemStack));
//TecTech.Logger.info("Looking for "+new Util.TT_ItemStack(itemStack).toString());
if (currentBehaviour == null) {
setStatusOfParameterIn(0,0,GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED);
@@ -328,10 +347,34 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa
TecTech.Logger.info("Registered EM machine behaviour "+behaviour.getClass().getSimpleName()+' '+new Util.TT_ItemStack(is).toString());
}
- public interface Behaviour {
- boolean setAndCheckParametersOutAndStatuses(GT_MetaTileEntity_EM_machine te, double[] parametersToCheckAndFix);
+ public static abstract class Behaviour {
+ public Behaviour(){}
- MultiblockControl<cElementalInstanceStackMap[]> process(cElementalInstanceStackMap[] inputs, double[] checkedAndFixedParameters);
+ public abstract boolean setAndCheckParametersOutAndStatuses(GT_MetaTileEntity_EM_machine te, double[] parametersToCheckAndFix);
+
+ public abstract MultiblockControl<cElementalInstanceStackMap[]> process(cElementalInstanceStackMap[] inputs, double[] checkedAndFixedParameters);
+
+ protected void getFullLedDescriptionIn(ArrayList<String> baseDescr, int hatchNo, int paramID){}
+
+ protected void getFullLedDescriptionOut(ArrayList<String> baseDescr, int hatchNo, int paramID){}
+ }
+
+ @Override
+ public ArrayList<String> getFullLedDescriptionIn(int hatchNo, int paramID) {
+ ArrayList<String> base=super.getFullLedDescriptionIn(hatchNo, paramID);
+ if(currentBehaviour!=null){
+ currentBehaviour.getFullLedDescriptionIn(base,hatchNo,paramID);
+ }
+ return base;
+ }
+
+ @Override
+ public ArrayList<String> getFullLedDescriptionOut(int hatchNo, int paramID) {
+ ArrayList<String> base=super.getFullLedDescriptionOut(hatchNo, paramID);
+ if(currentBehaviour!=null){
+ currentBehaviour.getFullLedDescriptionOut(base,hatchNo,paramID);
+ }
+ return base;
}
private void quantumStuff(boolean shouldExist){