diff options
| author | Technus <daniel112092@gmail.com> | 2017-12-24 07:43:10 +0100 |
|---|---|---|
| committer | Technus <daniel112092@gmail.com> | 2017-12-24 07:43:10 +0100 |
| commit | 7095b1d12cd9cb58086d3ea1ec352bb1f01cc557 (patch) | |
| tree | 266c67c406b6b9129364f2bd15f612fafc518e9c | |
| parent | a428d6f99e99499f20f380d5cc650261e5b4e30e (diff) | |
| download | GT5-Unofficial-7095b1d12cd9cb58086d3ea1ec352bb1f01cc557.tar.gz GT5-Unofficial-7095b1d12cd9cb58086d3ea1ec352bb1f01cc557.tar.bz2 GT5-Unofficial-7095b1d12cd9cb58086d3ea1ec352bb1f01cc557.zip | |
Backbone of EM machine
22 files changed, 304 insertions, 93 deletions
diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index 7bf0b43cb6..78eb0746c3 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -407,5 +407,11 @@ public class DreamCraftRecipeLoader implements Runnable { new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), }, CustomItemList.Machine_Multi_Infuser.get(1), 8000, 2000000); //endregion + + register_machine_EM_behaviours(); + } + + private void register_machine_EM_behaviours(){ + } } diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/dComplexAspectDefinition.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/dComplexAspectDefinition.java index 31158572a8..3084abb1f2 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/dComplexAspectDefinition.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/dComplexAspectDefinition.java @@ -242,7 +242,7 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme //lines.add("SYMBOL = "+getSymbol()); } if(Util.areBitsSet(SCAN_GET_CHARGE,capabilities)) - lines.add("CHARGE = "+getCharge()/3f+" eV"); + lines.add("CHARGE = "+getCharge()/3f+" e"); if(Util.areBitsSet(SCAN_GET_COLOR,capabilities)) lines.add(getColor()<0?"COLORLESS":"CARRIES COLOR"); if(Util.areBitsSet(SCAN_GET_MASS,capabilities)) diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/cElementalPrimitive.java b/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/cElementalPrimitive.java index d0b99dba1d..724181e4f7 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/cElementalPrimitive.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/cElementalPrimitive.java @@ -187,7 +187,7 @@ public abstract class cElementalPrimitive extends cElementalDefinition { lines.add("SYMBOL = "+getSymbol()); } if(Util.areBitsSet(SCAN_GET_CHARGE,capabilities)) - lines.add("CHARGE = "+getCharge()/3f+" eV"); + lines.add("CHARGE = "+getCharge()/3f+" e"); if(Util.areBitsSet(SCAN_GET_COLOR,capabilities)) lines.add(getColor()<0?"COLORLESS":"CARRIES COLOR"); if(Util.areBitsSet(SCAN_GET_MASS,capabilities)) diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/atom/dAtomDefinition.java b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/atom/dAtomDefinition.java index a54986073c..6b929d66ce 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/atom/dAtomDefinition.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/atom/dAtomDefinition.java @@ -1424,7 +1424,7 @@ public final class dAtomDefinition extends cElementalDefinition { lines.add("SYMBOL = "+getSymbol()); } if(Util.areBitsSet(SCAN_GET_CHARGE,capabilities)) - lines.add("CHARGE = "+getCharge()/3f+" eV"); + lines.add("CHARGE = "+getCharge()/3f+" e"); if(Util.areBitsSet(SCAN_GET_COLOR,capabilities)) lines.add(getColor()<0?"COLORLESS":"CARRIES COLOR"); if(Util.areBitsSet(SCAN_GET_MASS,capabilities)) diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/hadron/dHadronDefinition.java b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/hadron/dHadronDefinition.java index 55c2e7ccf9..8c7f8deb30 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/hadron/dHadronDefinition.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/hadron/dHadronDefinition.java @@ -403,7 +403,7 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi //lines.add("SYMBOL = "+getSymbol()); } if(Util.areBitsSet(SCAN_GET_CHARGE,capabilities)) - lines.add("CHARGE = "+getCharge()/3f+" eV"); + lines.add("CHARGE = "+getCharge()/3f+" e"); if(Util.areBitsSet(SCAN_GET_COLOR,capabilities)) lines.add(getColor()<0?"COLORLESS":"CARRIES COLOR"); if(Util.areBitsSet(SCAN_GET_MASS,capabilities)) diff --git a/src/main/java/com/github/technus/tectech/loader/BloodyRecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/BloodyRecipeLoader.java index 52c584d788..37e7cc41df 100644 --- a/src/main/java/com/github/technus/tectech/loader/BloodyRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/BloodyRecipeLoader.java @@ -355,5 +355,11 @@ public class BloodyRecipeLoader implements Runnable { Materials.Osmiridium.getMolten(1296), }, CustomItemList.Machine_Multi_Scanner.get(1), 24000, 500000); //endregion + + register_machine_EM_behaviours(); + } + + private void register_machine_EM_behaviours(){ + } } diff --git a/src/main/java/com/github/technus/tectech/loader/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/MachineLoader.java index ef77bb2111..787096e6b6 100644 --- a/src/main/java/com/github/technus/tectech/loader/MachineLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/MachineLoader.java @@ -5,6 +5,7 @@ import com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity. import com.github.technus.tectech.thing.metaTileEntity.hatch.*; import com.github.technus.tectech.thing.metaTileEntity.multi.*; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.GT_MetaTileEntity_EM_machine; import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Data; import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_EM; import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_DebugPowerGenerator; @@ -65,22 +66,22 @@ public class MachineLoader implements Runnable { // eM Waste OUT // =================================================================================================== - eM_muffler_UV.set(new GT_MetaTileEntity_Hatch_MufflerElemental( + eM_muffler_UV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( 15020, "hatch.emmuffler.tier.08", "UV Overflow Output Hatch", 8, 1e10f).getStackForm(1L)); - eM_muffler_UHV.set(new GT_MetaTileEntity_Hatch_MufflerElemental( + eM_muffler_UHV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( 15021, "hatch.emmuffler.tier.09", "UHV Overflow Output Hatch", 9, 5e10f).getStackForm(1L)); - eM_muffler_UEV.set(new GT_MetaTileEntity_Hatch_MufflerElemental( + eM_muffler_UEV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( 15022, "hatch.emmuffler.tier.10", "UEV Overflow Output Hatch", 10, 25e10f).getStackForm(1L)); - eM_muffler_UIV.set(new GT_MetaTileEntity_Hatch_MufflerElemental( + eM_muffler_UIV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( 15023, "hatch.emmuffler.tier.11", "UIV Overflow Output Hatch", 11, 125e10f).getStackForm(1L)); - eM_muffler_UMV.set(new GT_MetaTileEntity_Hatch_MufflerElemental( + eM_muffler_UMV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( 15024, "hatch.emmuffler.tier.12", "UMV Overflow Output Hatch", 12, 125e11f).getStackForm(1L)); - eM_muffler_UXV.set(new GT_MetaTileEntity_Hatch_MufflerElemental( + eM_muffler_UXV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( 15025, "hatch.emmuffler.tier.13", "UXV Overflow Output Hatch", 13, 125e12f).getStackForm(1L)); // =================================================================================================== diff --git a/src/main/java/com/github/technus/tectech/loader/RecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/RecipeLoader.java index 1723506d6f..360604e7b8 100644 --- a/src/main/java/com/github/technus/tectech/loader/RecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/RecipeLoader.java @@ -34,5 +34,7 @@ public class RecipeLoader implements Runnable { if (Loader.isModLoaded("dreamcraft")) new DreamCraftRecipeLoader().run();//init recipes for GTNH version else new BloodyRecipeLoader().run();//init recipes for NON-GTNH version + + } } diff --git a/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java b/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java index 6324854082..629cc28dec 100644 --- a/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java +++ b/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java @@ -6,7 +6,7 @@ import com.github.technus.tectech.elementalMatter.core.stacks.cElementalDefiniti import com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition; import com.github.technus.tectech.thing.item.ElementalDefinitionContainer_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_crafting; -import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_machine; +import com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.GT_MetaTileEntity_EM_machine; import gregtech.api.enums.ItemList; import gregtech.api.util.GT_Recipe; import gregtech.common.GT_RecipeAdder; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java index 7faa067177..ec580f3668 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java @@ -116,12 +116,12 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta } else { if (deathDelay == 1) { IGregTechTileEntity tGTTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()); - if (tGTTileEntity == null || !(tGTTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_MufflerElemental)) + if (tGTTileEntity == null || !(tGTTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_OverflowElemental)) tGTTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityAtSide((byte) 0); - if (tGTTileEntity == null || !(tGTTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_MufflerElemental)) + if (tGTTileEntity == null || !(tGTTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_OverflowElemental)) tGTTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityAtSide((byte) 1); - if (tGTTileEntity != null && (tGTTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_MufflerElemental)) { - GT_MetaTileEntity_Hatch_MufflerElemental aMetaTileEntity = (GT_MetaTileEntity_Hatch_MufflerElemental) tGTTileEntity.getMetaTileEntity(); + if (tGTTileEntity != null && (tGTTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_OverflowElemental)) { + GT_MetaTileEntity_Hatch_OverflowElemental aMetaTileEntity = (GT_MetaTileEntity_Hatch_OverflowElemental) tGTTileEntity.getMetaTileEntity(); if (aMetaTileEntity.addOverflowMatter(overflowMatter)) { if (TecTech.ModConfig.BOOM_ENABLE) tGTTileEntity.doExplosion(V[14]); else diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_MufflerElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java index 2d1400ecf4..d468474d2f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_MufflerElemental.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java @@ -32,7 +32,7 @@ import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Mult /** * Created by danie_000 on 12.12.2016. */ -public class GT_MetaTileEntity_Hatch_MufflerElemental extends GT_MetaTileEntity_Hatch { +public class GT_MetaTileEntity_Hatch_OverflowElemental extends GT_MetaTileEntity_Hatch { private static Textures.BlockIcons.CustomIcon EM_T_SIDES; private static Textures.BlockIcons.CustomIcon EM_T_ACTIVE; private static Textures.BlockIcons.CustomIcon MufflerEM; @@ -42,7 +42,7 @@ public class GT_MetaTileEntity_Hatch_MufflerElemental extends GT_MetaTileEntity_ private final float overflowDisperse; private final int eTier; - public GT_MetaTileEntity_Hatch_MufflerElemental(int aID, String aName, String aNameRegional, int aTier, float max) { + public GT_MetaTileEntity_Hatch_OverflowElemental(int aID, String aName, String aNameRegional, int aTier, float max) { super(aID, aName, aNameRegional, aTier, 0, "Disposes excess elemental Matter"); overflowMatter = max / 2; overflowMax = max; @@ -58,7 +58,7 @@ public class GT_MetaTileEntity_Hatch_MufflerElemental extends GT_MetaTileEntity_ // eTier=aTier; //} - public GT_MetaTileEntity_Hatch_MufflerElemental(String aName, int aTier, int eTier, float max, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_OverflowElemental(String aName, int aTier, int eTier, float max, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); overflowMatter = max / 2; overflowMax = max; @@ -119,7 +119,7 @@ public class GT_MetaTileEntity_Hatch_MufflerElemental extends GT_MetaTileEntity_ @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_MufflerElemental(mName, mTier, eTier, overflowMax, mDescription, mTextures); + return new GT_MetaTileEntity_Hatch_OverflowElemental(mName, mTier, eTier, overflowMax, mDescription, mTextures); } @Override @@ -148,8 +148,11 @@ public class GT_MetaTileEntity_Hatch_MufflerElemental extends GT_MetaTileEntity_ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide() && (aTick % 20) == DISPERSE_AT) { if (aBaseMetaTileEntity.isActive()) { - overflowMatter -= overflowDisperse; - if (overflowMatter < 0) { + if (overflowMatter > overflowDisperse) { + //todo add full dose of dispersed pollution (reduced by tier, or make recycler machine only capable of reduction?) + overflowMatter -= overflowDisperse; + } else { + //todo add partial dose of dispersed pollution (reduced by tier, or make recycler machine only capable of reduction?) overflowMatter = 0; aBaseMetaTileEntity.setActive(false); aBaseMetaTileEntity.setLightValue((byte) 0); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java index b82bd55428..bc0db49be4 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java @@ -36,7 +36,7 @@ import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texture import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_crafting.crafter; -import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_machine.machine; +import static com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.GT_MetaTileEntity_EM_machine.machine; import static gregtech.api.enums.GT_Values.E; /** diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java index 91c638fce9..f54fd46555 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java @@ -36,7 +36,7 @@ import static com.github.technus.tectech.recipe.TT_recipe.E_RECIPE_ID; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_crafting.crafter; -import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_machine.machine; +import static com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.GT_MetaTileEntity_EM_machine.machine; /** * Created by danie_000 on 17.12.2016. 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 22f4179290..b151678e5a 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 @@ -58,7 +58,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt protected ArrayList<GT_MetaTileEntity_Hatch_InputElemental> eInputHatches = new ArrayList<>(); protected ArrayList<GT_MetaTileEntity_Hatch_OutputElemental> eOutputHatches = new ArrayList<>(); - protected ArrayList<GT_MetaTileEntity_Hatch_MufflerElemental> eMufflerHatches = new ArrayList<>(); + protected ArrayList<GT_MetaTileEntity_Hatch_OverflowElemental> eMufflerHatches = new ArrayList<>(); protected ArrayList<GT_MetaTileEntity_Hatch_Param> eParamHatches = new ArrayList<>(); protected ArrayList<GT_MetaTileEntity_Hatch_Uncertainty> eUncertainHatches = new ArrayList<>(); protected ArrayList<GT_MetaTileEntity_Hatch_EnergyMulti> eEnergyMulti = new ArrayList<>(); @@ -158,8 +158,8 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt return 0; } - public int getPollutionPerTick_EM(ItemStack itemStack) { - return 0; + public float getExcessMassPerTick_EM(ItemStack itemStack) { + return 0f; } //helper method so i don't have to set that params to nothing at all times @@ -172,7 +172,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (eMufflerHatches.size() < 1) explodeMultiblock(); else { mass /= eMufflerHatches.size(); - for (GT_MetaTileEntity_Hatch_MufflerElemental dump : eMufflerHatches) + for (GT_MetaTileEntity_Hatch_OverflowElemental dump : eMufflerHatches) if (dump.addOverflowMatter(mass)) explodeMultiblock(); } } @@ -210,7 +210,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (eMufflerHatches.size() < 1) explodeMultiblock(); else { mass /= eMufflerHatches.size(); - for (GT_MetaTileEntity_Hatch_MufflerElemental dump : eMufflerHatches) + for (GT_MetaTileEntity_Hatch_OverflowElemental dump : eMufflerHatches) if (dump.addOverflowMatter(mass)) explodeMultiblock(); } } @@ -472,12 +472,17 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } public final int getParameterInInt(int hatchNo, int paramID){ + if(bParamsAreFloats[hatchNo]) return (int)Float.intBitsToFloat(iParamsIn[hatchNo+10*paramID]); return iParamsIn[hatchNo+10*paramID]; } - public final float getParameterInFloat(int hatchNo, int paramID){ - return Float.intBitsToFloat(iParamsIn[hatchNo+10*paramID]); - } + //public final int getParameterInIntRaw(int hatchNo, int paramID){ + // return iParamsIn[hatchNo+10*paramID]; + //} + + //public final float getParameterInFloatRaw(int hatchNo, int paramID){ + // return Float.intBitsToFloat(iParamsIn[hatchNo+10*paramID]); + //} public final void setParameterOut(int hatchNo, int paramID, double value){ if(bParamsAreFloats[hatchNo]) { @@ -487,32 +492,24 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } } - public final boolean setParameterOutInt(int hatchNo, int paramID, int value){ - if(bParamsAreFloats[hatchNo]) return false; - iParamsOut[hatchNo+10*paramID]=value; - return true; - } - - public final boolean setParameterOutFloat(int hatchNo, int paramID, float value){ - if(bParamsAreFloats[hatchNo]) { - iParamsOut[hatchNo + 10 * paramID] = Float.floatToIntBits(value); - return true; - } - return false; - } + //public final boolean setParameterOutInt(int hatchNo, int paramID, int value){ + // if(bParamsAreFloats[hatchNo]) return false; + // iParamsOut[hatchNo+10*paramID]=value; + // return true; + //} - public final byte getStatusOfParameterIn(int hatchNo, int paramID){ - return eParamsInStatus[hatchNo+10*paramID]; - } + //public final boolean setParameterOutFloat(int hatchNo, int paramID, float value){ + // if(bParamsAreFloats[hatchNo]) { + // iParamsOut[hatchNo + 10 * paramID] = Float.floatToIntBits(value); + // return true; + // } + // return false; + //} public final void setStatusOfParameterIn(int hatchNo, int paramID, byte status){ eParamsInStatus[hatchNo+10*paramID]=status; } - public final byte getStatusOfParameterOut(int hatchNo, int paramID){ - return eParamsOutStatus[hatchNo+10*paramID]; - } - public final void setStatusOfParameterOut(int hatchNo, int paramID, byte status){ eParamsOutStatus[hatchNo+10*paramID]=status; } @@ -699,7 +696,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } } else if (MOVE_AT == Tick && eSafeVoid) { - for (GT_MetaTileEntity_Hatch_MufflerElemental voider : eMufflerHatches) { + for (GT_MetaTileEntity_Hatch_OverflowElemental voider : eMufflerHatches) { if (voider.overflowMax < voider.getOverflowMatter()) continue; float remaining = voider.overflowMax - voider.getOverflowMatter(); for (GT_MetaTileEntity_Hatch_InputElemental in : eInputHatches) { @@ -773,8 +770,8 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (mMaxProgresstime > 0 && doRandomMaintenanceDamage()) {//Start if (onRunningTick(mInventory[1])) {//Compute EU + cleanMassEM_EM(getExcessMassPerTick_EM(mInventory[1])); if (!polluteEnvironment(getPollutionPerTick(mInventory[1]))) stopMachine(); - if (!polluteEnvironment_EM(getPollutionPerTick_EM(mInventory[1]))) stopMachine(); if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime && RECIPE_AT == Tick) {//progress increase and done hatchesStatusUpdate_EM(); @@ -838,10 +835,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } } - public boolean polluteEnvironment_EM(int aPollutionLevel) { - return true; //TODO - } - @Deprecated public final int getAmountOfOutputs() { throw new NoSuchMethodError("Deprecated Do not use"); @@ -1126,7 +1119,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (mass > 0) { if (eMufflerHatches.size() < 1) explodeMultiblock(); mass /= eMufflerHatches.size(); - for (GT_MetaTileEntity_Hatch_MufflerElemental dump : eMufflerHatches) + for (GT_MetaTileEntity_Hatch_OverflowElemental dump : eMufflerHatches) if (dump.addOverflowMatter(mass)) explodeMultiblock(); } } @@ -1137,7 +1130,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (mass > 0) { if (eMufflerHatches.size() < 1) explodeMultiblock(); mass /= eMufflerHatches.size(); - for (GT_MetaTileEntity_Hatch_MufflerElemental dump : eMufflerHatches) + for (GT_MetaTileEntity_Hatch_OverflowElemental dump : eMufflerHatches) if (dump.addOverflowMatter(mass)) explodeMultiblock(); } } @@ -1151,7 +1144,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (mass > 0) { if (eMufflerHatches.size() < 1) explodeMultiblock(); mass /= eMufflerHatches.size(); - for (GT_MetaTileEntity_Hatch_MufflerElemental dump : eMufflerHatches) + for (GT_MetaTileEntity_Hatch_OverflowElemental dump : eMufflerHatches) if (dump.addOverflowMatter(mass)) explodeMultiblock(); } } @@ -1165,7 +1158,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (mass > 0) { if (eMufflerHatches.size() < 1) explodeMultiblock(); mass /= eMufflerHatches.size(); - for (GT_MetaTileEntity_Hatch_MufflerElemental dump : eMufflerHatches) + for (GT_MetaTileEntity_Hatch_OverflowElemental dump : eMufflerHatches) if (dump.addOverflowMatter(mass)) explodeMultiblock(); } outputEM = null; @@ -1331,8 +1324,8 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt return eParamHatches.add((GT_MetaTileEntity_Hatch_Param) aMetaTileEntity); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Uncertainty) return eUncertainHatches.add((GT_MetaTileEntity_Hatch_Uncertainty) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_MufflerElemental) - return eMufflerHatches.add((GT_MetaTileEntity_Hatch_MufflerElemental) aMetaTileEntity); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OverflowElemental) + return eMufflerHatches.add((GT_MetaTileEntity_Hatch_OverflowElemental) aMetaTileEntity); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) return eEnergyMulti.add((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) @@ -1393,8 +1386,8 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt return eInputHatches.add((GT_MetaTileEntity_Hatch_InputElemental) aMetaTileEntity); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputElemental) return eOutputHatches.add((GT_MetaTileEntity_Hatch_OutputElemental) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_MufflerElemental) - return eMufflerHatches.add((GT_MetaTileEntity_Hatch_MufflerElemental) aMetaTileEntity); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OverflowElemental) + return eMufflerHatches.add((GT_MetaTileEntity_Hatch_OverflowElemental) aMetaTileEntity); return false; } @@ -1413,9 +1406,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (aTileEntity == null) return false; IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity == null) return false; - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_MufflerElemental) { + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OverflowElemental) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return eMufflerHatches.add((GT_MetaTileEntity_Hatch_MufflerElemental) aMetaTileEntity); + return eMufflerHatches.add((GT_MetaTileEntity_Hatch_OverflowElemental) aMetaTileEntity); } return false; } @@ -1429,9 +1422,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); } - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_MufflerElemental) { + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OverflowElemental) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return eMufflerHatches.add((GT_MetaTileEntity_Hatch_MufflerElemental) aMetaTileEntity); + return eMufflerHatches.add((GT_MetaTileEntity_Hatch_OverflowElemental) aMetaTileEntity); } return false; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/MultiblockControl.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/MultiblockControl.java index bc5e1b387b..daa5c7568b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/MultiblockControl.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/MultiblockControl.java @@ -5,17 +5,29 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.base; */ public class MultiblockControl<T>{ - private final int[] controls; + private final int[] controls=new int[7]; private final T[] values; public MultiblockControl(T[] values, int EUt, int amperes, int requiredData, int effIncrease, int maxProgressTime){ this.values = values; - controls=new int[5]; controls[0]=EUt; controls[1]=amperes; controls[2]=requiredData; controls[3]=effIncrease; controls[4]=maxProgressTime; + controls[5]=0; + controls[6]=Float.floatToIntBits(0); + } + + public MultiblockControl(T[] values, int EUt, int amperes, int requiredData, int effIncrease, int maxProgressTime, int pollutionToAdd, float excessMass){ + this.values = values; + controls[0]=EUt; + controls[1]=amperes; + controls[2]=requiredData; + controls[3]=effIncrease; + controls[4]=maxProgressTime; + controls[5]=pollutionToAdd; + controls[6]=Float.floatToIntBits(excessMass); } public T[] getValues() { @@ -41,4 +53,12 @@ public class MultiblockControl<T>{ public int getMaxProgressTime(){ return controls[4]; } + + public int getPollutionToAdd(){ + return controls[5]; + } + + public float getExcessMass(){ + return Float.intBitsToFloat(controls[6]); + } } 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 new file mode 100644 index 0000000000..91ef19744b --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java @@ -0,0 +1,24 @@ +package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine; + +import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; + +/** + * Created by danie_000 on 24.12.2017. + */ +public class Behaviour_Centrifuge extends GT_MetaTileEntity_EM_machine.Behaviour { + final int tier; + public Behaviour_Centrifuge(int tier){ + this.tier=tier; + } + + @Override + public boolean setAndCheckParametersOutAndStatuses(GT_MetaTileEntity_EM_machine te, double[] parameters) { + return false; + } + + @Override + public MultiblockControl<cElementalInstanceStackMap> process(cElementalInstanceStackMap[] inputs, double[] parameters) { + return null; + } +} 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 new file mode 100644 index 0000000000..c6b9306b94 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Electrolyzer.java @@ -0,0 +1,24 @@ +package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine; + +import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; + +/** + * Created by danie_000 on 24.12.2017. + */ +public class Behaviour_Electrolyzer extends GT_MetaTileEntity_EM_machine.Behaviour { + final int tier; + public Behaviour_Electrolyzer(int tier){ + this.tier=tier; + } + + @Override + public boolean setAndCheckParametersOutAndStatuses(GT_MetaTileEntity_EM_machine te, double[] parameters) { + return false; + } + + @Override + public MultiblockControl<cElementalInstanceStackMap> process(cElementalInstanceStackMap[] inputs, double[] parameters) { + return null; + } +} 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 new file mode 100644 index 0000000000..7a2ed9ffcf --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java @@ -0,0 +1,24 @@ +package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine; + +import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; + +/** + * Created by danie_000 on 24.12.2017. + */ +public class Behaviour_ElectromagneticSeparator extends GT_MetaTileEntity_EM_machine.Behaviour { + final int tier; + public Behaviour_ElectromagneticSeparator(int tier){ + this.tier=tier; + } + + @Override + public boolean setAndCheckParametersOutAndStatuses(GT_MetaTileEntity_EM_machine te, double[] parameters) { + return false; + } + + @Override + public MultiblockControl<cElementalInstanceStackMap> process(cElementalInstanceStackMap[] inputs, double[] parameters) { + return null; + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Mixer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Mixer.java new file mode 100644 index 0000000000..29d9c4a081 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Mixer.java @@ -0,0 +1,24 @@ +package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine; + +import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; + +/** + * Created by danie_000 on 24.12.2017. + */ +public class Behaviour_Mixer extends GT_MetaTileEntity_EM_machine.Behaviour { + final int tier; + public Behaviour_Mixer(int tier){ + this.tier=tier; + } + + @Override + public boolean setAndCheckParametersOutAndStatuses(GT_MetaTileEntity_EM_machine te, double[] parameters) { + return false; + } + + @Override + public MultiblockControl<cElementalInstanceStackMap> process(cElementalInstanceStackMap[] inputs, double[] parameters) { + return null; + } +} 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 new file mode 100644 index 0000000000..0365f436c3 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_PrecisionLaser.java @@ -0,0 +1,24 @@ +package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine; + +import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; + +/** + * Created by danie_000 on 24.12.2017. + */ +public class Behaviour_PrecisionLaser extends GT_MetaTileEntity_EM_machine.Behaviour { + final int tier; + public Behaviour_PrecisionLaser(int tier){ + this.tier=tier; + } + + @Override + public boolean setAndCheckParametersOutAndStatuses(GT_MetaTileEntity_EM_machine te, double[] parameters) { + return false; + } + + @Override + public MultiblockControl<cElementalInstanceStackMap> process(cElementalInstanceStackMap[] inputs, double[] parameters) { + return null; + } +} 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 new file mode 100644 index 0000000000..e0fc30b469 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java @@ -0,0 +1,24 @@ +package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine; + +import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; + +/** + * Created by danie_000 on 24.12.2017. + */ +public class Behaviour_Recycler extends GT_MetaTileEntity_EM_machine.Behaviour { + final int tier; + public Behaviour_Recycler(int tier){ + this.tier=tier; + } + + @Override + public boolean setAndCheckParametersOutAndStatuses(GT_MetaTileEntity_EM_machine te, double[] parameters) { + return false; + } + + @Override + public MultiblockControl<cElementalInstanceStackMap> process(cElementalInstanceStackMap[] inputs, double[] parameters) { + return null; + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_machine.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java index 68e6c6f4c9..21cb366550 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_machine.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java @@ -1,4 +1,4 @@ -package com.github.technus.tectech.thing.metaTileEntity.multi; +package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; @@ -24,6 +24,8 @@ import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBloc * Created by danie_000 on 17.12.2016. */ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { + private Behaviour currentBehaviour; + public final static String machine="EM Machinery"; //region structure @@ -89,55 +91,89 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa @Override public boolean checkRecipe_EM(ItemStack itemStack) { - Behaviour currentBehaviour=map.get(new GT_ItemStack(itemStack)); + currentBehaviour=map.get(new GT_ItemStack(itemStack)); if(currentBehaviour==null) return false; //mux input double[] parameters=new double[]{getParameterIn(0,0),getParameterIn(0,1),getParameterIn(1,0),getParameterIn(1,1), getParameterIn(2,0),getParameterIn(2,1),getParameterIn(3,0),getParameterIn(3,1)}; if(!currentBehaviour.setAndCheckParametersOutAndStatuses(this,parameters))return false; - cElementalInstanceStackMap[] handles=new cElementalInstanceStackMap[3]; + + cElementalInstanceStackMap[] handles=new cElementalInstanceStackMap[6]; + int pointer= getParameterInInt(4,0)-1; + if(pointer>=0 && pointer<eInputHatches.size()) handles[0]=eInputHatches.get(pointer).getContainerHandler(); + pointer= getParameterInInt(4,1)-1; + if(pointer>=0 && pointer<eInputHatches.size()) handles[1]=eInputHatches.get(pointer).getContainerHandler(); + pointer= getParameterInInt(5,0)-1; + if(pointer>=0 && pointer<eInputHatches.size()) handles[2]=eInputHatches.get(pointer).getContainerHandler(); + pointer= getParameterInInt(5,1)-1; + if(pointer>=0 && pointer<eInputHatches.size()) handles[3]=eInputHatches.get(pointer).getContainerHandler(); + pointer= getParameterInInt(6,0)-1; + if(pointer>=0 && pointer<eInputHatches.size()) handles[4]=eInputHatches.get(pointer).getContainerHandler(); + pointer= getParameterInInt(6,1)-1; + if(pointer>=0 && pointer<eInputHatches.size()) handles[5]=eInputHatches.get(pointer).getContainerHandler(); + MultiblockControl<cElementalInstanceStackMap> control=currentBehaviour.process(handles,parameters); if(control==null) return false; //update other pare outputEM=control.getValues(); + cElementalInstanceStackMap nullFix=new cElementalInstanceStackMap(); + for(int i=0;i<outputEM.length;i++){ + if(outputEM[i]==null) outputEM[i]=nullFix; + } mEUt=control.getEUT(); eAmpereFlow=control.getAmperage(); mMaxProgresstime=control.getMaxProgressTime(); eRequiredData=control.getRequiredData(); mEfficiencyIncrease=control.getEffIncrease(); - return true; + cleanMassEM_EM(control.getExcessMass()); + return polluteEnvironment(control.getPollutionToAdd()); } @Override - protected void parametersLoadDefault_EM() {//default 1 to 1 routing table - setParameterPairIn_ClearOut(4,false,1,1);//I - setParameterPairIn_ClearOut(5,false,2,2);//I - setParameterPairIn_ClearOut(6,false,3,3);//I - setParameterPairIn_ClearOut(7,false,1,1);//O - setParameterPairIn_ClearOut(8,false,2,2);//O - setParameterPairIn_ClearOut(9,false,3,3);//O + public void outputAfterRecipe_EM() { + cElementalInstanceStackMap[] handles=new cElementalInstanceStackMap[6]; + int pointer= getParameterInInt(7,0)-1; + if(pointer>=0 && pointer<eOutputHatches.size()) handles[0]=eOutputHatches.get(pointer).getContainerHandler(); + pointer= getParameterInInt(7,1)-1; + if(pointer>=0 && pointer<eOutputHatches.size()) handles[1]=eOutputHatches.get(pointer).getContainerHandler(); + pointer= getParameterInInt(8,0)-1; + if(pointer>=0 && pointer<eOutputHatches.size()) handles[2]=eOutputHatches.get(pointer).getContainerHandler(); + pointer= getParameterInInt(8,1)-1; + if(pointer>=0 && pointer<eOutputHatches.size()) handles[3]=eOutputHatches.get(pointer).getContainerHandler(); + pointer= getParameterInInt(9,0)-1; + if(pointer>=0 && pointer<eOutputHatches.size()) handles[4]=eOutputHatches.get(pointer).getContainerHandler(); + pointer= getParameterInInt(9,1)-1; + if(pointer>=0 && pointer<eOutputHatches.size()) handles[5]=eOutputHatches.get(pointer).getContainerHandler(); + //output + for(int i=0;i<6;i++) if(handles[i]!=null && outputEM[i].hasStacks()) handles[i].putUnifyAll(outputEM[i].takeAll()); + //all other are handled by base multi block code - cleaning is automatic } @Override - public void parametersOutAndStatusesWrite_EM(boolean machineBusy) { - //update routing + protected void parametersLoadDefault_EM() {//default routing table + setParameterPairIn_ClearOut(4,false,1,2);//I + setParameterPairIn_ClearOut(5,false,3,4);//I + setParameterPairIn_ClearOut(6,false,5,6);//I + + setParameterPairIn_ClearOut(7,false,1,2);//O + setParameterPairIn_ClearOut(8,false,3,4);//O + setParameterPairIn_ClearOut(9,false,5,6);//O } @Override - public void outputAfterRecipe_EM() { - //mux output - //output + public void parametersOutAndStatusesWrite_EM(boolean machineBusy) { + //update routing stats } private static final HashMap<GT_ItemStack,Behaviour> map=new HashMap<>(); - public abstract class Behaviour { - public Behaviour(ItemStack... keyItems){ - for(ItemStack is:keyItems){ - map.put(new GT_ItemStack(is.getItem(),1,is.getItemDamage()),this); - } - } + public static void registerBehaviour(Behaviour behaviour,GT_ItemStack is){ + map.put(is,behaviour); + } + + public static abstract class Behaviour { public abstract boolean setAndCheckParametersOutAndStatuses(GT_MetaTileEntity_EM_machine te, double[] parameters); + public abstract MultiblockControl<cElementalInstanceStackMap> process(cElementalInstanceStackMap[] inputs, double[] parameters); } } |
