-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Martin Robertz <dream-master@gmx.net> Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com>
- Loading branch information
1 parent
3858cce
commit 968e58c
Showing
10 changed files
with
154 additions
and
783 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
src/main/java/gtPlusPlus/api/recipe/SpargeTowerFrontend.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package gtPlusPlus.api.recipe; | ||
|
||
import static gregtech.api.util.GTRecipeConstants.SPARGE_MAX_BYPRODUCT; | ||
|
||
import java.util.List; | ||
|
||
import net.minecraft.item.ItemStack; | ||
import net.minecraftforge.fluids.FluidStack; | ||
|
||
import codechicken.nei.PositionedStack; | ||
import gregtech.api.recipe.BasicUIPropertiesBuilder; | ||
import gregtech.api.recipe.NEIRecipePropertiesBuilder; | ||
import gregtech.api.recipe.maps.FluidOnlyFrontend; | ||
import gregtech.api.util.GTRecipe; | ||
import gregtech.api.util.GTUtility; | ||
import gregtech.nei.GTNEIDefaultHandler; | ||
|
||
public class SpargeTowerFrontend extends FluidOnlyFrontend { | ||
|
||
public SpargeTowerFrontend(BasicUIPropertiesBuilder uiPropertiesBuilder, | ||
NEIRecipePropertiesBuilder neiPropertiesBuilder) { | ||
super(uiPropertiesBuilder, neiPropertiesBuilder); | ||
} | ||
|
||
protected List<String> handleNEIByproductTooltip(ItemStack stack, List<String> currentTip, GTRecipe recipe) { | ||
int maximumByproducts = recipe.getMetadataOrDefault(SPARGE_MAX_BYPRODUCT, 0); | ||
FluidStack spargeGas = recipe.mFluidInputs[0]; | ||
if (stack.isItemEqual(GTUtility.getFluidDisplayStack(spargeGas.getFluid()))) { | ||
currentTip.add("The amount returned is the remainder after all other outputs."); | ||
currentTip.add("Maximum Output: " + spargeGas.amount + "L"); | ||
return currentTip; | ||
} | ||
for (int i = 2; i < recipe.mFluidOutputs.length; i++) { | ||
if (stack.isItemEqual(GTUtility.getFluidDisplayStack(recipe.mFluidOutputs[i].getFluid()))) { | ||
currentTip.add("Maximum Output: " + maximumByproducts + "L"); | ||
} | ||
} | ||
return currentTip; | ||
} | ||
|
||
@Override | ||
public List<String> handleNEIItemTooltip(ItemStack stack, List<String> currentTip, | ||
GTNEIDefaultHandler.CachedDefaultRecipe neiCachedRecipe) { | ||
GTRecipe recipe = neiCachedRecipe.mRecipe; | ||
for (PositionedStack pStack : neiCachedRecipe.mInputs) { | ||
if (stack == pStack.item) { | ||
if (pStack instanceof GTNEIDefaultHandler.FixedPositionedStack) { | ||
currentTip = handleNEIItemInputTooltip( | ||
currentTip, | ||
(GTNEIDefaultHandler.FixedPositionedStack) pStack); | ||
} | ||
break; | ||
} | ||
} | ||
for (PositionedStack pStack : neiCachedRecipe.mOutputs) { | ||
if (stack == pStack.item) { | ||
if (pStack instanceof GTNEIDefaultHandler.FixedPositionedStack) { | ||
currentTip = handleNEIByproductTooltip(stack, currentTip, recipe); | ||
} | ||
break; | ||
} | ||
} | ||
return currentTip; | ||
} | ||
|
||
} |
Oops, something went wrong.