Add low grav to proc array, - assuming that proc array is always considered in a clean room, added circuit assembler to proc array
This commit is contained in:
parent
6f86bf0505
commit
1ddc91afc8
2 changed files with 32 additions and 22 deletions
|
@ -779,6 +779,16 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
|
||||||
return checkRecipe(false);
|
return checkRecipe(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isValidForLowGravity(GT_Recipe tRecipe, int dimId){
|
||||||
|
return //TODO check or get a better solution
|
||||||
|
DimensionManager.getProvider(dimId).getClass().getName().contains("Orbit") ||
|
||||||
|
DimensionManager.getProvider(dimId).getClass().getName().endsWith("Space") ||
|
||||||
|
DimensionManager.getProvider(dimId).getClass().getName().endsWith("Asteroids") ||
|
||||||
|
DimensionManager.getProvider(dimId).getClass().getName().endsWith("SS") ||
|
||||||
|
DimensionManager.getProvider(dimId).getClass().getName().contains("SpaceStation");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param skipOC disables OverclockedNess calculation and check - if you do you must implement your own method...
|
* @param skipOC disables OverclockedNess calculation and check - if you do you must implement your own method...
|
||||||
|
@ -789,15 +799,9 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
|
||||||
if (tMap == null) return DID_NOT_FIND_RECIPE;
|
if (tMap == null) return DID_NOT_FIND_RECIPE;
|
||||||
GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[mTier], new FluidStack[]{getFillableStack()}, getSpecialSlot(), getAllInputs());
|
GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[mTier], new FluidStack[]{getFillableStack()}, getSpecialSlot(), getAllInputs());
|
||||||
if (tRecipe == null) return DID_NOT_FIND_RECIPE;
|
if (tRecipe == null) return DID_NOT_FIND_RECIPE;
|
||||||
if (GT_Mod.gregtechproxy.mLowGravProcessing &&
|
if (GT_Mod.gregtechproxy.mLowGravProcessing && tRecipe.mSpecialValue == -100 &&
|
||||||
tRecipe.mSpecialValue == -100 && !(//TODO check or get a better solution
|
!isValidForLowGravity(tRecipe,getBaseMetaTileEntity().getWorld().provider.dimensionId))
|
||||||
DimensionManager.getProvider(getBaseMetaTileEntity().getWorld().provider.dimensionId).getClass().getName().contains("Orbit") ||
|
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
|
||||||
DimensionManager.getProvider(getBaseMetaTileEntity().getWorld().provider.dimensionId).getClass().getName().endsWith("Space") ||
|
|
||||||
DimensionManager.getProvider(getBaseMetaTileEntity().getWorld().provider.dimensionId).getClass().getName().endsWith("Asteroids") ||
|
|
||||||
DimensionManager.getProvider(getBaseMetaTileEntity().getWorld().provider.dimensionId).getClass().getName().endsWith("SS") ||
|
|
||||||
DimensionManager.getProvider(getBaseMetaTileEntity().getWorld().provider.dimensionId).getClass().getName().contains("SpaceStation")
|
|
||||||
)
|
|
||||||
) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
|
|
||||||
if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe;
|
if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe;
|
||||||
if (!canOutput(tRecipe)) {
|
if (!canOutput(tRecipe)) {
|
||||||
mOutputBlocked++;
|
mOutputBlocked++;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package gregtech.common.tileentities.machines.multi;
|
package gregtech.common.tileentities.machines.multi;
|
||||||
|
|
||||||
|
import gregtech.GT_Mod;
|
||||||
import gregtech.api.GregTech_API;
|
import gregtech.api.GregTech_API;
|
||||||
import gregtech.api.enums.GT_Values;
|
import gregtech.api.enums.GT_Values;
|
||||||
import gregtech.api.enums.Textures;
|
import gregtech.api.enums.Textures;
|
||||||
|
@ -24,6 +25,8 @@ import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine.isValidForLowGravity;
|
||||||
|
|
||||||
public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBlockBase {
|
public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBlockBase {
|
||||||
|
|
||||||
private GT_Recipe mLastRecipe;
|
private GT_Recipe mLastRecipe;
|
||||||
|
@ -92,7 +95,7 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl
|
||||||
|
|
||||||
public GT_Recipe.GT_Recipe_Map getRecipeMap() {
|
public GT_Recipe.GT_Recipe_Map getRecipeMap() {
|
||||||
if (mInventory[1] == null) return null;
|
if (mInventory[1] == null) return null;
|
||||||
String tmp = mInventory[1].getUnlocalizedName().replaceAll("gt.blockmachines.basicmachine.", "");
|
String tmp = mInventory[1].getUnlocalizedName().replaceAll("gt\\.blockmachines\\.basicmachine\\.", "");
|
||||||
if (tmp.startsWith("centrifuge")) {
|
if (tmp.startsWith("centrifuge")) {
|
||||||
return GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes;
|
return GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes;
|
||||||
} else if (tmp.startsWith("electrolyzer")) {
|
} else if (tmp.startsWith("electrolyzer")) {
|
||||||
|
@ -158,23 +161,24 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl
|
||||||
} else if (tmp.startsWith("polarizer")) {
|
} else if (tmp.startsWith("polarizer")) {
|
||||||
return GT_Recipe.GT_Recipe_Map.sPolarizerRecipes;
|
return GT_Recipe.GT_Recipe_Map.sPolarizerRecipes;
|
||||||
} else if (tmp.startsWith("plasmaarcfurnace")) {
|
} else if (tmp.startsWith("plasmaarcfurnace")) {
|
||||||
return GT_Recipe.GT_Recipe_Map.sPlasmaArcFurnaceRecipes;
|
return GT_Recipe.GT_Recipe_Map.sPlasmaArcFurnaceRecipes;
|
||||||
} else if (tmp.startsWith("printer")) {
|
} else if (tmp.startsWith("printer")) {
|
||||||
return GT_Recipe.GT_Recipe_Map.sPrinterRecipes;
|
return GT_Recipe.GT_Recipe_Map.sPrinterRecipes;
|
||||||
} else if (tmp.startsWith("press")) {
|
} else if (tmp.startsWith("press")) {
|
||||||
return GT_Recipe.GT_Recipe_Map.sPressRecipes;
|
return GT_Recipe.GT_Recipe_Map.sPressRecipes;
|
||||||
} else if (tmp.startsWith("fluidcanner")) {
|
} else if (tmp.startsWith("fluidcanner")) {
|
||||||
return GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes;
|
return GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes;
|
||||||
} else if (tmp.startsWith("fluidheater")) {
|
} else if (tmp.startsWith("fluidheater")) {
|
||||||
return GT_Recipe.GT_Recipe_Map.sFluidHeaterRecipes;
|
return GT_Recipe.GT_Recipe_Map.sFluidHeaterRecipes;
|
||||||
} else if (tmp.startsWith("distillery")) {
|
} else if (tmp.startsWith("distillery")) {
|
||||||
return GT_Recipe.GT_Recipe_Map.sDistilleryRecipes;
|
return GT_Recipe.GT_Recipe_Map.sDistilleryRecipes;
|
||||||
} else if (tmp.startsWith("slicer")) {
|
} else if (tmp.startsWith("slicer")) {
|
||||||
return GT_Recipe.GT_Recipe_Map.sSlicerRecipes;
|
return GT_Recipe.GT_Recipe_Map.sSlicerRecipes;
|
||||||
} else if (tmp.startsWith("amplifier")) {
|
} else if (tmp.startsWith("amplifier")) {
|
||||||
return GT_Recipe.GT_Recipe_Map.sAmplifiers;
|
return GT_Recipe.GT_Recipe_Map.sAmplifiers;
|
||||||
|
} else if (tmp.startsWith("circuitassembler")) {
|
||||||
|
return GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,9 +199,7 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
GT_Recipe.GT_Recipe_Map map = getRecipeMap();
|
GT_Recipe.GT_Recipe_Map map = getRecipeMap();
|
||||||
if (map == null) {
|
if (map == null) return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
ArrayList<ItemStack> tInputList = getStoredInputs();
|
ArrayList<ItemStack> tInputList = getStoredInputs();
|
||||||
|
|
||||||
if (mInventory[1].getUnlocalizedName().endsWith("10")) {
|
if (mInventory[1].getUnlocalizedName().endsWith("10")) {
|
||||||
|
@ -254,6 +256,10 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl
|
||||||
if (tInputList.size() > 0 || tFluids.length > 0) {
|
if (tInputList.size() > 0 || tFluids.length > 0) {
|
||||||
GT_Recipe tRecipe = map.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
|
GT_Recipe tRecipe = map.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
|
||||||
if (tRecipe != null) {
|
if (tRecipe != null) {
|
||||||
|
if (GT_Mod.gregtechproxy.mLowGravProcessing && tRecipe.mSpecialValue == -100 &&
|
||||||
|
!isValidForLowGravity(tRecipe,getBaseMetaTileEntity().getWorld().provider.dimensionId))
|
||||||
|
return false;
|
||||||
|
|
||||||
mLastRecipe = tRecipe;
|
mLastRecipe = tRecipe;
|
||||||
this.mEUt = 0;
|
this.mEUt = 0;
|
||||||
this.mOutputItems = null;
|
this.mOutputItems = null;
|
||||||
|
|
Loading…
Reference in a new issue