From 1dff0cbe9b86ebea46aa9fa345612b36c6d82b7f Mon Sep 17 00:00:00 2001 From: 7sat <49030779+7sat@users.noreply.github.com> Date: Mon, 18 Dec 2023 02:54:00 +0900 Subject: [PATCH] Compatibility Update for MC 1.20.2 --- pom.xml | 4 ++-- .../me/sat7/dynamicshop/guis/ItemPalette.java | 24 +++++++------------ 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index 25779de..fd2e6b5 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ me.sat7 DynamicShop - 3.15.2 + 3.15.3 jar DynamicShop @@ -110,7 +110,7 @@ org.spigotmc spigot-api - 1.18.1-R0.1-SNAPSHOT + 1.20.2-R0.1-SNAPSHOT provided diff --git a/src/main/java/me/sat7/dynamicshop/guis/ItemPalette.java b/src/main/java/me/sat7/dynamicshop/guis/ItemPalette.java index e0b682b..0897479 100644 --- a/src/main/java/me/sat7/dynamicshop/guis/ItemPalette.java +++ b/src/main/java/me/sat7/dynamicshop/guis/ItemPalette.java @@ -220,6 +220,14 @@ public ItemStack getPotionItemStack(Material potionMat, PotionType type, boolean return potion; } + public ItemStack getPotionItemStack(Material potionMat, PotionType potionType){ + ItemStack potion = new ItemStack(potionMat, 1); + PotionMeta meta = (PotionMeta) potion.getItemMeta(); + meta.setBasePotionType(potionType); + potion.setItemMeta(meta); + return potion; + } + private void SortAllItems() { ArrayList allItems = new ArrayList<>(); @@ -237,21 +245,7 @@ private void SortAllItems() { for (PotionType pt : PotionType.values()) { - if (pt.isExtendable() && pt.isUpgradeable()) - { - allItems.add(getPotionItemStack(mat, pt, true, false)); - allItems.add(getPotionItemStack(mat, pt, false, true)); - } - else if (pt.isExtendable()) - { - allItems.add(getPotionItemStack(mat, pt, true, false)); - } - else if (pt.isUpgradeable()) - { - allItems.add(getPotionItemStack(mat, pt, false, true)); - } - - allItems.add(getPotionItemStack(mat, pt, false, false)); + allItems.add(getPotionItemStack(mat, pt)); } }