Merge branch 'development'

This commit is contained in:
Brianna 2020-07-29 15:10:48 -05:00
commit c319ac3131
4 changed files with 10 additions and 4 deletions

View File

@ -2,7 +2,7 @@
<groupId>com.songoda</groupId>
<artifactId>EpicHeads</artifactId>
<modelVersion>4.0.0</modelVersion>
<version>3.2.11</version>
<version>3.2.12</version>
<build>
<defaultGoal>clean install</defaultGoal>
<finalName>EpicHeads-${project.version}</finalName>

View File

@ -238,6 +238,7 @@ public class GUIHeads extends Gui {
ChatPrompt.showPrompt(plugin, player, plugin.getLocale().getMessage("general.search.global").getPrefixedMessage(), response -> {
List<Head> searchHeads = plugin.getHeadManager().getHeads().stream()
.filter(head -> head.getName().toLowerCase().contains(response.getMessage().toLowerCase()))
.filter(head -> player.hasPermission("epicheads.category." + head.getCategory().getName().replace(" ", "_")))
.collect(Collectors.toList());
Bukkit.getScheduler().scheduleSyncDelayedTask(EpicHeads.getInstance(), ()
-> guiManager.showGUI(player, new GUIHeads(plugin, player, response.getMessage(), QueryTypes.SEARCH, searchHeads)), 0L);

View File

@ -1,6 +1,7 @@
package com.songoda.epicheads.head;
import com.songoda.core.compatibility.CompatibleMaterial;
import com.songoda.core.hooks.EconomyManager;
import com.songoda.core.utils.ItemUtils;
import com.songoda.epicheads.EpicHeads;
import com.songoda.epicheads.settings.Settings;
@ -100,9 +101,13 @@ public class Head {
lore.add(plugin.getLocale().getMessage("general.head.staffpicked").getMessage());
lore.add(plugin.getLocale().getMessage("general.head.id")
.processPlaceholder("id", this.id).getMessage());
if (!free)
if (!free) {
String fcost = Settings.ECONOMY_PLUGIN.getString().equalsIgnoreCase("item")
? cost + " " + Settings.ITEM_TOKEN_TYPE.getString()
: EconomyManager.formatEconomy(cost);
lore.add(plugin.getLocale().getMessage("general.head.cost")
.processPlaceholder("cost", cost).getMessage());
.processPlaceholder("cost", fcost).getMessage());
}
return lore;
}

View File

@ -20,7 +20,7 @@ general:
head:
staffpicked: '&8Staff Favorite'
id: '&8ID: &7%id%'
cost: '&8Cost: &7$%cost%'
cost: '&8Cost: &7%cost%'
gui:
heads:
refine: '&9Refine Search'