fixes #31 , Fixes crash without bop or natura installed, fixes npe with no plup item, adds basic fluid gui support to the nei handler, fixes build craft 6 not working
This commit is contained in:
parent
fbde3bcaf0
commit
7308507a74
7 changed files with 239 additions and 120 deletions
|
@ -1,8 +1,15 @@
|
|||
package techreborn.compat.nei.recipes;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import ic2.core.util.DrawUtil;
|
||||
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.IndustrialSawmillRecipe;
|
||||
import techreborn.client.gui.GuiIndustrialSawmill;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -56,4 +63,32 @@ public class IndustrialSawmillRecipeHandler extends GenericRecipeHander implemen
|
|||
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 IndustrialSawmillRecipe) {
|
||||
IndustrialSawmillRecipe sawmillRecipe = (IndustrialSawmillRecipe) ((CachedGenericRecipe) recipe).recipie;
|
||||
if (sawmillRecipe.fluidStack != null) {
|
||||
IIcon fluidIcon = sawmillRecipe.fluidStack.getFluid().getIcon();
|
||||
if (fluidIcon != null) {
|
||||
// GuiDraw.drawRect(7, 16, 176, 31, 0);
|
||||
// drawTexturedModalRect(k + 7, l + 15, 176, 31, 20, 55);
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
|
||||
int liquidHeight = sawmillRecipe.fluidStack.amount * 47 / 16000;
|
||||
DrawUtil.drawRepeated(fluidIcon, 11, 19 + 47 - liquidHeight, 12.0D, liquidHeight, GuiDraw.gui.getZLevel());
|
||||
|
||||
|
||||
// this.mc.renderEngine.bindTexture(texture);
|
||||
// drawTexturedModalRect(k + 11, l + 19, 176, 86, 12, 47);
|
||||
}
|
||||
GuiDraw.drawString(sawmillRecipe.fluidStack.amount + "mb of " + sawmillRecipe.fluidStack.getLocalizedName(), 14, 124, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue