mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-19 19:25:48 +00:00
Merge pull request #3448 from StarWishsama/chore/guide-search-improve
Improve guide search result
This commit is contained in:
commit
e9ab775630
@ -103,7 +103,8 @@ public final class SlimefunRegistry {
|
||||
guideKey = new NamespacedKey(plugin, "slimefun_guide_mode");
|
||||
|
||||
boolean showVanillaRecipes = cfg.getBoolean("guide.show-vanilla-recipes");
|
||||
guides.put(SlimefunGuideMode.SURVIVAL_MODE, new SurvivalSlimefunGuide(showVanillaRecipes));
|
||||
boolean showHiddenItemGroupsInSearch = cfg.getBoolean("guide.show-hidden-item-groups-in-search");
|
||||
guides.put(SlimefunGuideMode.SURVIVAL_MODE, new SurvivalSlimefunGuide(showVanillaRecipes, showHiddenItemGroupsInSearch));
|
||||
guides.put(SlimefunGuideMode.CHEAT_MODE, new CheatSheetSlimefunGuide());
|
||||
|
||||
researchRanks.addAll(cfg.getStringList("research-ranks"));
|
||||
|
@ -34,7 +34,7 @@ public class CheatSheetSlimefunGuide extends SurvivalSlimefunGuide {
|
||||
private final ItemStack item;
|
||||
|
||||
public CheatSheetSlimefunGuide() {
|
||||
super(false);
|
||||
super(false, true);
|
||||
|
||||
item = new SlimefunGuideItem(this, "&cSlimefun Guide &4(Cheat Sheet)");
|
||||
}
|
||||
|
@ -72,9 +72,11 @@ public class SurvivalSlimefunGuide implements SlimefunGuideImplementation {
|
||||
private final int[] recipeSlots = { 3, 4, 5, 12, 13, 14, 21, 22, 23 };
|
||||
private final ItemStack item;
|
||||
private final boolean showVanillaRecipes;
|
||||
private final boolean showHiddenItemGroupsInSearch;
|
||||
|
||||
public SurvivalSlimefunGuide(boolean showVanillaRecipes) {
|
||||
public SurvivalSlimefunGuide(boolean showVanillaRecipes, boolean showHiddenItemGroupsInSearch) {
|
||||
this.showVanillaRecipes = showVanillaRecipes;
|
||||
this.showHiddenItemGroupsInSearch = showHiddenItemGroupsInSearch;
|
||||
item = new SlimefunGuideItem(this, "&aSlimefun Guide &7(Chest GUI)");
|
||||
}
|
||||
|
||||
@ -358,7 +360,9 @@ public class SurvivalSlimefunGuide implements SlimefunGuideImplementation {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!slimefunItem.isHidden() && isSearchFilterApplicable(slimefunItem, searchTerm)) {
|
||||
boolean isItemGroupHidden = showHiddenItemGroupsInSearch || !slimefunItem.getItemGroup().isHidden(p);
|
||||
|
||||
if (!slimefunItem.isHidden() && isItemGroupHidden && isSearchFilterApplicable(slimefunItem, searchTerm)) {
|
||||
ItemStack itemstack = new CustomItemStack(slimefunItem.getItem(), meta -> {
|
||||
ItemGroup itemGroup = slimefunItem.getItemGroup();
|
||||
meta.setLore(Arrays.asList("", ChatColor.DARK_GRAY + "\u21E8 " + ChatColor.WHITE + itemGroup.getDisplayName(p)));
|
||||
|
@ -23,6 +23,7 @@ options:
|
||||
guide:
|
||||
show-vanilla-recipes: true
|
||||
receive-on-first-join: true
|
||||
show-hidden-item-groups-in-search: false
|
||||
|
||||
researches:
|
||||
free-in-creative-mode: true
|
||||
|
Loading…
Reference in New Issue
Block a user