Merge pull request #245 from yesimwearingpants/dev

Added Search to CreativeTabs
This commit is contained in:
Cricket committed 2015-02-24 20:58:13 -05:00
commit 21d4b523d5
1 file changed
+29 -7
@@ -11,11 +11,14 @@ import com.cricketcraft.chisel.Features;
public class ChiselTabs {
private static class CustomCreativeTab extends CreativeTabs {
private boolean search;
private ItemStack stack;
public CustomCreativeTab(String label) {
public CustomCreativeTab(String label, boolean searchbar) {
super(label);
this.search = searchbar;
}
@Override
@@ -31,16 +34,35 @@ public class ChiselTabs {
public ItemStack getIconItemStack() {
return stack;
}
@Override
@SideOnly(Side.CLIENT)
public String getBackgroundImageName() {
return search ? "item_search.png" : super.getBackgroundImageName();
}
@Override
public int getSearchbarWidth() {
return 89;
}
@Override
public boolean hasSearchBar() {
return search;
}
}
private static boolean atLeastOneModIsLoaded = false;
public static final CustomCreativeTab tabChisel = new CustomCreativeTab("tabChisel");
public static final CustomCreativeTab tabStoneChiselBlocks = new CustomCreativeTab("tabStoneChiselBlocks");
public static final CustomCreativeTab tabWoodChiselBlocks = new CustomCreativeTab("tabWoodChiselBlocks");
public static final CustomCreativeTab tabMetalChiselBlocks = new CustomCreativeTab("tabMetalChiselBlocks");
public static final CustomCreativeTab tabOtherChiselBlocks = new CustomCreativeTab("tabOtherChiselBlocks");
public static final CustomCreativeTab tabModdedChiselBlocks = new CustomCreativeTab("tabModdedChiselBlocks");
public static final CustomCreativeTab tabChisel = new CustomCreativeTab("tabChisel", false);
public static final CustomCreativeTab tabStoneChiselBlocks = new CustomCreativeTab("tabStoneChiselBlocks", true);
public static final CustomCreativeTab tabWoodChiselBlocks = new CustomCreativeTab("tabWoodChiselBlocks", true);
public static final CustomCreativeTab tabMetalChiselBlocks = new CustomCreativeTab("tabMetalChiselBlocks", true);
public static final CustomCreativeTab tabOtherChiselBlocks = new CustomCreativeTab("tabOtherChiselBlocks", true);
public static final CustomCreativeTab tabModdedChiselBlocks = new CustomCreativeTab("tabModdedChiselBlocks", true);
// this serves mostly just to load the static initializers
public static void preInit() {