IndustrialElectrolyzer now uses fluids
IndustrialElectrolyzer now renders fluids in gui IndustrialElectrolyzer recipe handler now renders fluids
This commit is contained in:
parent
6cc1071961
commit
6e74b9197b
6 changed files with 175 additions and 15 deletions
|
@ -1,10 +1,19 @@
|
|||
package techreborn.compat.nei.recipes;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler.CachedRecipe;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.util.IIcon;
|
||||
import techreborn.api.recipe.IBaseRecipeType;
|
||||
import techreborn.api.recipe.machines.GrinderRecipe;
|
||||
import techreborn.api.recipe.machines.IndustrialElectrolyzerRecipe;
|
||||
import techreborn.client.gui.GuiIndustrialElectrolyzer;
|
||||
import techreborn.compat.nei.recipes.GenericRecipeHander.CachedGenericRecipe;
|
||||
import techreborn.util.ItemUtils;
|
||||
import ic2.core.util.DrawUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -60,4 +69,27 @@ public class IndustrialElectrolyzerRecipeHandler extends GenericRecipeHander imp
|
|||
public INeiBaseRecipe getNeiBaseRecipe() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipeIndex) {
|
||||
super.drawBackground(recipeIndex);
|
||||
CachedRecipe recipe = arecipes.get(recipeIndex);
|
||||
if (recipe instanceof CachedGenericRecipe) {
|
||||
if (((CachedGenericRecipe) recipe).recipie instanceof IndustrialElectrolyzerRecipe) {
|
||||
IndustrialElectrolyzerRecipe grinderRecipe = (IndustrialElectrolyzerRecipe) ((CachedGenericRecipe) recipe).recipie;
|
||||
if (grinderRecipe.fluidStack != null) {
|
||||
IIcon fluidIcon = grinderRecipe.fluidStack.getFluid().getIcon();
|
||||
if (fluidIcon != null) {
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
|
||||
int liquidHeight = grinderRecipe.fluidStack.amount * 100 / 16000;
|
||||
DrawUtil.drawRepeated(fluidIcon, 7, 22 + 47 - liquidHeight, 14.0D, liquidHeight, GuiDraw.gui.getZLevel());
|
||||
|
||||
}
|
||||
GuiDraw.drawString(grinderRecipe.fluidStack.amount + "mb of " + grinderRecipe.fluidStack.getLocalizedName(), 14, 135, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue