mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-26 23:13:09 +00:00
Pages for Mana Infusion recipes.
This commit is contained in:
1 parent
f14d5a4186
commit
2710ecfadd
10 files changed
+240
-86
No files matched your search
@@ -33,6 +33,10 @@ public class RecipeManaInfusion {
|
||||
String oredict = OreDictionary.getOreName(OreDictionary.getOreID(stack));
|
||||
return oredict.equals(input);
|
||||
}
|
||||
|
||||
public Object getInput() {
|
||||
return input;
|
||||
}
|
||||
|
||||
public ItemStack getOutput() {
|
||||
return output;
|
||||
|
||||
@@ -16,6 +16,7 @@ import java.awt.Color;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
@@ -46,9 +47,8 @@ public final class HUDHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void drawSimpleManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res) {
|
||||
// String filling = StatCollector.translateToLocal("botaniamisc.status" + type);
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
@@ -59,17 +59,8 @@ public final class HUDHandler {
|
||||
|
||||
x = res.getScaledWidth() / 2 - 51;
|
||||
y += 10;
|
||||
|
||||
GL11.glColor4f(1F, 1F, 1F, 0.5F);
|
||||
mc.renderEngine.bindTexture(manaBar);
|
||||
RenderHelper.drawTexturedModalRect(x, y, 0, 0, 0, 102, 5);
|
||||
|
||||
int manaPercentage = Math.max(0, (int) ((double) mana / (double) maxMana * 100));
|
||||
RenderHelper.drawTexturedModalRect(x + 1 + manaPercentage, y + 1, 0, 0, 5, 100 - manaPercentage, 3);
|
||||
|
||||
Color color_ = new Color(color);
|
||||
GL11.glColor4ub((byte) color_.getRed(), (byte) color_.getGreen(),(byte) color_.getBlue(), (byte) 127);
|
||||
RenderHelper.drawTexturedModalRect(x + 1, y + 1, 0, 0, 5, manaPercentage, 3);
|
||||
renderManaBar(x, y, color, 0.5F, mana, maxMana);
|
||||
|
||||
if(mana < 0) {
|
||||
String text = StatCollector.translateToLocal("botaniamisc.statusUnknown");
|
||||
@@ -80,4 +71,19 @@ public final class HUDHandler {
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
|
||||
public static void renderManaBar(int x, int y, int color, float alpha, int mana, int maxMana) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
GL11.glColor4f(1F, 1F, 1F, alpha);
|
||||
mc.renderEngine.bindTexture(manaBar);
|
||||
RenderHelper.drawTexturedModalRect(x, y, 0, 0, 0, 102, 5);
|
||||
|
||||
int manaPercentage = Math.max(0, (int) ((double) mana / (double) maxMana * 100));
|
||||
RenderHelper.drawTexturedModalRect(x + 1 + manaPercentage, y + 1, 0, 0, 5, 100 - manaPercentage, 3);
|
||||
|
||||
Color color_ = new Color(color);
|
||||
GL11.glColor4ub((byte) color_.getRed(), (byte) color_.getGreen(),(byte) color_.getBlue(), (byte) (255F * alpha));
|
||||
RenderHelper.drawTexturedModalRect(x + 1, y + 1, 0, 0, 5, manaPercentage, 3);
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,7 @@ public final class LibResources {
|
||||
public static final String GUI_MANA_HUD = PREFIX_GUI + "manaHud.png";
|
||||
public static final String GUI_LEXICON = PREFIX_GUI + "lexicon.png";
|
||||
public static final String GUI_CRAFTING_OVERLAY = PREFIX_GUI + "craftingOverlay.png";
|
||||
public static final String GUI_MANA_INFUSION_OVERLAY = PREFIX_GUI + "manaInfusionOverlay.png";
|
||||
|
||||
public static final String ENTRY_FLOWERS = PREFIX_ENTRIES + "flowers.png";
|
||||
public static final String ENTRY_APOTHECARY = PREFIX_ENTRIES + "apothecary.png";
|
||||
|
||||
@@ -16,8 +16,10 @@ import vazkii.botania.api.lexicon.LexiconCategory;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.crafting.ModCrafingRecipes;
|
||||
import vazkii.botania.common.crafting.ModManaInfusionRecipes;
|
||||
import vazkii.botania.common.lexicon.page.PageCraftingRecipe;
|
||||
import vazkii.botania.common.lexicon.page.PageImage;
|
||||
import vazkii.botania.common.lexicon.page.PageManaInfusionRecipe;
|
||||
import vazkii.botania.common.lexicon.page.PageText;
|
||||
import vazkii.botania.common.lib.LibLexicon;
|
||||
|
||||
@@ -35,6 +37,8 @@ public final class LexiconData {
|
||||
public static LexiconEntry apothecary;
|
||||
public static LexiconEntry lexicon;
|
||||
public static LexiconEntry wand;
|
||||
|
||||
public static LexiconEntry pool;
|
||||
|
||||
public static void init() {
|
||||
BotaniaAPI.addCategory(categoryBasics = new LexiconCategory(LibLexicon.CATEGORY_BASICS));
|
||||
@@ -57,6 +61,10 @@ public final class LexiconData {
|
||||
|
||||
wand = new BLexiconEntry(LibLexicon.BASICS_WAND, categoryBasics);
|
||||
wand.setPriority().setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipesTwigWand));
|
||||
|
||||
// MANA ENTRIES
|
||||
pool = new BLexiconEntry(LibLexicon.MANA_POOL, categoryMana);
|
||||
pool.setPriority().setLexiconPages(new PageText("0"), new PageManaInfusionRecipe("1", ModManaInfusionRecipes.manaPetalRecipes));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,31 +16,25 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.ShapedRecipes;
|
||||
import net.minecraft.item.crafting.ShapelessRecipes;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.internal.IGuiLexiconEntry;
|
||||
import vazkii.botania.api.lexicon.LexiconPage;
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
|
||||
public class PageCraftingRecipe extends LexiconPage {
|
||||
public class PageCraftingRecipe extends PageRecipe {
|
||||
|
||||
private static final ResourceLocation craftingOverlay = new ResourceLocation(LibResources.GUI_CRAFTING_OVERLAY);
|
||||
|
||||
@@ -48,12 +42,8 @@ public class PageCraftingRecipe extends LexiconPage {
|
||||
int ticksElapsed = 0;
|
||||
int recipeAt = 0;
|
||||
|
||||
int relativeMouseX, relativeMouseY;
|
||||
|
||||
boolean oreDictRecipe, shapelessRecipe;
|
||||
|
||||
ItemStack tooltipStack, tooltipContainerStack;
|
||||
|
||||
public PageCraftingRecipe(String unlocalizedName, List<IRecipe> recipes) {
|
||||
super(unlocalizedName);
|
||||
this.recipes = recipes;
|
||||
@@ -65,10 +55,17 @@ public class PageCraftingRecipe extends LexiconPage {
|
||||
|
||||
@Override
|
||||
public void renderScreen(IGuiLexiconEntry gui, int mx, int my) {
|
||||
relativeMouseX = mx;
|
||||
relativeMouseY = my;
|
||||
super.renderScreen(gui, mx, my);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderRecipe(IGuiLexiconEntry gui, int mx, int my) {
|
||||
oreDictRecipe = shapelessRecipe = false;
|
||||
|
||||
IRecipe recipe = recipes.get(recipeAt);
|
||||
renderCraftingRecipe(gui, recipe);
|
||||
|
||||
|
||||
TextureManager render = Minecraft.getMinecraft().renderEngine;
|
||||
render.bindTexture(craftingOverlay);
|
||||
|
||||
@@ -77,20 +74,12 @@ public class PageCraftingRecipe extends LexiconPage {
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
((GuiScreen) gui).drawTexturedModalRect(gui.getLeft(), gui.getTop(), 0, 0, gui.getWidth(), gui.getHeight());
|
||||
|
||||
IRecipe recipe = recipes.get(recipeAt);
|
||||
renderCraftingRecipe(gui, recipe);
|
||||
|
||||
int width = gui.getWidth() - 30;
|
||||
int height = gui.getHeight();
|
||||
int x = gui.getLeft() + 16;
|
||||
int y = gui.getTop() + height - 40;
|
||||
PageText.renderText(x, y, width, height, getUnlocalizedName());
|
||||
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
render.bindTexture(craftingOverlay);
|
||||
int iconX = gui.getLeft() + 115;
|
||||
int iconY = gui.getTop() + 12;
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
if(shapelessRecipe) {
|
||||
((GuiScreen) gui).drawTexturedModalRect(iconX, iconY, 240, 0, 16, 16);
|
||||
|
||||
@@ -102,22 +91,13 @@ public class PageCraftingRecipe extends LexiconPage {
|
||||
|
||||
render.bindTexture(craftingOverlay);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
|
||||
|
||||
if(oreDictRecipe) {
|
||||
((GuiScreen) gui).drawTexturedModalRect(iconX, iconY, 240, 16, 16, 16);
|
||||
|
||||
if(mx >= iconX && my >= iconY && mx < iconX + 16 && my < iconY + 16)
|
||||
RenderHelper.renderTooltip(mx, my, Arrays.asList(StatCollector.translateToLocal("botaniamisc.oredict")));
|
||||
}
|
||||
|
||||
if(tooltipStack != null) {
|
||||
List<String> tooltipData = tooltipStack.getTooltip(Minecraft.getMinecraft().thePlayer, false);
|
||||
|
||||
RenderHelper.renderTooltip(mx, my, tooltipData);
|
||||
if(tooltipContainerStack != null)
|
||||
RenderHelper.renderTooltipGreen(mx, my + 8 + tooltipData.size() * 11, Arrays.asList(EnumChatFormatting.AQUA + StatCollector.translateToLocal("botaniamisc.craftingContainer"), tooltipContainerStack.getDisplayName()));
|
||||
}
|
||||
tooltipStack = tooltipContainerStack = null;
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
|
||||
@@ -191,43 +171,4 @@ public class PageCraftingRecipe extends LexiconPage {
|
||||
|
||||
renderItemAtGridPos(gui, 2, 0, recipe.getRecipeOutput(), false);
|
||||
}
|
||||
|
||||
public void renderItemAtGridPos(IGuiLexiconEntry gui, int x, int y, ItemStack stack, boolean accountForContainer) {
|
||||
if(stack == null || stack.getItem() == null)
|
||||
return;
|
||||
stack = stack.copy();
|
||||
|
||||
if(stack.getItemDamage() == Short.MAX_VALUE)
|
||||
stack.setItemDamage(0);
|
||||
|
||||
int xPos = gui.getLeft() + x * 29 + 7;
|
||||
int yPos = gui.getTop() + y * 29 + 24 - (y == 0 ? 7 : 0);
|
||||
ItemStack stack1 = stack.copy();
|
||||
if(stack1.getItemDamage() == -1)
|
||||
stack1.setItemDamage(0);
|
||||
|
||||
renderItem(gui, xPos, yPos, stack1, accountForContainer);
|
||||
}
|
||||
|
||||
public void renderItem(IGuiLexiconEntry gui, int xPos, int yPos, ItemStack stack, boolean accountForContainer) {
|
||||
RenderItem render = new RenderItem();
|
||||
TextureManager renderEngine = Minecraft.getMinecraft().renderEngine;
|
||||
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
|
||||
|
||||
if(!ForgeHooksClient.renderInventoryItem(new RenderBlocks(), renderEngine, stack, render.renderWithColor, gui.getZLevel(), xPos, yPos))
|
||||
render.renderItemIntoGUI(fontRenderer, renderEngine, stack, xPos, yPos);
|
||||
render.renderItemOverlayIntoGUI(fontRenderer, renderEngine, stack, xPos, yPos);
|
||||
|
||||
if(relativeMouseX >= xPos && relativeMouseY >= yPos && relativeMouseX <= xPos + 16 && relativeMouseY <= yPos + 16) {
|
||||
tooltipStack = stack;
|
||||
if(accountForContainer) {
|
||||
ItemStack containerStack = stack.getItem().getContainerItemStack(stack);
|
||||
if(containerStack != null && containerStack.getItem() != null)
|
||||
tooltipContainerStack = containerStack;
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,6 +11,84 @@
|
||||
*/
|
||||
package vazkii.botania.common.lexicon.page;
|
||||
|
||||
public class PageManaInfusionRecipe {
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.internal.IGuiLexiconEntry;
|
||||
import vazkii.botania.api.recipe.RecipeManaInfusion;
|
||||
import vazkii.botania.client.core.handler.HUDHandler;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.TilePool;
|
||||
|
||||
public class PageManaInfusionRecipe extends PageRecipe {
|
||||
|
||||
private static final ResourceLocation manaInfusionOverlay = new ResourceLocation(LibResources.GUI_MANA_INFUSION_OVERLAY);
|
||||
|
||||
List<RecipeManaInfusion> recipes;
|
||||
int ticksElapsed = 0;
|
||||
int recipeAt = 0;
|
||||
|
||||
public PageManaInfusionRecipe(String unlocalizedName, List<RecipeManaInfusion> recipes) {
|
||||
super(unlocalizedName);
|
||||
this.recipes = recipes;
|
||||
}
|
||||
|
||||
public PageManaInfusionRecipe(String unlocalizedName, RecipeManaInfusion recipe) {
|
||||
this(unlocalizedName, Arrays.asList(recipe));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderRecipe(IGuiLexiconEntry gui, int mx, int my) {
|
||||
RecipeManaInfusion recipe = recipes.get(recipeAt);
|
||||
TextureManager render = Minecraft.getMinecraft().renderEngine;
|
||||
FontRenderer font = Minecraft.getMinecraft().fontRenderer;
|
||||
|
||||
Object input = recipe.getInput();
|
||||
if(input instanceof String)
|
||||
input = OreDictionary.getOres((String) input).get(0);
|
||||
|
||||
renderItemAtGridPos(gui, 1, 1, (ItemStack) input, false);
|
||||
renderItemAtGridPos(gui, 2, 1, new ItemStack(ModBlocks.pool), false);
|
||||
renderItemAtGridPos(gui, 3, 1, recipe.getOutput(), false);
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
String manaUsage = StatCollector.translateToLocal("botaniamisc.manaUsage");
|
||||
font.drawString(manaUsage, gui.getLeft() + gui.getWidth() / 2 - font.getStringWidth(manaUsage) / 2, gui.getTop() + 105, 0x66000000);
|
||||
|
||||
HUDHandler.renderManaBar(gui.getLeft() + gui.getWidth() / 2 - 50, gui.getTop() + 115, 0x0000FF, 0.75F, recipe.getManaToConsume(), TilePool.MAX_MANA / 10);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
render.bindTexture(manaInfusionOverlay);
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
((GuiScreen) gui).drawTexturedModalRect(gui.getLeft(), gui.getTop(), 0, 0, gui.getWidth(), gui.getHeight());
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateScreen() {
|
||||
if(ticksElapsed % 20 == 0) {
|
||||
recipeAt++;
|
||||
|
||||
if(recipeAt == recipes.size())
|
||||
recipeAt = 0;
|
||||
}
|
||||
++ticksElapsed;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* File Created @ [Feb 8, 2014, 2:46:36 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.lexicon.page;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.internal.IGuiLexiconEntry;
|
||||
import vazkii.botania.api.lexicon.LexiconPage;
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
|
||||
public class PageRecipe extends LexiconPage {
|
||||
|
||||
int relativeMouseX, relativeMouseY;
|
||||
ItemStack tooltipStack, tooltipContainerStack;
|
||||
|
||||
public PageRecipe(String unlocalizedName) {
|
||||
super(unlocalizedName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderScreen(IGuiLexiconEntry gui, int mx, int my) {
|
||||
relativeMouseX = mx;
|
||||
relativeMouseY = my;
|
||||
|
||||
renderRecipe(gui, mx, my);
|
||||
|
||||
int width = gui.getWidth() - 30;
|
||||
int height = gui.getHeight();
|
||||
int x = gui.getLeft() + 16;
|
||||
int y = gui.getTop() + height - 40;
|
||||
PageText.renderText(x, y, width, height, getUnlocalizedName());
|
||||
|
||||
if(tooltipStack != null) {
|
||||
List<String> tooltipData = tooltipStack.getTooltip(Minecraft.getMinecraft().thePlayer, false);
|
||||
|
||||
RenderHelper.renderTooltip(mx, my, tooltipData);
|
||||
if(tooltipContainerStack != null)
|
||||
RenderHelper.renderTooltipGreen(mx, my + 8 + tooltipData.size() * 11, Arrays.asList(EnumChatFormatting.AQUA + StatCollector.translateToLocal("botaniamisc.craftingContainer"), tooltipContainerStack.getDisplayName()));
|
||||
}
|
||||
tooltipStack = tooltipContainerStack = null;
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
|
||||
public void renderRecipe(IGuiLexiconEntry gui, int mx, int my) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
public void renderItemAtGridPos(IGuiLexiconEntry gui, int x, int y, ItemStack stack, boolean accountForContainer) {
|
||||
if(stack == null || stack.getItem() == null)
|
||||
return;
|
||||
stack = stack.copy();
|
||||
|
||||
if(stack.getItemDamage() == Short.MAX_VALUE)
|
||||
stack.setItemDamage(0);
|
||||
|
||||
int xPos = gui.getLeft() + x * 29 + 7;
|
||||
int yPos = gui.getTop() + y * 29 + 24 - (y == 0 ? 7 : 0);
|
||||
ItemStack stack1 = stack.copy();
|
||||
if(stack1.getItemDamage() == -1)
|
||||
stack1.setItemDamage(0);
|
||||
|
||||
renderItem(gui, xPos, yPos, stack1, accountForContainer);
|
||||
}
|
||||
|
||||
public void renderItem(IGuiLexiconEntry gui, int xPos, int yPos, ItemStack stack, boolean accountForContainer) {
|
||||
RenderItem render = new RenderItem();
|
||||
TextureManager renderEngine = Minecraft.getMinecraft().renderEngine;
|
||||
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
|
||||
|
||||
// Translations required so the glint doesn't merge with the book texture
|
||||
GL11.glTranslatef(0F, 0F, 200F);
|
||||
if(!ForgeHooksClient.renderInventoryItem(new RenderBlocks(), renderEngine, stack, render.renderWithColor, gui.getZLevel(), xPos, yPos))
|
||||
render.renderItemIntoGUI(fontRenderer, renderEngine, stack, xPos, yPos);
|
||||
render.renderItemOverlayIntoGUI(fontRenderer, renderEngine, stack, xPos, yPos);
|
||||
GL11.glTranslatef(0F, 0F, -200F);
|
||||
|
||||
if(relativeMouseX >= xPos && relativeMouseY >= yPos && relativeMouseX <= xPos + 16 && relativeMouseY <= yPos + 16) {
|
||||
tooltipStack = stack;
|
||||
if(accountForContainer) {
|
||||
ItemStack containerStack = stack.getItem().getContainerItemStack(stack);
|
||||
if(containerStack != null && containerStack.getItem() != null)
|
||||
tooltipContainerStack = containerStack;
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,5 +27,7 @@ public final class LibLexicon {
|
||||
public static final String BASICS_APOTHECARY = "apothecary";
|
||||
public static final String BASICS_LEXICON = "lexicon";
|
||||
public static final String BASICS_WAND = "wand";
|
||||
|
||||
public static final String MANA_POOL = "pool";
|
||||
|
||||
}
|
||||
@@ -8,6 +8,7 @@ botaniamisc.shapeless=Shapeless Recipe
|
||||
botaniamisc.oredict=Ore Dictionary Recipe
|
||||
botaniamisc.statusUnknown=Unknown Status
|
||||
botaniamisc.color=%s Tinted
|
||||
botaniamisc.manaUsage=Mana Usage
|
||||
|
||||
# COLORS
|
||||
botania.color0=White
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
Reference in new issue
Block a user