mirror of
https://github.com/songoda/EpicHeads.git
synced 2024-11-29 14:06:29 +01:00
version 3.2.0
This commit is contained in:
parent
b891caec96
commit
7980340e17
@ -4,7 +4,7 @@ stages:
|
|||||||
variables:
|
variables:
|
||||||
name: "EpicHeads"
|
name: "EpicHeads"
|
||||||
path: "/builds/$CI_PROJECT_PATH"
|
path: "/builds/$CI_PROJECT_PATH"
|
||||||
version: "3.1"
|
version: "3.2.0"
|
||||||
|
|
||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
|
@ -3,7 +3,7 @@ package com.songoda.epicheads;
|
|||||||
import com.songoda.core.SongodaCore;
|
import com.songoda.core.SongodaCore;
|
||||||
import com.songoda.core.SongodaPlugin;
|
import com.songoda.core.SongodaPlugin;
|
||||||
import com.songoda.core.commands.CommandManager;
|
import com.songoda.core.commands.CommandManager;
|
||||||
import com.songoda.core.compatibility.LegacyMaterials;
|
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||||
import com.songoda.core.configuration.Config;
|
import com.songoda.core.configuration.Config;
|
||||||
import com.songoda.core.gui.GuiManager;
|
import com.songoda.core.gui.GuiManager;
|
||||||
import com.songoda.core.hooks.EconomyManager;
|
import com.songoda.core.hooks.EconomyManager;
|
||||||
@ -66,7 +66,7 @@ public class EpicHeads extends SongodaPlugin {
|
|||||||
@Override
|
@Override
|
||||||
public void onPluginEnable() {
|
public void onPluginEnable() {
|
||||||
// Run Songoda Updater
|
// Run Songoda Updater
|
||||||
SongodaCore.registerPlugin(this, 26, LegacyMaterials.PLAYER_HEAD);
|
SongodaCore.registerPlugin(this, 26, CompatibleMaterial.PLAYER_HEAD);
|
||||||
|
|
||||||
// Load Economy
|
// Load Economy
|
||||||
EconomyManager.load();
|
EconomyManager.load();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package com.songoda.epicheads.gui;
|
package com.songoda.epicheads.gui;
|
||||||
|
|
||||||
import com.songoda.core.compatibility.LegacyMaterials;
|
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||||
import com.songoda.core.gui.Gui;
|
import com.songoda.core.gui.Gui;
|
||||||
import com.songoda.core.gui.GuiManager;
|
import com.songoda.core.gui.GuiManager;
|
||||||
import com.songoda.core.gui.GuiUtils;
|
import com.songoda.core.gui.GuiUtils;
|
||||||
@ -87,7 +87,7 @@ public class GUIHeads extends Gui {
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
if (page - 3 >= 1) {
|
if (page - 3 >= 1) {
|
||||||
setButton(0, GuiUtils.createButtonItem(LegacyMaterials.ARROW, page - 3,
|
setButton(0, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, page - 3,
|
||||||
ChatColor.RED.toString() + plugin.getLocale().getMessage("general.word.page") + " " + (page - 3)),
|
ChatColor.RED.toString() + plugin.getLocale().getMessage("general.word.page") + " " + (page - 3)),
|
||||||
(event) -> changePage(-3));
|
(event) -> changePage(-3));
|
||||||
} else {
|
} else {
|
||||||
@ -96,7 +96,7 @@ public class GUIHeads extends Gui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (page - 2 >= 1) {
|
if (page - 2 >= 1) {
|
||||||
setButton(1, GuiUtils.createButtonItem(LegacyMaterials.ARROW, page - 2,
|
setButton(1, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, page - 2,
|
||||||
ChatColor.RED.toString() + plugin.getLocale().getMessage("general.word.page") + " " + (page - 2)),
|
ChatColor.RED.toString() + plugin.getLocale().getMessage("general.word.page") + " " + (page - 2)),
|
||||||
(event) -> changePage(-2));
|
(event) -> changePage(-2));
|
||||||
} else {
|
} else {
|
||||||
@ -105,7 +105,7 @@ public class GUIHeads extends Gui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (page > 1) {
|
if (page > 1) {
|
||||||
setButton(2, GuiUtils.createButtonItem(LegacyMaterials.ARROW, page - 1,
|
setButton(2, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, page - 1,
|
||||||
ChatColor.RED.toString() + plugin.getLocale().getMessage("general.word.page") + " " + (page - 1)),
|
ChatColor.RED.toString() + plugin.getLocale().getMessage("general.word.page") + " " + (page - 1)),
|
||||||
(event) -> changePage(-1));
|
(event) -> changePage(-1));
|
||||||
} else {
|
} else {
|
||||||
@ -113,15 +113,15 @@ public class GUIHeads extends Gui {
|
|||||||
setItem(2, null);
|
setItem(2, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
setButton(3, GuiUtils.createButtonItem(LegacyMaterials.COMPASS,
|
setButton(3, GuiUtils.createButtonItem(CompatibleMaterial.COMPASS,
|
||||||
plugin.getLocale().getMessage("gui.heads.search").getMessage()),
|
plugin.getLocale().getMessage("gui.heads.search").getMessage()),
|
||||||
(event) -> doSearch(plugin, this, guiManager, event.player));
|
(event) -> doSearch(plugin, this, guiManager, event.player));
|
||||||
|
|
||||||
setButton(4, GuiUtils.createButtonItem(LegacyMaterials.MAP, page,
|
setButton(4, GuiUtils.createButtonItem(CompatibleMaterial.MAP, page,
|
||||||
plugin.getLocale().getMessage("gui.heads.categories").getMessage()), (event) -> guiManager.showGUI(player, new GUIOverview(event.player)));
|
plugin.getLocale().getMessage("gui.heads.categories").getMessage()), (event) -> guiManager.showGUI(player, new GUIOverview(event.player)));
|
||||||
|
|
||||||
if (pageHeads.size() > 1)
|
if (pageHeads.size() > 1)
|
||||||
setButton(5, GuiUtils.createButtonItem(LegacyMaterials.COMPASS,
|
setButton(5, GuiUtils.createButtonItem(CompatibleMaterial.COMPASS,
|
||||||
plugin.getLocale().getMessage("gui.heads.refine").getMessage()),
|
plugin.getLocale().getMessage("gui.heads.refine").getMessage()),
|
||||||
(event) -> {
|
(event) -> {
|
||||||
exit();
|
exit();
|
||||||
@ -142,7 +142,7 @@ public class GUIHeads extends Gui {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (page + 1 <= pages) {
|
if (page + 1 <= pages) {
|
||||||
setButton(6, GuiUtils.createButtonItem(LegacyMaterials.ARROW, page + 1,
|
setButton(6, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, page + 1,
|
||||||
ChatColor.RED.toString() + plugin.getLocale().getMessage("general.word.page") + " " + (page + 1)),
|
ChatColor.RED.toString() + plugin.getLocale().getMessage("general.word.page") + " " + (page + 1)),
|
||||||
(event) -> changePage(+1));
|
(event) -> changePage(+1));
|
||||||
} else {
|
} else {
|
||||||
@ -151,7 +151,7 @@ public class GUIHeads extends Gui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (page + 2 <= pages) {
|
if (page + 2 <= pages) {
|
||||||
setButton(7, GuiUtils.createButtonItem(LegacyMaterials.ARROW, page + 2,
|
setButton(7, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, page + 2,
|
||||||
ChatColor.RED.toString() + plugin.getLocale().getMessage("general.word.page") + " " + (page + 2)),
|
ChatColor.RED.toString() + plugin.getLocale().getMessage("general.word.page") + " " + (page + 2)),
|
||||||
(event) -> changePage(+2));
|
(event) -> changePage(+2));
|
||||||
} else {
|
} else {
|
||||||
@ -160,7 +160,7 @@ public class GUIHeads extends Gui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (page + 3 <= pages) {
|
if (page + 3 <= pages) {
|
||||||
setButton(8, GuiUtils.createButtonItem(LegacyMaterials.ARROW, page + 3,
|
setButton(8, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, page + 3,
|
||||||
ChatColor.RED.toString() + plugin.getLocale().getMessage("general.word.page") + " " + (page + 3)),
|
ChatColor.RED.toString() + plugin.getLocale().getMessage("general.word.page") + " " + (page + 3)),
|
||||||
(event) -> changePage(+3));
|
(event) -> changePage(+3));
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package com.songoda.epicheads.gui;
|
package com.songoda.epicheads.gui;
|
||||||
|
|
||||||
import com.songoda.core.compatibility.LegacyMaterials;
|
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||||
import com.songoda.core.gui.Gui;
|
import com.songoda.core.gui.Gui;
|
||||||
import com.songoda.core.gui.GuiUtils;
|
import com.songoda.core.gui.GuiUtils;
|
||||||
import com.songoda.epicheads.EpicHeads;
|
import com.songoda.epicheads.EpicHeads;
|
||||||
@ -29,16 +29,16 @@ public class GUIOverview extends Gui {
|
|||||||
this.setTitle(plugin.getLocale().getMessage("gui.overview.title")
|
this.setTitle(plugin.getLocale().getMessage("gui.overview.title")
|
||||||
.processPlaceholder("count", plugin.getHeadManager().getHeads().size())
|
.processPlaceholder("count", plugin.getHeadManager().getHeads().size())
|
||||||
.getMessage());
|
.getMessage());
|
||||||
this.setPrevPage(rows - 1, 1, GuiUtils.createButtonItem(LegacyMaterials.ARROW,
|
this.setPrevPage(rows - 1, 1, GuiUtils.createButtonItem(CompatibleMaterial.ARROW,
|
||||||
plugin.getLocale().getMessage("gui.general.previous").getMessage()));
|
plugin.getLocale().getMessage("gui.general.previous").getMessage()));
|
||||||
this.setNextPage(rows - 1, 7, GuiUtils.createButtonItem(LegacyMaterials.ARROW,
|
this.setNextPage(rows - 1, 7, GuiUtils.createButtonItem(CompatibleMaterial.ARROW,
|
||||||
plugin.getLocale().getMessage("gui.general.next").getMessage()));
|
plugin.getLocale().getMessage("gui.general.next").getMessage()));
|
||||||
this.setOnPage((event) -> showPage());
|
this.setOnPage((event) -> showPage());
|
||||||
showPage();
|
showPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
void showPage() {
|
void showPage() {
|
||||||
setButton(4, GuiUtils.createButtonItem(LegacyMaterials.GOLDEN_APPLE,
|
setButton(4, GuiUtils.createButtonItem(CompatibleMaterial.GOLDEN_APPLE,
|
||||||
plugin.getLocale().getMessage("gui.overview.viewfavorites").getMessage(),
|
plugin.getLocale().getMessage("gui.overview.viewfavorites").getMessage(),
|
||||||
plugin.getLocale().getMessage("gui.overview.favoriteslore").getMessage().split("\\|")),
|
plugin.getLocale().getMessage("gui.overview.favoriteslore").getMessage().split("\\|")),
|
||||||
(event) -> guiManager.showGUI(player, new GUIHeads(plugin, player, null, GUIHeads.QueryTypes.FAVORITES,
|
(event) -> guiManager.showGUI(player, new GUIHeads(plugin, player, null, GUIHeads.QueryTypes.FAVORITES,
|
||||||
@ -70,7 +70,7 @@ public class GUIOverview extends Gui {
|
|||||||
|
|
||||||
if (!player.hasPermission("epicheads.category." + category.getName().replace(" ", "_"))) continue;
|
if (!player.hasPermission("epicheads.category." + category.getName().replace(" ", "_"))) continue;
|
||||||
|
|
||||||
setButton(i + 10 + add, GuiUtils.createButtonItem(Methods.addTexture(LegacyMaterials.PLAYER_HEAD.getItem(), firstHead.getURL()),
|
setButton(i + 10 + add, GuiUtils.createButtonItem(Methods.addTexture(CompatibleMaterial.PLAYER_HEAD.getItem(), firstHead.getURL()),
|
||||||
plugin.getLocale().getMessage("gui.overview.headname")
|
plugin.getLocale().getMessage("gui.overview.headname")
|
||||||
.processPlaceholder("name", Color.getRandomColor() + category.getName())
|
.processPlaceholder("name", Color.getRandomColor() + category.getName())
|
||||||
.getMessage(),
|
.getMessage(),
|
||||||
@ -84,12 +84,12 @@ public class GUIOverview extends Gui {
|
|||||||
category.isLatestPack() ? GUIHeads.QueryTypes.PACK : GUIHeads.QueryTypes.CATEGORY, heads)));
|
category.isLatestPack() ? GUIHeads.QueryTypes.PACK : GUIHeads.QueryTypes.CATEGORY, heads)));
|
||||||
}
|
}
|
||||||
|
|
||||||
setButton(Settings.DISCORD.getBoolean() ? 39 : 40, GuiUtils.createButtonItem(LegacyMaterials.COMPASS,
|
setButton(Settings.DISCORD.getBoolean() ? 39 : 40, GuiUtils.createButtonItem(CompatibleMaterial.COMPASS,
|
||||||
plugin.getLocale().getMessage("gui.overview.search").getMessage()),
|
plugin.getLocale().getMessage("gui.overview.search").getMessage()),
|
||||||
(event) -> GUIHeads.doSearch(plugin, this, guiManager, event.player));
|
(event) -> GUIHeads.doSearch(plugin, this, guiManager, event.player));
|
||||||
|
|
||||||
if (Settings.DISCORD.getBoolean()) {
|
if (Settings.DISCORD.getBoolean()) {
|
||||||
setButton(41, GuiUtils.createButtonItem(Methods.addTexture(LegacyMaterials.PLAYER_HEAD.getItem(),
|
setButton(41, GuiUtils.createButtonItem(Methods.addTexture(CompatibleMaterial.PLAYER_HEAD.getItem(),
|
||||||
"a3b183b148b9b4e2b158334aff3b5bb6c2c2dbbc4d67f76a7be856687a2b623"),
|
"a3b183b148b9b4e2b158334aff3b5bb6c2c2dbbc4d67f76a7be856687a2b623"),
|
||||||
plugin.getLocale().getMessage("gui.overview.discord").getMessage(),
|
plugin.getLocale().getMessage("gui.overview.discord").getMessage(),
|
||||||
plugin.getLocale().getMessage("gui.overview.discordlore").getMessage().split("\\|")),
|
plugin.getLocale().getMessage("gui.overview.discordlore").getMessage().split("\\|")),
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package com.songoda.epicheads.head;
|
package com.songoda.epicheads.head;
|
||||||
|
|
||||||
import com.songoda.core.compatibility.LegacyMaterials;
|
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||||
import com.songoda.epicheads.EpicHeads;
|
import com.songoda.epicheads.EpicHeads;
|
||||||
import com.songoda.epicheads.settings.Settings;
|
import com.songoda.epicheads.settings.Settings;
|
||||||
import com.songoda.epicheads.utils.Methods;
|
import com.songoda.epicheads.utils.Methods;
|
||||||
@ -62,7 +62,7 @@ public class Head {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack asItemStack(boolean favorite, boolean free) {
|
public ItemStack asItemStack(boolean favorite, boolean free) {
|
||||||
ItemStack item = Methods.addTexture(LegacyMaterials.PLAYER_HEAD.getItem(), this.URL);
|
ItemStack item = Methods.addTexture(CompatibleMaterial.PLAYER_HEAD.getItem(), this.URL);
|
||||||
|
|
||||||
ItemMeta meta = item.getItemMeta();
|
ItemMeta meta = item.getItemMeta();
|
||||||
if(meta != null) {
|
if(meta != null) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package com.songoda.epicheads.listeners;
|
package com.songoda.epicheads.listeners;
|
||||||
|
|
||||||
import com.songoda.core.compatibility.LegacyMaterials;
|
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||||
import com.songoda.epicheads.EpicHeads;
|
import com.songoda.epicheads.EpicHeads;
|
||||||
import com.songoda.epicheads.head.Head;
|
import com.songoda.epicheads.head.Head;
|
||||||
import com.songoda.epicheads.settings.Settings;
|
import com.songoda.epicheads.settings.Settings;
|
||||||
@ -39,7 +39,7 @@ public class DeathListeners implements Listener {
|
|||||||
String encodededStr = Methods.getEncodedTexture((Player) event.getEntity());
|
String encodededStr = Methods.getEncodedTexture((Player) event.getEntity());
|
||||||
|
|
||||||
if (encodededStr == null) {
|
if (encodededStr == null) {
|
||||||
itemNew = LegacyMaterials.PLAYER_HEAD.getItem();
|
itemNew = CompatibleMaterial.PLAYER_HEAD.getItem();
|
||||||
|
|
||||||
ItemMeta meta = itemNew.getItemMeta();
|
ItemMeta meta = itemNew.getItemMeta();
|
||||||
meta.setDisplayName(Methods.formatText("&9" + ((Player) event.getEntity()).getDisplayName()));
|
meta.setDisplayName(Methods.formatText("&9" + ((Player) event.getEntity()).getDisplayName()));
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package com.songoda.epicheads.listeners;
|
package com.songoda.epicheads.listeners;
|
||||||
|
|
||||||
import com.songoda.core.compatibility.LegacyMaterials;
|
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||||
import com.songoda.epicheads.EpicHeads;
|
import com.songoda.epicheads.EpicHeads;
|
||||||
import com.songoda.epicheads.head.Head;
|
import com.songoda.epicheads.head.Head;
|
||||||
import com.songoda.epicheads.utils.Methods;
|
import com.songoda.epicheads.utils.Methods;
|
||||||
@ -26,7 +26,7 @@ public class ItemListeners implements Listener {
|
|||||||
public void itemSpawnEvent(ItemSpawnEvent event) {
|
public void itemSpawnEvent(ItemSpawnEvent event) {
|
||||||
ItemStack item = event.getEntity().getItemStack();
|
ItemStack item = event.getEntity().getItemStack();
|
||||||
|
|
||||||
if (!LegacyMaterials.PLAYER_HEAD.matches(item)) return;
|
if (!CompatibleMaterial.PLAYER_HEAD.matches(item)) return;
|
||||||
|
|
||||||
String encodededStr = Methods.getEncodedTexture(item);
|
String encodededStr = Methods.getEncodedTexture(item);
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package com.songoda.epicheads.settings;
|
package com.songoda.epicheads.settings;
|
||||||
|
|
||||||
import com.songoda.core.compatibility.LegacyMaterials;
|
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||||
import com.songoda.core.compatibility.ServerVersion;
|
import com.songoda.core.compatibility.ServerVersion;
|
||||||
import com.songoda.core.configuration.Config;
|
import com.songoda.core.configuration.Config;
|
||||||
import com.songoda.core.configuration.ConfigSetting;
|
import com.songoda.core.configuration.ConfigSetting;
|
||||||
@ -89,13 +89,13 @@ public class Settings {
|
|||||||
// convert glass pane settings
|
// convert glass pane settings
|
||||||
int color;
|
int color;
|
||||||
if ((color = GLASS_TYPE_1.getInt(-1)) != -1) {
|
if ((color = GLASS_TYPE_1.getInt(-1)) != -1) {
|
||||||
config.set(GLASS_TYPE_1.getKey(), LegacyMaterials.getGlassPaneColor(color).name());
|
config.set(GLASS_TYPE_1.getKey(), CompatibleMaterial.getGlassPaneColor(color).name());
|
||||||
}
|
}
|
||||||
if ((color = GLASS_TYPE_2.getInt(-1)) != -1) {
|
if ((color = GLASS_TYPE_2.getInt(-1)) != -1) {
|
||||||
config.set(GLASS_TYPE_2.getKey(), LegacyMaterials.getGlassPaneColor(color).name());
|
config.set(GLASS_TYPE_2.getKey(), CompatibleMaterial.getGlassPaneColor(color).name());
|
||||||
}
|
}
|
||||||
if ((color = GLASS_TYPE_3.getInt(-1)) != -1) {
|
if ((color = GLASS_TYPE_3.getInt(-1)) != -1) {
|
||||||
config.set(GLASS_TYPE_3.getKey(), LegacyMaterials.getGlassPaneColor(color).name());
|
config.set(GLASS_TYPE_3.getKey(), CompatibleMaterial.getGlassPaneColor(color).name());
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert economy settings
|
// convert economy settings
|
||||||
|
Loading…
Reference in New Issue
Block a user