mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-12 16:27:45 +00:00
Merge pull request #245 from yesimwearingpants/dev
Added Search to CreativeTabs
This commit is contained in:
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() {
|
||||
|
||||
Reference in new issue
Block a user