aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTec <daniel112092@gmail.com>2018-04-08 20:33:17 +0200
committerTec <daniel112092@gmail.com>2018-04-08 20:33:17 +0200
commit2a196a659ccfe0d33f90eefd4f121ee6d07f678f (patch)
treedcf2b0254df4634653ccb50ef4ffb26341be98b9 /src
parent498593db051033b6fc8c126ef844f641d78d5ef3 (diff)
downloadGT5-Unofficial-2a196a659ccfe0d33f90eefd4f121ee6d07f678f.tar.gz
GT5-Unofficial-2a196a659ccfe0d33f90eefd4f121ee6d07f678f.tar.bz2
GT5-Unofficial-2a196a659ccfe0d33f90eefd4f121ee6d07f678f.zip
decay reactor usable draft
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java2
-rw-r--r--src/main/java/com/github/technus/tectech/compatibility/gtpp/GtppAtomLoader.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java24
3 files changed, 20 insertions, 10 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 0caac6fde4..af834b2617 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
@@ -45,12 +45,14 @@ public class DreamCraftRecipeLoader implements Runnable {
@Override
public void run() {
+ //region reflect a bit
try {
CUSTOM_ITEM_LIST = Class.forName("com.dreammaster.gthandler.CustomItemList");
ADD_ASSEMBLER_RECIPE = GT_Values.RA.getClass().getMethod("addAssemblerRecipe", ItemStack[].class, FluidStack.class, ItemStack.class, int.class, int.class, boolean.class);
} catch (Exception e) {
throw new Error(e);
}
+ //endregion
//Quantum Glass
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{
diff --git a/src/main/java/com/github/technus/tectech/compatibility/gtpp/GtppAtomLoader.java b/src/main/java/com/github/technus/tectech/compatibility/gtpp/GtppAtomLoader.java
index dcc8dad6e5..7de7525cd2 100644
--- a/src/main/java/com/github/technus/tectech/compatibility/gtpp/GtppAtomLoader.java
+++ b/src/main/java/com/github/technus/tectech/compatibility/gtpp/GtppAtomLoader.java
@@ -10,6 +10,7 @@ import java.lang.reflect.Method;
import static com.github.technus.tectech.elementalMatter.definitions.complex.atom.dAtomDefinition.*;
public class GtppAtomLoader implements Runnable{
+ //region reflect a bit
private Class ELEMENT;
private Object ELEMENT_INSTANCE;
private Method getUnlocalizedName,getFluid,generate;
@@ -37,9 +38,11 @@ public class GtppAtomLoader implements Runnable{
throw new Error(e);
}
}
+ //endregion
@Override
public void run() {
+ //region reflect a bit
try{
ELEMENT=Class.forName("gtPlusPlus.core.material.ELEMENT");
ELEMENT_INSTANCE=ELEMENT.getMethod("getInstance").invoke(null);
@@ -53,6 +56,7 @@ public class GtppAtomLoader implements Runnable{
}catch (Exception e){
throw new Error(e);
}
+ //endregion
transformation.addFluid(new cElementalDefinitionStack(getFirstStableIsotope(10), 144), getFluid("NEON",144));
generate("GERMANIUM",true,true);
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 95884ad25e..4661093030 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
@@ -137,34 +137,38 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase
outputEM[0]=input;
outputEM[1]=new cElementalInstanceStackMap();
- float mass=outputEM[0].getMass();
for(cElementalInstanceStack stack:outputEM[0].values()){
if(stack.getEnergy()==0 && stack.definition.decayMakesEnergy(1)){
if(getBaseMetaTileEntity().decreaseStoredEnergyUnits((long)(stack.getEnergySettingCost(1)*MASS_TO_EU_INSTANT),false)){
stack.setEnergy(1);
}else{
+ outputEM[0].remove(stack.definition);
outputEM[1].putReplace(stack);
}
- }else if(stack.definition.decayMakesEnergy(stack.getEnergy())){
-
+ }else if(!stack.definition.decayMakesEnergy(stack.getEnergy())){
+ outputEM[0].remove(stack.definition);
+ outputEM[1].putReplace(stack);
}
//System.out.println(stack.definition.getSymbol()+" "+stack.amount);
}
+ float preMass=outputEM[0].getMass();
outputEM[0].tickContent(1,0,1);
- double energyDose=((mass-outputEM[0].getMass())*MASS_TO_EU);
+ double energyDose=((preMass-outputEM[0].getMass())*MASS_TO_EU);
mEUt=(int)(energyDose/getParameterInInt(0,0));
eAmpereFlow=getParameterInInt(0,0);
-
- //todo move not actually decaying crap, beware of energy using decays?
- //for(cElementalInstanceStack stack:contents.values()){
- // System.out.println(stack.definition.getSymbol()+" "+stack.amount);
- //}
+ return outputEM[0].hasStacks();
+ }
- return true;
+ @Override
+ public void outputAfterRecipe_EM() {
+ for(int i=0;i<2&&i<eOutputHatches.size();i++){
+ eOutputHatches.get(i).getContainerHandler().putUnifyAll(outputEM[i]);
+ outputEM[i]=null;
+ }
}
@Override