mirror of
https://github.com/songoda/EpicHeads.git
synced 2025-01-05 23:58:46 +01:00
Final
This commit is contained in:
parent
29e5834971
commit
5218878575
@ -4,7 +4,7 @@ stages:
|
||||
variables:
|
||||
name: "EpicHeads"
|
||||
path: "/builds/$CI_PROJECT_PATH"
|
||||
version: "2.3.3"
|
||||
version: "3"
|
||||
|
||||
build:
|
||||
stage: build
|
||||
|
@ -138,8 +138,8 @@ public class GUIHeads extends AbstractGUI {
|
||||
|
||||
if (head.getName() == null) continue;
|
||||
|
||||
boolean free = (!player.hasPermission("epicheads.freeheads") &&
|
||||
(SettingsManager.Setting.FREE_IN_CREATIVE.getBoolean() && player.getGameMode() == GameMode.CREATIVE));
|
||||
boolean free = player.hasPermission("epicheads.bypasscost")
|
||||
|| (SettingsManager.Setting.FREE_IN_CREATIVE.getBoolean() && player.getGameMode() == GameMode.CREATIVE);
|
||||
|
||||
ItemStack item = head.asItemStack(favorites.contains(head.getId()), free);
|
||||
|
||||
@ -163,7 +163,7 @@ public class GUIHeads extends AbstractGUI {
|
||||
item.setItemMeta(meta);
|
||||
|
||||
|
||||
if (!player.hasPermission("epicheads.bypasscost") && free) {
|
||||
if (!free) {
|
||||
if (plugin.getServer().getPluginManager().getPlugin("Vault") != null) {
|
||||
RegisteredServiceProvider<Economy> rsp = plugin.getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
|
||||
net.milkbowl.vault.economy.Economy econ = rsp.getProvider();
|
||||
|
@ -63,7 +63,9 @@ public class GUIOverview extends AbstractGUI {
|
||||
|
||||
Tag tag = plugin.getHeadManager().getTags().get(i);
|
||||
|
||||
if (!player.hasPermission("epicheads.category." + tag.getName())) return;
|
||||
player.sendMessage("epicheads.category." + tag.getName());
|
||||
|
||||
if (!player.hasPermission("epicheads.category." + tag.getName())) continue;
|
||||
|
||||
TagInfo tagInfo = TagInfo.valueOf(tag.getName().toUpperCase());
|
||||
|
||||
@ -77,7 +79,7 @@ public class GUIOverview extends AbstractGUI {
|
||||
new GUIHeads(plugin, player, null, plugin.getHeadManager().getHeadsByTag(tag))));
|
||||
}
|
||||
|
||||
createButton(39, Material.COMPASS, plugin.getLocale().getMessage("gui.overview.search"));
|
||||
createButton(SettingsManager.Setting.DISCORD.getBoolean() ? 39 : 40, Material.COMPASS, plugin.getLocale().getMessage("gui.overview.search"));
|
||||
|
||||
|
||||
if (SettingsManager.Setting.DISCORD.getBoolean()) {
|
||||
@ -102,13 +104,15 @@ public class GUIOverview extends AbstractGUI {
|
||||
new GUIHeads(plugin, player, plugin.getLocale().getMessage("general.word.favorites"),
|
||||
plugin.getPlayerManager().getPlayer(player).getFavoritesAsHeads())));
|
||||
|
||||
registerClickable(39, ((player1, inventory1, cursor, slot, type) ->
|
||||
registerClickable(SettingsManager.Setting.DISCORD.getBoolean() ? 39 : 40, ((player1, inventory1, cursor, slot, type) ->
|
||||
GUIHeads.doSearch(player1)));
|
||||
|
||||
registerClickable(41, ((player1, inventory1, cursor, slot, type) -> {
|
||||
player.sendMessage(Methods.formatText(plugin.getReferences().getPrefix() + "&9https://discord.gg/A9TRJQb"));
|
||||
player.closeInventory();
|
||||
}));
|
||||
if (SettingsManager.Setting.DISCORD.getBoolean()) {
|
||||
registerClickable(41, ((player1, inventory1, cursor, slot, type) -> {
|
||||
player.sendMessage(Methods.formatText(plugin.getReferences().getPrefix() + "&9https://discord.gg/A9TRJQb"));
|
||||
player.closeInventory();
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -55,7 +55,7 @@ public class Head {
|
||||
|
||||
public ItemStack asItemStack(boolean favorite) { return asItemStack(favorite, false); }
|
||||
|
||||
public ItemStack asItemStack(boolean favorite, boolean includeCost) {
|
||||
public ItemStack asItemStack(boolean favorite, boolean free) {
|
||||
EpicHeads plugin = EpicHeads.getInstance();
|
||||
ItemStack item = Methods.addTexture(new ItemStack(plugin.isServerVersionAtLeast(ServerVersion.V1_13)
|
||||
? Material.PLAYER_HEAD : Material.valueOf("SKULL_ITEM"), 1, (byte) 3), this.URL);
|
||||
@ -67,7 +67,7 @@ public class Head {
|
||||
if (this.staffPicked == 1)
|
||||
lore.add(Methods.formatText(plugin.getLocale().getMessage("general.head.staffpicked")));
|
||||
lore.add(Methods.formatText(plugin.getLocale().getMessage("general.head.id", this.id)));
|
||||
if (includeCost)
|
||||
if (!free)
|
||||
lore.add(plugin.getLocale().getMessage("general.head.cost", cost));
|
||||
|
||||
meta.setLore(lore);
|
||||
|
@ -50,8 +50,6 @@ public class ItemListeners implements Listener {
|
||||
meta.setLore(new ArrayList<>());
|
||||
itemNew.setItemMeta(meta);
|
||||
|
||||
event.getItem().getWorld().dropItemNaturally(event.getPlayer().getLocation().add(1, 1, 0), itemNew.clone());
|
||||
|
||||
event.getItem().setItemStack(itemNew);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user