From 208b1f1e0d5faf601b53818b04f6699b2e6cb6bc Mon Sep 17 00:00:00 2001 From: OnyxDarkKnight Date: Tue, 5 May 2015 22:07:10 +0100 Subject: - Working on a GUI showing what curses you get with a description on them - Added a search bar in the Liquids Tab for easier searching - Fixed an issue with golden objects giving errors due to missing default texture - Improved the Infamy Mask to have less parts, thus causing less lag - Improved ingots and ore detection - Fixed certain ores when smelted outputting a different ingot - Necklaces and Rings now render as well - Updated the guide at the Guide item to have the proper link to the mod as well as mention the right people who helped with it - Added a list of the ores that work in the guide - Added a new tab to the guide regarding the ores and the ingots they create - Changed the stun effect caused by rings with feathers as modifiers to be a potion effect instead --- .../client/gui/GuiTabOresToIngots.java | 74 ++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java (limited to 'src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java') diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java new file mode 100644 index 0000000..074ab64 --- /dev/null +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java @@ -0,0 +1,74 @@ +package darkknight.jewelrycraft.client.gui; + +import java.util.HashMap; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.util.JewelrycraftUtil; + +public class GuiTabOresToIngots extends GuiTab +{ + /** + * @param id + */ + public GuiTabOresToIngots(int id) + { + super("Ores to ingots", id); + } + + /** + * @return + */ + @Override + public ItemStack getIcon() + { + return new ItemStack(BlockList.shadowOre); + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = page % 2 == 0 ? 107 : -35; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + int i = 0; + for(ItemStack ore: JewelrycraftUtil.oreToIngot.keySet()){ + if (i >= (page - 1) * 5 && i < page * 5){ + gui.renderItem(ore, gui.getLeft() + xPos + 10, gui.getTop() + 12 + 32 * (i - 5 * (page - 1)), 30f, true, 0, 0, 0); + gui.renderItem(JewelrycraftUtil.oreToIngot.get(ore), gui.getLeft() + xPos + 10, gui.getTop() + 28 + 32 * (i - 5 * (page - 1)), 30f, true, 0, 0, 0); + gui.getFont().drawString(String.format("%-1.18s", ore.getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 2 + 32 * (i - 5 * (page - 1)), 0); + gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.oreToIngot.get(ore).getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 18 + 32 * (i - 5 * (page - 1)), 0); + GL11.glDisable(GL11.GL_LIGHTING); + } + i++; + } + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * @return + */ + @Override + public int getMaxPages() + { + return JewelrycraftUtil.oreToIngot.size() / 5 + 2; + } + + /** + * @param gui + * @param x + * @param y + * @param page + */ + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + {} +} -- cgit v1.2.3