Move of stuffs
This commit is contained in:
parent
7946a7c226
commit
16efbcf7c5
26 changed files with 0 additions and 0 deletions
127
src/main/java/bloodutils/api/entries/EntryAltarRecipe.java
Normal file
127
src/main/java/bloodutils/api/entries/EntryAltarRecipe.java
Normal file
|
@ -0,0 +1,127 @@
|
|||
package bloodutils.api.entries;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.ShapedRecipes;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe;
|
||||
import bloodutils.api.classes.guide.GuiEntry;
|
||||
|
||||
public class EntryAltarRecipe implements IEntry{
|
||||
public EntryAltarRecipe(AltarRecipe recipes){
|
||||
this.recipes = recipes;
|
||||
populate(recipes);
|
||||
}
|
||||
public AltarRecipe recipes;
|
||||
|
||||
public ItemStack input;
|
||||
public ItemStack output;
|
||||
public int essence;
|
||||
|
||||
public ArrayList<ItemIcon> icons = new ArrayList<ItemIcon>();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void populate(AltarRecipe recipe){
|
||||
this.input = recipe.requiredItem;
|
||||
this.output = recipe.result;
|
||||
this.essence = recipe.liquidRequired;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY){
|
||||
int x, y;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
renderOverlay(entry, width, height, left, top);
|
||||
|
||||
x = left + width / 2 - (65-45);
|
||||
y = (height/2 - 36) + (18*(4-3));
|
||||
drawIcon(this.input, x, y);
|
||||
|
||||
/** Result */
|
||||
x = left + width / 2 - (65-(48+48)-5);
|
||||
y = (height/2 - 36) + (18*(4-3));
|
||||
drawIcon(this.output, x, y);
|
||||
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
for(ItemIcon icon : icons){
|
||||
if(icon.stack != null)
|
||||
icon.onMouseBetween(mX, mY);
|
||||
}
|
||||
}
|
||||
|
||||
public void drawIcon(ItemStack stack, int x, int y){
|
||||
RenderItem ri = new RenderItem();
|
||||
ri.renderItemAndEffectIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, x, y);
|
||||
ri.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, x, y);
|
||||
|
||||
icons.add(new ItemIcon(stack, x, y));
|
||||
}
|
||||
|
||||
public void renderOverlay(GuiEntry entry, int width, int height, int left, int top){
|
||||
TextureManager tm = Minecraft.getMinecraft().getTextureManager();
|
||||
tm.bindTexture(new ResourceLocation("bloodutils:textures/gui/altar.png"));
|
||||
entry.drawTexturedModalRect(left, (height/2 - 36) + (18*0) - 17, 0, 0, width, height);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public void initGui(int width, int height, int left, int top,
|
||||
EntityPlayer player, List buttonList){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(GuiButton button){
|
||||
|
||||
}
|
||||
|
||||
static class ItemIcon {
|
||||
public ItemIcon(ItemStack stack, int x, int y){
|
||||
this.stack = stack;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
public ItemStack stack;
|
||||
public int x, y;
|
||||
|
||||
public void onMouseBetween(int mX, int mY){
|
||||
int xSize = x + 16;
|
||||
int ySize = y + 16;
|
||||
|
||||
|
||||
if(mX > x && mX < xSize && mY > y && mY < ySize){
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
if(stack != null && stack.getDisplayName() != null)
|
||||
Minecraft.getMinecraft().fontRenderer.drawString(stack.getDisplayName(), mX + 6, mY, new Color(139, 137, 137).getRGB());
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
204
src/main/java/bloodutils/api/entries/EntryCraftingRecipe.java
Normal file
204
src/main/java/bloodutils/api/entries/EntryCraftingRecipe.java
Normal file
|
@ -0,0 +1,204 @@
|
|||
package bloodutils.api.entries;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.ShapedRecipes;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe;
|
||||
import bloodutils.api.classes.guide.GuiEntry;
|
||||
|
||||
public class EntryCraftingRecipe implements IEntry{
|
||||
public EntryCraftingRecipe(IRecipe recipes){
|
||||
this.recipes = recipes;
|
||||
populate(recipes);
|
||||
}
|
||||
public IRecipe recipes;
|
||||
|
||||
public ItemStack[] recipe;
|
||||
public ItemStack output;
|
||||
|
||||
public ArrayList<ItemIcon> icons = new ArrayList<ItemIcon>();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void populate(IRecipe recipe){
|
||||
if(recipe instanceof ShapedRecipes){
|
||||
ShapedRecipes rec = (ShapedRecipes)recipe;
|
||||
if(rec != null && rec.recipeItems != null && rec.recipeItems.length > 0){
|
||||
this.recipe = rec.recipeItems;
|
||||
this.output = rec.getRecipeOutput();
|
||||
}
|
||||
}else if(recipe instanceof ShapedOreRecipe){
|
||||
ShapedOreRecipe rec = (ShapedOreRecipe)recipe;
|
||||
this.recipe = new ItemStack[rec.getInput().length];;
|
||||
for(int i = 0; i < rec.getInput().length; i++){
|
||||
ItemStack s = null;
|
||||
if(rec.getInput()[i] instanceof ItemStack){
|
||||
s = (ItemStack)rec.getInput()[i];
|
||||
}else{
|
||||
s = ((ArrayList<ItemStack>)rec.getInput()[i]).get(0);
|
||||
}
|
||||
this.recipe[i] = s;
|
||||
this.output = rec.getRecipeOutput();
|
||||
}
|
||||
}else if(recipe instanceof ShapedBloodOrbRecipe){
|
||||
ShapedBloodOrbRecipe rec = (ShapedBloodOrbRecipe)recipe;
|
||||
this.recipe = new ItemStack[rec.getInput().length];;
|
||||
for(int i = 0; i < rec.getInput().length; i++){
|
||||
ItemStack s = null;
|
||||
if(rec.getInput()[i] instanceof ItemStack){
|
||||
s = (ItemStack)rec.getInput()[i];
|
||||
}else if(rec.getInput()[i] instanceof Object){
|
||||
s = new ItemStack(ModItems.masterBloodOrb);
|
||||
}else{
|
||||
s = ((ArrayList<ItemStack>)rec.getInput()[i]).get(0);
|
||||
}
|
||||
this.recipe[i] = s;
|
||||
this.output = rec.getRecipeOutput();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY){
|
||||
int x, y;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
renderOverlay(entry, width, height, left, top);
|
||||
|
||||
/** Row 1 */
|
||||
x = (left + width / 2) - (65-31);
|
||||
y = (height/2 - 18) + (18*0);
|
||||
drawIcon(0, x, y);
|
||||
|
||||
x = left + width / 2 - (65-48) + 1;
|
||||
y = (height/2 - 18) + (18*(3-3));
|
||||
drawIcon(1, x, y);
|
||||
|
||||
x = left + width / 2 - (65-(48+16)-3);
|
||||
y = (height/2 - 18) + (18*(6-6));
|
||||
drawIcon(2, x, y);
|
||||
|
||||
/** Row 2 */
|
||||
x = (left + width / 2) - (65-31);
|
||||
y = (height/2 - 18) + (18*1);
|
||||
drawIcon(3, x, y);
|
||||
|
||||
x = left + width / 2 - (65-48) + 1;
|
||||
y = (height/2 - 18) + (18*(4-3));
|
||||
drawIcon(4, x, y);
|
||||
|
||||
x = left + width / 2 - (65-(48+16)-3);
|
||||
y = (height/2 - 18) + (18*(7-6));
|
||||
drawIcon(5, x, y);
|
||||
|
||||
/** Row 3 */
|
||||
x = (left + width / 2) - (65-31);
|
||||
y = (height/2 - 18) + (18*2);
|
||||
drawIcon(6, x, y);
|
||||
|
||||
x = left + width / 2 - (65-48) + 1;
|
||||
y = (height/2 - 18) + (18*(5-3));
|
||||
drawIcon(7, x, y);
|
||||
|
||||
x = left + width / 2 - (65-(48+16)-3);
|
||||
y = (height/2 - 18) + (18*(8-6));
|
||||
drawIcon(8, x, y);
|
||||
|
||||
/** Result */
|
||||
x = left + width / 2 - (65-(48+48)-5);
|
||||
y = (height/2 - 18) + (18*(4-3));
|
||||
drawIcon(this.output, x, y);
|
||||
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
for(ItemIcon icon : icons){
|
||||
if(icon.stack != null)
|
||||
icon.onMouseBetween(mX, mY);
|
||||
}
|
||||
}
|
||||
|
||||
public void drawIcon(int entry, int x, int y){
|
||||
RenderItem ri = new RenderItem();
|
||||
if(recipe != null && recipe.length > 0 && recipe[entry] != null){
|
||||
ri.renderItemAndEffectIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), recipe[entry], x, y);
|
||||
ri.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), recipe[entry], x, y);
|
||||
|
||||
icons.add(new ItemIcon(recipe[entry], x, y));
|
||||
}
|
||||
}
|
||||
|
||||
public void drawIcon(ItemStack stack, int x, int y){
|
||||
RenderItem ri = new RenderItem();
|
||||
ri.renderItemAndEffectIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, x, y);
|
||||
ri.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, x, y);
|
||||
|
||||
icons.add(new ItemIcon(stack, x, y));
|
||||
}
|
||||
|
||||
public void renderOverlay(GuiEntry entry, int width, int height, int left, int top){
|
||||
TextureManager tm = Minecraft.getMinecraft().getTextureManager();
|
||||
tm.bindTexture(new ResourceLocation("bloodutils:textures/gui/crafting.png"));
|
||||
entry.drawTexturedModalRect(left, (height/2 - 18) + (18*0) - 17, 0, 0, width, height);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public void initGui(int width, int height, int left, int top,
|
||||
EntityPlayer player, List buttonList){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(GuiButton button){
|
||||
|
||||
}
|
||||
|
||||
static class ItemIcon {
|
||||
public ItemIcon(ItemStack stack, int x, int y){
|
||||
this.stack = stack;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
public ItemStack stack;
|
||||
public int x, y;
|
||||
|
||||
public void onMouseBetween(int mX, int mY){
|
||||
int xSize = x + 16;
|
||||
int ySize = y + 16;
|
||||
|
||||
|
||||
if(mX > x && mX < xSize && mY > y && mY < ySize){
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
if(stack != null && stack.getDisplayName() != null)
|
||||
Minecraft.getMinecraft().fontRenderer.drawString(stack.getDisplayName(), mX + 6, mY, new Color(139, 137, 137).getRGB());
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
73
src/main/java/bloodutils/api/entries/EntryImage.java
Normal file
73
src/main/java/bloodutils/api/entries/EntryImage.java
Normal file
|
@ -0,0 +1,73 @@
|
|||
package bloodutils.api.entries;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import bloodutils.api.classes.guide.GuiEntry;
|
||||
import bloodutils.api.helpers.GuiHelper;
|
||||
|
||||
public class EntryImage implements IEntry{
|
||||
public EntryImage(String resource, int iconWidth, int iconHeight){
|
||||
this.resource = new ResourceLocation(resource);
|
||||
this.iconWidth = iconWidth;
|
||||
this.iconHeight = iconHeight;
|
||||
}
|
||||
public ResourceLocation resource;
|
||||
public int iconWidth;
|
||||
public int iconHeight;
|
||||
|
||||
public EntryImage(String resource, int iconWidth, int iconHeight, String entryName){
|
||||
this.resource = new ResourceLocation(resource);
|
||||
this.iconWidth = iconWidth;
|
||||
this.iconHeight = iconHeight;
|
||||
this.entryName = entryName;
|
||||
}
|
||||
public String entryName;
|
||||
|
||||
|
||||
@Override
|
||||
public void draw(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY){
|
||||
drawImage(entry, width, height, left, top, player, key, page, mX, mY);
|
||||
drawText(entry, width, height, left, top, player, key, page, mX, mY);
|
||||
}
|
||||
|
||||
public void drawImage(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY){
|
||||
int x = left + 32;
|
||||
int y = top + 10;
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(this.resource);
|
||||
|
||||
GuiHelper.drawScaledIconWithoutColor(x, y, this.iconWidth, this.iconHeight, 0);
|
||||
}
|
||||
|
||||
public void drawText(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY){
|
||||
int x, y;
|
||||
|
||||
if(this.entryName == null)
|
||||
this.entryName = key;
|
||||
|
||||
String s = StatCollector.translateToLocal("bu.entry." + this.entryName + "." + page);
|
||||
x = left + width / 2 - 58;
|
||||
y = (top + 15) + 65;
|
||||
|
||||
Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(true);
|
||||
Minecraft.getMinecraft().fontRenderer.drawSplitString(s, x, y, 110, 0);
|
||||
Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(false);
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public void initGui(int width, int height, int left, int top,
|
||||
EntityPlayer player, List buttonList) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(GuiButton button){
|
||||
|
||||
}
|
||||
}
|
90
src/main/java/bloodutils/api/entries/EntryItemText.java
Normal file
90
src/main/java/bloodutils/api/entries/EntryItemText.java
Normal file
|
@ -0,0 +1,90 @@
|
|||
package bloodutils.api.entries;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import bloodutils.api.classes.guide.GuiEntry;
|
||||
|
||||
public class EntryItemText implements IEntry{
|
||||
public EntryItemText(ItemStack stack){
|
||||
this.stack = stack;
|
||||
}
|
||||
public ItemStack stack;
|
||||
|
||||
public EntryItemText(ItemStack stack, String entryName){
|
||||
this.stack = stack;
|
||||
this.entryName = entryName;
|
||||
}
|
||||
public String entryName;
|
||||
|
||||
@Override
|
||||
public void draw(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY){
|
||||
drawText(entry, width, height, left, top, player, key, page, mX, mY);
|
||||
drawBlock(entry, width, height, left, top, player, key, page, mX, mY);
|
||||
}
|
||||
|
||||
public void drawText(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY){
|
||||
int x, y;
|
||||
|
||||
if(this.entryName == null)
|
||||
this.entryName = key;
|
||||
|
||||
String s = StatCollector.translateToLocal("bu.entry." + this.entryName + "." + page);
|
||||
x = left + width / 2 - 58;
|
||||
y = (top + 15);
|
||||
|
||||
Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(true);
|
||||
Minecraft.getMinecraft().fontRenderer.drawSplitString(s, x, y, 110, 0);
|
||||
Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(false);
|
||||
|
||||
}
|
||||
|
||||
public void drawBlock(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY){
|
||||
|
||||
RenderItem ri = new RenderItem();
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glScaled(3, 3, 1);
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
|
||||
ri.renderItemAndEffectIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, left - (left/2) + 2, top + 20);
|
||||
ri.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, left - (left/2) + 2, top + 20);
|
||||
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public void initGui(int width, int height, int left, int top,
|
||||
EntityPlayer player, List buttonList) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(GuiButton button){
|
||||
|
||||
}
|
||||
}
|
38
src/main/java/bloodutils/api/entries/EntryRitualInfo.java
Normal file
38
src/main/java/bloodutils/api/entries/EntryRitualInfo.java
Normal file
|
@ -0,0 +1,38 @@
|
|||
package bloodutils.api.entries;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import bloodutils.api.classes.guide.GuiEntry;
|
||||
|
||||
public class EntryRitualInfo implements IEntry{
|
||||
public EntryRitualInfo(int cost){
|
||||
|
||||
this.cost = cost;
|
||||
}
|
||||
public int cost;
|
||||
|
||||
@Override
|
||||
public void draw(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY){
|
||||
int x, y;
|
||||
x = left + width / 2 - 58;
|
||||
y = (top + 15);
|
||||
Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(true);
|
||||
Minecraft.getMinecraft().fontRenderer.drawString("Cost: " + this.cost + " LP", x, y, 0);
|
||||
Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(false);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public void initGui(int width, int height, int left, int top,
|
||||
EntityPlayer player, List buttonList){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(GuiButton button){
|
||||
|
||||
}
|
||||
}
|
48
src/main/java/bloodutils/api/entries/EntryText.java
Normal file
48
src/main/java/bloodutils/api/entries/EntryText.java
Normal file
|
@ -0,0 +1,48 @@
|
|||
package bloodutils.api.entries;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import bloodutils.api.classes.guide.GuiEntry;
|
||||
|
||||
public class EntryText implements IEntry{
|
||||
public EntryText(){
|
||||
|
||||
}
|
||||
|
||||
public EntryText(String entryName){
|
||||
this.entryName = entryName;
|
||||
}
|
||||
public String entryName;
|
||||
|
||||
@Override
|
||||
public void draw(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY){
|
||||
int x, y;
|
||||
|
||||
if(this.entryName == null)
|
||||
this.entryName = key;
|
||||
|
||||
String s = StatCollector.translateToLocal("bu.entry." + this.entryName + "." + page);
|
||||
x = left + width / 2 - 58;
|
||||
y = (top + 15);
|
||||
|
||||
Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(true);
|
||||
Minecraft.getMinecraft().fontRenderer.drawSplitString(s, x, y, 110, 0);
|
||||
Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(false);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public void initGui(int width, int height, int left, int top,
|
||||
EntityPlayer player, List buttonList){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(GuiButton button){
|
||||
|
||||
}
|
||||
}
|
25
src/main/java/bloodutils/api/entries/IEntry.java
Normal file
25
src/main/java/bloodutils/api/entries/IEntry.java
Normal file
|
@ -0,0 +1,25 @@
|
|||
package bloodutils.api.entries;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import bloodutils.api.classes.guide.GuiEntry;
|
||||
|
||||
public interface IEntry {
|
||||
/**
|
||||
* This get's called in GuiEntry, you can do whatever you want here (images, recipes, icons, text, combination of them)
|
||||
* @param width
|
||||
* @param height
|
||||
* @param left
|
||||
* @param top
|
||||
* @param player
|
||||
* The player who has the book open
|
||||
*/
|
||||
public void draw(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY);
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public void initGui(int width, int height, int left, int top, EntityPlayer player, List buttonList);
|
||||
|
||||
public void actionPerformed(GuiButton button);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue