Misc Fixes

This commit is contained in:
Ellpeck 2015-11-15 18:39:05 +01:00
parent 1ba09afab6
commit 3f9a383b19
3 changed files with 28 additions and 5 deletions

View file

@ -19,6 +19,7 @@ import ellpeck.actuallyadditions.util.ModUtil;
import ellpeck.actuallyadditions.util.StringUtil; import ellpeck.actuallyadditions.util.StringUtil;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -58,7 +59,7 @@ public class BookletPage{
} }
} }
public static void renderItem(GuiBooklet gui, ItemStack stack, int x, int y, float scale){ public static void renderItem(GuiScreen gui, ItemStack stack, int x, int y, float scale){
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
@ -76,7 +77,7 @@ public class BookletPage{
gui.mc.fontRenderer.setUnicodeFlag(flagBefore); gui.mc.fontRenderer.setUnicodeFlag(flagBefore);
GL11.glPopMatrix(); GL11.glPopMatrix();
RenderHelper.disableStandardItemLighting(); //RenderHelper.disableStandardItemLighting();
GL11.glPopMatrix(); GL11.glPopMatrix();
} }

View file

@ -201,6 +201,9 @@ public class CreativeTab extends CreativeTabs{
add(InitItems.itemPantsObsidian); add(InitItems.itemPantsObsidian);
add(InitItems.itemBootsObsidian); add(InitItems.itemBootsObsidian);
add(InitBlocks.blockCrystal);
add(InitItems.itemCrystal);
add(InitItems.itemJams); add(InitItems.itemJams);
add(InitItems.itemPotionRing); add(InitItems.itemPotionRing);

View file

@ -15,10 +15,12 @@ import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.RecipeInfo; import codechicken.nei.recipe.RecipeInfo;
import codechicken.nei.recipe.TemplateRecipeHandler; import codechicken.nei.recipe.TemplateRecipeHandler;
import ellpeck.actuallyadditions.blocks.InitBlocks; import ellpeck.actuallyadditions.blocks.InitBlocks;
import ellpeck.actuallyadditions.booklet.page.BookletPage;
import ellpeck.actuallyadditions.recipe.ReconstructorRecipeHandler; import ellpeck.actuallyadditions.recipe.ReconstructorRecipeHandler;
import ellpeck.actuallyadditions.util.ItemUtil; import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.ModUtil; import ellpeck.actuallyadditions.util.ModUtil;
import ellpeck.actuallyadditions.util.StringUtil; import ellpeck.actuallyadditions.util.StringUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
@ -27,6 +29,7 @@ import org.lwjgl.opengl.GL11;
import java.awt.*; import java.awt.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List;
public class AtomicReconstructorRecipeHandler extends TemplateRecipeHandler implements INeiRecipeHandler{ public class AtomicReconstructorRecipeHandler extends TemplateRecipeHandler implements INeiRecipeHandler{
@ -89,7 +92,7 @@ public class AtomicReconstructorRecipeHandler extends TemplateRecipeHandler impl
@Override @Override
public String getGuiTexture(){ public String getGuiTexture(){
return ModUtil.MOD_ID_LOWER+":textures/gui/guiNEISimple.png"; return ModUtil.MOD_ID_LOWER+":textures/gui/guiNEIAtomicReconstructor.png";
} }
@Override @Override
@ -109,6 +112,13 @@ public class AtomicReconstructorRecipeHandler extends TemplateRecipeHandler impl
GuiDraw.drawTexturedModalRect(32, 0, 0, 0, 96, 60); GuiDraw.drawTexturedModalRect(32, 0, 0, 0, 96, 60);
} }
@Override
public void drawForeground(int recipe){
if(Minecraft.getMinecraft().currentScreen != null){
BookletPage.renderItem(Minecraft.getMinecraft().currentScreen, new ItemStack(InitBlocks.blockAtomicReconstructor), 32+34, 19, 1.0F);
}
}
@Override @Override
public int recipiesPerPage(){ public int recipiesPerPage(){
return 2; return 2;
@ -120,8 +130,17 @@ public class AtomicReconstructorRecipeHandler extends TemplateRecipeHandler impl
public PositionedStack input; public PositionedStack input;
public CachedReconstructorRecipe(String input, String result){ public CachedReconstructorRecipe(String input, String result){
this.result = new PositionedStack(OreDictionary.getOres(result, false), 67+32, 19); List<ItemStack> outputs = OreDictionary.getOres(result, false);
this.input = new PositionedStack(OreDictionary.getOres(input, false), 5+32, 19); for(ItemStack ore : outputs){
ore.stackSize = 1;
}
List<ItemStack> inputs = OreDictionary.getOres(input, false);
for(ItemStack ore : inputs){
ore.stackSize = 1;
}
this.result = new PositionedStack(outputs, 67+32, 19);
this.input = new PositionedStack(inputs, 5+32, 19);
} }
@Override @Override