mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 11:59:25 +00:00
98 lines
2.5 KiB
Diff
98 lines
2.5 KiB
Diff
--- ../src-base/minecraft/net/minecraft/creativetab/CreativeTabs.java
|
|
+++ ../src-work/minecraft/net/minecraft/creativetab/CreativeTabs.java
|
|
@@ -131,8 +131,22 @@
|
|
private EnumEnchantmentType[] field_111230_s = new EnumEnchantmentType[0];
|
|
private ItemStack field_151245_t;
|
|
|
|
+ public CreativeTabs(String label)
|
|
+ {
|
|
+ this(getNextID(), label);
|
|
+ }
|
|
+
|
|
public CreativeTabs(int p_i1853_1_, String p_i1853_2_)
|
|
{
|
|
+ if (p_i1853_1_ >= field_78032_a.length)
|
|
+ {
|
|
+ CreativeTabs[] tmp = new CreativeTabs[p_i1853_1_ + 1];
|
|
+ for (int x = 0; x < field_78032_a.length; x++)
|
|
+ {
|
|
+ tmp[x] = field_78032_a[x];
|
|
+ }
|
|
+ field_78032_a = tmp;
|
|
+ }
|
|
this.field_78033_n = p_i1853_1_;
|
|
this.field_78034_o = p_i1853_2_;
|
|
this.field_151245_t = ItemStack.field_190927_a;
|
|
@@ -210,12 +224,20 @@
|
|
@SideOnly(Side.CLIENT)
|
|
public int func_78020_k()
|
|
{
|
|
+ if (field_78033_n > 11)
|
|
+ {
|
|
+ return ((field_78033_n - 12) % 10) % 5;
|
|
+ }
|
|
return this.field_78033_n % 6;
|
|
}
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
public boolean func_78023_l()
|
|
{
|
|
+ if (field_78033_n > 11)
|
|
+ {
|
|
+ return ((field_78033_n - 12) % 10) < 5;
|
|
+ }
|
|
return this.field_78033_n < 6;
|
|
}
|
|
|
|
@@ -260,4 +282,50 @@
|
|
item.func_150895_a(this, p_78018_1_);
|
|
}
|
|
}
|
|
+
|
|
+ public int getTabPage()
|
|
+ {
|
|
+ if (field_78033_n > 11)
|
|
+ {
|
|
+ return ((field_78033_n - 12) / 10) + 1;
|
|
+ }
|
|
+ return 0;
|
|
+ }
|
|
+
|
|
+ public static int getNextID()
|
|
+ {
|
|
+ return field_78032_a.length;
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * Determines if the search bar should be shown for this tab.
|
|
+ *
|
|
+ * @return True to show the bar
|
|
+ */
|
|
+ public boolean hasSearchBar()
|
|
+ {
|
|
+ return field_78033_n == CreativeTabs.field_78027_g.field_78033_n;
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * Gets the width of the search bar of the creative tab, use this if your
|
|
+ * creative tab name overflows together with a custom texture.
|
|
+ *
|
|
+ * @return The width of the search bar, 89 by default
|
|
+ */
|
|
+ public int getSearchbarWidth()
|
|
+ {
|
|
+ return 89;
|
|
+ }
|
|
+
|
|
+ @SideOnly(Side.CLIENT)
|
|
+ public net.minecraft.util.ResourceLocation getBackgroundImage()
|
|
+ {
|
|
+ return new net.minecraft.util.ResourceLocation("textures/gui/container/creative_inventory/tab_" + this.func_78015_f());
|
|
+ }
|
|
+
|
|
+ public int getLabelColor()
|
|
+ {
|
|
+ return 4210752;
|
|
+ }
|
|
}
|