summaryrefslogtreecommitdiff
path: root/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java
diff options
context:
space:
mode:
authorOnyxDarkKnight <sor1n.iliutza16@gmail.com>2015-05-31 01:44:17 +0100
committerOnyxDarkKnight <sor1n.iliutza16@gmail.com>2015-05-31 01:44:17 +0100
commit40487f07fa5ef31fde99713c0b842d34a0ba3622 (patch)
tree2accdb69c2507acd794d5009d520b2255763751b /src/main/java/darkknight/jewelrycraft/client/TabRegistry.java
parentc5dfb2ef7353f13d71d8d582aa6d240420ed9ce7 (diff)
- 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!
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/client/TabRegistry.java')
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/TabRegistry.java22
1 files changed, 15 insertions, 7 deletions
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