From 40487f07fa5ef31fde99713c0b842d34a0ba3622 Mon Sep 17 00:00:00 2001 From: OnyxDarkKnight Date: Sun, 31 May 2015 01:44:17 +0100 Subject: - Fixed an issue with the Liquids tab - Changed Entity registration so it only uses 'registerModEntity' to fix potential issues - Added crystal blocks - Changed Jewelry Tab to not override TiCon tabs (sorry TiCon, your system is good, but not for me) - The player renders in the Jewelry GUI (makes it easier for you to see how the jewelry render) - The Pentagram now has an actual effect - The Pentagram now renders beneath your feet when you look down and no longer does it in your inventory; it is also a lot smaller - Working on Structures - Created my own WeightedRandomItem (why isn't this in vanilla?) - Updated the curse API so now people can specify when a curse can be activated (I believe the world is all you need :p) - Some curses can no longer aquired in hardcore (such as Rotten Heart, Midas Touch etc) which would make it impossible to work with and require a total restart of the game (as the only way to get rid of them is by dying to replace them) Hooraaay for proper changelogs! --- .../jewelrycraft/client/AbstractTab.java | 26 +++++++++------------- .../jewelrycraft/client/TabRegistry.java | 22 ++++++++++++------ .../jewelrycraft/client/gui/GuiJewelry.java | 4 ++++ 3 files changed, 29 insertions(+), 23 deletions(-) (limited to 'src/main/java/darkknight/jewelrycraft/client') diff --git a/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java b/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java index 6728181..5ff4d2f 100644 --- a/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java +++ b/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java @@ -9,6 +9,7 @@ import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.*; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import darkknight.jewelrycraft.util.Variables; /** * @author TinkersCOnstruct @@ -16,13 +17,13 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public abstract class AbstractTab extends GuiButton { - ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + ResourceLocation texture = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png"); ItemStack renderStack; RenderItem itemRenderer = new RenderItem(); public AbstractTab(int id, int posX, int posY, ItemStack renderStack) { - super(id, posX, posY, 28, 32, ""); + super(id, posX, posY, 18, 18, ""); this.renderStack = renderStack; } @@ -32,26 +33,24 @@ public abstract class AbstractTab extends GuiButton if (this.visible) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - - int yTexPos = this.enabled ? 3 : 32; - int ySize = this.enabled ? 25 : 32; - int xOffset = this.id == 2 ? 0 : 1; - int yPos = this.yPosition + (this.enabled ? 3 : 0); + int xOffset = this.enabled ? 0 : 8; mc.renderEngine.bindTexture(this.texture); - this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); + this.drawTexturedModalRect(this.xPosition, yPosition, 144 + xOffset, 32, 18, 18); + GL11.glPushMatrix(); RenderHelper.enableGUIStandardItemLighting(); this.zLevel = 100.0F; this.itemRenderer.zLevel = 100.0F; GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL12.GL_RESCALE_NORMAL); - this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); - this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 1, yPosition + 1); + this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 1, yPosition + 1); GL11.glDisable(GL11.GL_LIGHTING); this.itemRenderer.zLevel = 0.0F; this.zLevel = 0.0F; RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); } } @@ -59,12 +58,7 @@ public abstract class AbstractTab extends GuiButton public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) { boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; - - if (inWindow) - { - this.onTabClicked(); - } - + if (inWindow) this.onTabClicked(); return inWindow; } diff --git a/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java b/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java index a264412..6ba37ad 100644 --- a/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java +++ b/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java @@ -39,7 +39,16 @@ public class TabRegistry int ySize = 166; int guiLeft = (event.gui.width - xSize) / 2; int guiTop = (event.gui.height - ySize) / 2; - if (!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60; + if (!mc.thePlayer.getActivePotionEffects().isEmpty()) if (Loader.isModLoaded("NotEnoughItems")){ + try{ + // Check whether NEI is hidden and enabled + Class c = Class.forName("codechicken.nei.NEIClientConfig"); + Object hidden = c.getMethod("isHidden").invoke(null); + Object enabled = c.getMethod("isEnabled").invoke(null); + if (hidden != null && hidden instanceof Boolean && enabled != null && enabled instanceof Boolean) if ((Boolean)hidden || !((Boolean)enabled)) guiLeft += 60; + } + catch(Exception e){} + }else guiLeft += 60; updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); addTabsToList(event.buttonList); } @@ -56,13 +65,13 @@ public class TabRegistry public static void updateTabValues(int cornerX, int cornerY, Class selectedButton) { - int count = 2 + (Loader.isModLoaded("TConstruct") ? 1 : 0); + int count = 1; for(int i = 0; i < tabList.size(); i++){ AbstractTab t = tabList.get(i); if (t.shouldAddToList()){ t.id = count; - t.xPosition = cornerX + (count - 2) * 28; - t.yPosition = cornerY - 28; + t.xPosition = cornerX + 151 + (t.id==1?9:0); + t.yPosition = cornerY + 64; t.enabled = !t.getClass().equals(selectedButton); count++; } @@ -71,8 +80,7 @@ public class TabRegistry public static void addTabsToList(List buttonList) { - for(AbstractTab tab: tabList){ - if (tab.shouldAddToList()) if (!(Loader.isModLoaded("TConstruct") && tab instanceof InventoryTabVanilla) || !tabList.get(1).enabled) buttonList.add(tab); - } + for(AbstractTab tab: tabList) + if (tab.shouldAddToList() && tab.enabled) buttonList.add(tab); } } \ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java index 981fbfd..fc4f15b 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java @@ -2,6 +2,7 @@ package darkknight.jewelrycraft.client.gui; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.gui.inventory.GuiInventory; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import darkknight.jewelrycraft.client.TabJewelry; @@ -36,6 +37,9 @@ public class GuiJewelry extends GuiContainer GL11.glColor3f(1, 1, 1); Minecraft.getMinecraft().getTextureManager().bindTexture(texture); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); + GL11.glPushMatrix(); + GuiInventory.func_147046_a(guiLeft - 24, guiTop + 124, 60, (float)(guiLeft - 24) - mouseX, (float)(guiTop + 124 - 90) - mouseY, this.mc.thePlayer); + GL11.glPopMatrix(); } /** -- cgit v1.2.3