diff options
Diffstat (limited to 'src/main/java/gregtech/api')
3 files changed, 23 insertions, 2 deletions
diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java index 66c85be547..849b82565e 100644 --- a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java @@ -33,6 +33,7 @@ import gregtech.api.interfaces.tileentity.IMachineBlockUpdateable; import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_Config; import gregtech.api.util.GT_Util; +import gregtech.common.power.Power; /** * Warning, this Interface has just been made to be able to add multiple kinds of MetaTileEntities (Cables, Pipes, @@ -354,6 +355,13 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand String getSpecialVoltageToolTip(); /** + * @return Power object used for displaying in NEI + */ + default Power getPower() { + return null; + } + + /** * Icon of the Texture. If this returns null then it falls back to getTextureIndex. * * @param aSide is the Side of the Block diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java index 501e78ccec..62d6868286 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java @@ -751,7 +751,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B /** * Calcualtes overclocked ness using long integers - * + * * @param aEUt - recipe EUt * @param aDuration - recipe Duration */ @@ -1238,6 +1238,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B } } + @Override public Power getPower() { return mPower; } diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java index 524976adc9..824d97a382 100644 --- a/src/main/java/gregtech/api/util/GT_Recipe.java +++ b/src/main/java/gregtech/api/util/GT_Recipe.java @@ -1636,7 +1636,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> { " EU", true, true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .setUsualFluidInputCount(2).setNEISpecialInfoFormatter(FusionSpecialValueFormatter.INSTANCE); + .useComparatorForNEI(true).setUsualFluidInputCount(2) + .setNEISpecialInfoFormatter(FusionSpecialValueFormatter.INSTANCE); public static final GT_Recipe_Map sComplexFusionRecipes = new GT_Recipe_Map_ComplexFusion( new HashSet<>(50), "gt.recipe.complexfusionreactor", @@ -2617,6 +2618,12 @@ public class GT_Recipe implements Comparable<GT_Recipe> { private INEISpecialInfoFormatter neiSpecialInfoFormatter; /** + * Flag if a comparator should be used to search the recipe in NEI (which is defined in {@link Power}). Else + * only the voltage will be used to find recipes + */ + public boolean useComparatorForNEI; + + /** * Initialises a new type of Recipe Handler. * * @param aRecipeList a List you specify as Recipe List. Usually just an ArrayList with a @@ -2700,6 +2707,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> { return this; } + public GT_Recipe_Map useComparatorForNEI(boolean use) { + this.useComparatorForNEI = use; + return this; + } + public GT_Recipe_Map useModularUI(boolean use) { this.useModularUI = use; return this; |