summaryrefslogtreecommitdiff
path: root/src/main/java/darkknight/jewelrycraft/client
diff options
context:
space:
mode:
authorOnyxDarkKnight <sor1n.iliutza16@gmail.com>2015-05-05 22:07:10 +0100
committerOnyxDarkKnight <sor1n.iliutza16@gmail.com>2015-05-05 22:07:10 +0100
commit208b1f1e0d5faf601b53818b04f6699b2e6cb6bc (patch)
tree56c059b812f1917b582e65e7ef15faa70a429f0b /src/main/java/darkknight/jewelrycraft/client
parent80417b99e10a462fd72b8f8fcd3b226c862534e4 (diff)
- 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
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/client')
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java58
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java5
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java5
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java12
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java6
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java74
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerCurseInfo.java23
7 files changed, 177 insertions, 6 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java
new file mode 100644
index 0000000..5489911
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java
@@ -0,0 +1,58 @@
+package darkknight.jewelrycraft.client.gui;
+
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.input.Mouse;
+import org.lwjgl.opengl.GL11;
+import net.minecraft.client.gui.GuiScreen;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.world.World;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.api.Curse;
+import darkknight.jewelrycraft.events.PlayerRenderHandler;
+import darkknight.jewelrycraft.events.ScreenHandler;
+import darkknight.jewelrycraft.network.PacketRequestPlayerInfo;
+import darkknight.jewelrycraft.network.PacketSendServerPlayersInfo;
+import darkknight.jewelrycraft.util.PlayerUtils;
+import darkknight.jewelrycraft.util.Variables;
+
+public class GuiCurseInfo extends GuiScreen
+{
+ World world;
+ EntityPlayer player;
+
+ public GuiCurseInfo(Container container, World world, EntityPlayer player)
+ {
+ super();
+ this.world = world;
+ this.player = player;
+ }
+
+ public void drawScreen(int x, int y, float size)
+ {
+ super.drawScreen(x, y, size);
+ this.drawGradientRect(0, 0, this.width, this.height, -1072689136, -804253680);
+ int ind = 0;
+ if (player != null){
+ NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID);
+ if (!playerInfo.hasNoTags()){
+ for(Curse curse: Curse.getCurseList())
+ if (playerInfo.getInteger(curse.getName()) > 0){
+ int halfDescrSize = fontRendererObj.getStringWidth(curse.getDescription()) / 2;
+ mc.renderEngine.bindTexture(Variables.MISC_TEXTURE);
+ this.drawRect(0, 12 + ind * 34, this.width, 10 + (ind + 1) * 34, 0xff000000);
+ mc.renderEngine.bindTexture(new ResourceLocation(Variables.MODID, "textures/gui/" + curse.getTexturePack() + ".png"));
+ int tag = curse.getTextureID();
+ GL11.glColor3f(1F, 1F, 1F);
+ drawTexturedModalRect(this.width/2 - halfDescrSize - 35, 12 + ind * 34, tag % 8 * 32, tag / 8 * 32, 32, 32);
+ this.drawString(fontRendererObj, curse.getName().substring(curse.getName().indexOf(':') + 1), this.width/2 - halfDescrSize, 20 + ind * 34, 0xffff00);
+ this.drawCenteredString(fontRendererObj, curse.getDescription(), this.width/2, 30 + ind * 34, 0xffffff);
+ ind++;
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java
index b3cfef4..48542f8 100644
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java
@@ -40,7 +40,7 @@ public class GuiGuide extends GuiContainer
rot = 0;
del = 0;
this.world = world;
- tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)};
+ tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabOresToIngots(4), new GuiTabModifiers(5), new GuiTabRitual(6)};
activeTab = tabs[0];
pageTexture = pageTex;
flippedPageTexture = flipPageTex;
@@ -151,6 +151,9 @@ public class GuiGuide extends GuiContainer
GL11.glScalef(1.2F, 1.2F, 1.2F);
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
GL11.glTranslatef(0F, 0.05F, 0F);
+ }else if (item.isItemEqual(new ItemStack(BlockList.shadowOre))){
+ GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
+ GL11.glTranslatef(0F, 0.13F, 0F);
}else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting();
if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java
index d04fd73..b9427d7 100644
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java
@@ -9,6 +9,7 @@ import cpw.mods.fml.common.network.IGuiHandler;
import cpw.mods.fml.common.network.NetworkRegistry;
import darkknight.jewelrycraft.JewelrycraftMod;
import darkknight.jewelrycraft.client.JewelryInventory;
+import darkknight.jewelrycraft.client.gui.container.ContainerCurseInfo;
import darkknight.jewelrycraft.client.gui.container.ContainerGuide;
import darkknight.jewelrycraft.client.gui.container.ContainerJewelryModifier;
import darkknight.jewelrycraft.client.gui.container.ContainerJewelryTab;
@@ -53,6 +54,8 @@ public class GuiHandler implements IGuiHandler
return new ContainerJewelryTab(player, player.inventory, new JewelryInventory(player));
case 3:
return new ContainerJewelryModifier(player.inventory, new InventoryBasic("ItemModifier", false, 37));
+ case 4:
+ return new ContainerCurseInfo();
default:
return null;
}
@@ -80,6 +83,8 @@ public class GuiHandler implements IGuiHandler
return new GuiJewelry(new ContainerJewelryTab(player, player.inventory, new JewelryInventory(player)), jewelryInvTexture);
case 3:
return new GuiJewelryModifier((ContainerJewelryModifier)getServerGuiElement(ID, player, world, x, y, z), jewlryModTexture);
+ case 4:
+ return new GuiCurseInfo((ContainerCurseInfo)getServerGuiElement(ID, player, world, x, y, z), world, player);
default:
return null;
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java
index b66f192..4648ecd 100644
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java
@@ -14,7 +14,7 @@ public class GuiTabGemsAndIngots extends GuiTab
*/
public GuiTabGemsAndIngots(int id)
{
- super("Gems and ingots", id);
+ super("Gems, ores and ingots", id);
}
/**
@@ -53,6 +53,14 @@ public class GuiTabGemsAndIngots extends GuiTab
gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.metal.get(i).copy().getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16 * (i - 9 * (page - 1)), 0);
GL11.glDisable(GL11.GL_LIGHTING);
}
+ page -= JewelrycraftUtil.metal.size() / 9 + 1;
+ for(int i = (page - 1) * 9; i < page * 9; i++)
+ if (i < JewelrycraftUtil.ores.size() && page > 0){
+ gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Ores", gui.getLeft() + xPos + 40, gui.getTop(), 0);
+ gui.renderItem(JewelrycraftUtil.ores.get(i).copy(), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16 * (i - 9 * (page - 1)), 30f, true, 0, 0, 0);
+ gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.ores.get(i).copy().getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16 * (i - 9 * (page - 1)), 0);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ }
GL11.glDisable(GL11.GL_BLEND);
}
@@ -62,7 +70,7 @@ public class GuiTabGemsAndIngots extends GuiTab
@Override
public int getMaxPages()
{
- return JewelrycraftUtil.gem.size() / 9 + JewelrycraftUtil.metal.size() / 9 + 2;
+ return JewelrycraftUtil.gem.size() / 9 + JewelrycraftUtil.metal.size() / 9 + JewelrycraftUtil.ores.size() / 9 + 4;
}
/**
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java
index 6d7ee04..efbea61 100644
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java
@@ -108,11 +108,11 @@ public class GuiTabItems extends GuiTab
case 13:
String link = "HERE";
if (x >= gui.getLeft() && x <= gui.getLeft() + 30 && y >= gui.getTop() + 104 && y <= gui.getTop() + 124) link = EnumChatFormatting.DARK_BLUE + "HERE" + EnumChatFormatting.BLACK;
- text = "installing it so you can see all the recipes. Since you are reading this, how about making a youtube video spotlighting this mod. I'd really appreciate it. After that you can share it in the main thread " + link + "." + " This mod was made by DarkKnight (or sor1n, depends";
+ text = "installing it so you can see all the recipes. Since you are reading this, how about making a youtube video spotlighting this mod. I'd really appreciate it. After that you can share it in the main thread " + link + "." + " This mod was made by OnyxDarkKnight and the help of domi1819,";
Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
break;
case 14:
- text = "where you got this mod from) and the help of domi1819 and bspkrs.";
+ text = "pau101 and Damien Hazard.";
Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
break;
case 15:
@@ -157,7 +157,7 @@ public class GuiTabItems extends GuiTab
public void mouseClick(GuiGuide gui, int x, int y, int button)
{
if (gui.page == 13 && x >= gui.getLeft() && x <= gui.getLeft() + 30 && y >= gui.getTop() + 104 && y <= gui.getTop() + 124) try{
- Desktop.getDesktop().browse(new URL("http://www.minecraftforum.net/topic/2210959-164smp-ssp-jewelrycraft-version-12/").toURI());
+ Desktop.getDesktop().browse(new URL("http://www.minecraftforum.net/forums/topics/2414865").toURI());
}
catch(Exception e){}
}
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)
+ {}
+}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerCurseInfo.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerCurseInfo.java
new file mode 100644
index 0000000..24588bd
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerCurseInfo.java
@@ -0,0 +1,23 @@
+package darkknight.jewelrycraft.client.gui.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.ICrafting;
+
+public class ContainerCurseInfo extends Container
+{
+ public ContainerCurseInfo()
+ {}
+
+ @Override
+ public void addCraftingToCrafters(ICrafting c)
+ {
+ return;
+ }
+
+ @Override
+ public boolean canInteractWith(EntityPlayer entityplayer)
+ {
+ return true;
+ }
+} \ No newline at end of file