diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5827fd6..296c22c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ stages: variables: name: "EpicHeads" path: "/builds/$CI_PROJECT_PATH" - version: "3.1" + version: "3.2.0" build: stage: build diff --git a/src/main/java/com/songoda/epicheads/EpicHeads.java b/src/main/java/com/songoda/epicheads/EpicHeads.java index a06f6dc..eda9f0f 100644 --- a/src/main/java/com/songoda/epicheads/EpicHeads.java +++ b/src/main/java/com/songoda/epicheads/EpicHeads.java @@ -3,7 +3,7 @@ package com.songoda.epicheads; import com.songoda.core.SongodaCore; import com.songoda.core.SongodaPlugin; 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.gui.GuiManager; import com.songoda.core.hooks.EconomyManager; @@ -66,7 +66,7 @@ public class EpicHeads extends SongodaPlugin { @Override public void onPluginEnable() { // Run Songoda Updater - SongodaCore.registerPlugin(this, 26, LegacyMaterials.PLAYER_HEAD); + SongodaCore.registerPlugin(this, 26, CompatibleMaterial.PLAYER_HEAD); // Load Economy EconomyManager.load(); diff --git a/src/main/java/com/songoda/epicheads/gui/GUIHeads.java b/src/main/java/com/songoda/epicheads/gui/GUIHeads.java index 0cf5b9c..15b2d3e 100644 --- a/src/main/java/com/songoda/epicheads/gui/GUIHeads.java +++ b/src/main/java/com/songoda/epicheads/gui/GUIHeads.java @@ -1,6 +1,6 @@ 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.GuiManager; import com.songoda.core.gui.GuiUtils; @@ -87,7 +87,7 @@ public class GUIHeads extends Gui { .collect(Collectors.toList()); 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)), (event) -> changePage(-3)); } else { @@ -96,7 +96,7 @@ public class GUIHeads extends Gui { } 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)), (event) -> changePage(-2)); } else { @@ -105,7 +105,7 @@ public class GUIHeads extends Gui { } 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)), (event) -> changePage(-1)); } else { @@ -113,15 +113,15 @@ public class GUIHeads extends Gui { setItem(2, null); } - setButton(3, GuiUtils.createButtonItem(LegacyMaterials.COMPASS, + setButton(3, GuiUtils.createButtonItem(CompatibleMaterial.COMPASS, plugin.getLocale().getMessage("gui.heads.search").getMessage()), (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))); if (pageHeads.size() > 1) - setButton(5, GuiUtils.createButtonItem(LegacyMaterials.COMPASS, + setButton(5, GuiUtils.createButtonItem(CompatibleMaterial.COMPASS, plugin.getLocale().getMessage("gui.heads.refine").getMessage()), (event) -> { exit(); @@ -142,7 +142,7 @@ public class GUIHeads extends Gui { }); 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)), (event) -> changePage(+1)); } else { @@ -151,7 +151,7 @@ public class GUIHeads extends Gui { } 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)), (event) -> changePage(+2)); } else { @@ -160,7 +160,7 @@ public class GUIHeads extends Gui { } 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)), (event) -> changePage(+3)); } else { diff --git a/src/main/java/com/songoda/epicheads/gui/GUIOverview.java b/src/main/java/com/songoda/epicheads/gui/GUIOverview.java index ad8f6c4..36661f6 100644 --- a/src/main/java/com/songoda/epicheads/gui/GUIOverview.java +++ b/src/main/java/com/songoda/epicheads/gui/GUIOverview.java @@ -1,6 +1,6 @@ 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.GuiUtils; import com.songoda.epicheads.EpicHeads; @@ -29,16 +29,16 @@ public class GUIOverview extends Gui { this.setTitle(plugin.getLocale().getMessage("gui.overview.title") .processPlaceholder("count", plugin.getHeadManager().getHeads().size()) .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())); - 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())); this.setOnPage((event) -> showPage()); 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.favoriteslore").getMessage().split("\\|")), (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; - 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") .processPlaceholder("name", Color.getRandomColor() + category.getName()) .getMessage(), @@ -84,12 +84,12 @@ public class GUIOverview extends Gui { 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()), (event) -> GUIHeads.doSearch(plugin, this, guiManager, event.player)); 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"), plugin.getLocale().getMessage("gui.overview.discord").getMessage(), plugin.getLocale().getMessage("gui.overview.discordlore").getMessage().split("\\|")), diff --git a/src/main/java/com/songoda/epicheads/head/Head.java b/src/main/java/com/songoda/epicheads/head/Head.java index 73d810a..ab9bcb9 100644 --- a/src/main/java/com/songoda/epicheads/head/Head.java +++ b/src/main/java/com/songoda/epicheads/head/Head.java @@ -1,6 +1,6 @@ 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.settings.Settings; import com.songoda.epicheads.utils.Methods; @@ -62,7 +62,7 @@ public class Head { } 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(); if(meta != null) { diff --git a/src/main/java/com/songoda/epicheads/listeners/DeathListeners.java b/src/main/java/com/songoda/epicheads/listeners/DeathListeners.java index 9cbf431..3237d19 100644 --- a/src/main/java/com/songoda/epicheads/listeners/DeathListeners.java +++ b/src/main/java/com/songoda/epicheads/listeners/DeathListeners.java @@ -1,6 +1,6 @@ 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.head.Head; import com.songoda.epicheads.settings.Settings; @@ -39,7 +39,7 @@ public class DeathListeners implements Listener { String encodededStr = Methods.getEncodedTexture((Player) event.getEntity()); if (encodededStr == null) { - itemNew = LegacyMaterials.PLAYER_HEAD.getItem(); + itemNew = CompatibleMaterial.PLAYER_HEAD.getItem(); ItemMeta meta = itemNew.getItemMeta(); meta.setDisplayName(Methods.formatText("&9" + ((Player) event.getEntity()).getDisplayName())); diff --git a/src/main/java/com/songoda/epicheads/listeners/ItemListeners.java b/src/main/java/com/songoda/epicheads/listeners/ItemListeners.java index 1df311d..ec415a8 100644 --- a/src/main/java/com/songoda/epicheads/listeners/ItemListeners.java +++ b/src/main/java/com/songoda/epicheads/listeners/ItemListeners.java @@ -1,6 +1,6 @@ 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.head.Head; import com.songoda.epicheads.utils.Methods; @@ -26,7 +26,7 @@ public class ItemListeners implements Listener { public void itemSpawnEvent(ItemSpawnEvent event) { ItemStack item = event.getEntity().getItemStack(); - if (!LegacyMaterials.PLAYER_HEAD.matches(item)) return; + if (!CompatibleMaterial.PLAYER_HEAD.matches(item)) return; String encodededStr = Methods.getEncodedTexture(item); diff --git a/src/main/java/com/songoda/epicheads/settings/Settings.java b/src/main/java/com/songoda/epicheads/settings/Settings.java index 7361439..3688385 100644 --- a/src/main/java/com/songoda/epicheads/settings/Settings.java +++ b/src/main/java/com/songoda/epicheads/settings/Settings.java @@ -1,6 +1,6 @@ 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.configuration.Config; import com.songoda.core.configuration.ConfigSetting; @@ -89,13 +89,13 @@ public class Settings { // convert glass pane settings int color; 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) { - 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) { - config.set(GLASS_TYPE_3.getKey(), LegacyMaterials.getGlassPaneColor(color).name()); + config.set(GLASS_TYPE_3.getKey(), CompatibleMaterial.getGlassPaneColor(color).name()); } // convert economy settings