From 01c8701b68986ccfa83e902515716838d6829311 Mon Sep 17 00:00:00 2001 From: Onyx Date: Tue, 1 Dec 2015 20:55:30 +0000 Subject: - Fixed all of the bugs mentioned on github - Added new config options - Rabbits paw now increases the chance of spawning hearts, rather than itself spawning some - Hearts now have a much lower chance to spawn by default - You can no longer increase your health past 20 hearts (aka double the default health) - The guide now also shows the total number of pages on each tab - A new luck stat has been added to the Curse API - Cleaned up the code a bit (removed unused methods, imports etc) - The displayer's info now has a purple solid color background; the text also has a much closer shadow and now shrinks in height as well as in width when too big - I have modified the potion list to use Mithion's code, credits have been given --- .../client/gui/GuiTabOresToIngots.java | 159 ++++++++++----------- 1 file changed, 78 insertions(+), 81 deletions(-) (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 index b7f192d..a0b0e4b 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java @@ -1,81 +1,78 @@ -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 net.minecraft.util.StatCollector; -import org.lwjgl.opengl.GL11; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.Variables; - -public class GuiTabOresToIngots extends GuiTab -{ - /** - * @param id - */ - public GuiTabOresToIngots(int id) - { - super(id); - } - - public String getName() - { - return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.oretoingot"); - } - - /** - * @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) - {} -} +package darkknight.jewelrycraft.client.gui; + +import org.lwjgl.opengl.GL11; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.util.JewelrycraftUtil; +import darkknight.jewelrycraft.util.Variables; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; + +public class GuiTabOresToIngots extends GuiTab +{ + /** + * @param id + */ + public GuiTabOresToIngots(int id) + { + super(id); + } + + public String getName() + { + return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.oretoingot"); + } + + /** + * @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