Some updates

- Added Reddit flair sync
- Removed magical saddle because the stacking potato does the same thing
- Some internal improvements
- Fixed bug where if a service throws an error while starting or stopping it breaks the entire plugin
This commit is contained in:
Seth
2020-08-04 15:16:11 -07:00
parent b73d1df350
commit 81df3103b6
20 changed files with 466 additions and 94 deletions

View File

@ -21,6 +21,7 @@ import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.scheduler.BukkitTask;
@ -168,6 +169,16 @@ public class Shop extends FreedomService
return gui;
}
public boolean isRealItem(PlayerData data, ShopItem shopItem, PlayerInventory inventory, ItemStack realItem)
{
if (isRealItem(data, shopItem, inventory.getItemInMainHand(), realItem) || isRealItem(data, shopItem, inventory.getItemInOffHand(), realItem))
{
return true;
}
return false;
}
public boolean isRealItem(PlayerData data, ShopItem shopItem, ItemStack givenItem, ItemStack realItem)
{
if (!data.hasItem(shopItem) || !givenItem.getType().equals(realItem.getType()))

View File

@ -12,18 +12,17 @@ public enum ShopItem
FIRE_BALL("Fire Ball", Material.FIRE_CHARGE, 14, ConfigEntry.SHOP_PRICES_FIRE_BALL, ChatColor.RED, "fireBall", "/fireball"),
RIDEABLE_PEARL("Rideable Ender Pearl", Material.ENDER_PEARL, 16, ConfigEntry.SHOP_PRICES_RIDEABLE_PEARL, ChatColor.DARK_PURPLE, "rideablePearl", "/rideablepearl"),
STACKING_POTATO("Stacking Potato", Material.POTATO, 20, ConfigEntry.SHOP_PRICES_STACKING_POTATO, ChatColor.YELLOW, "stackingPotato", "/stackingpotato"),
MAGICAL_SADDLE("Magical Saddle", Material.SADDLE, 22, ConfigEntry.SHOP_PRICES_MAGICAL_SADDLE, ChatColor.DARK_GREEN, "magicalSaddle", "/magicalsaddle"),
CLOWN_FISH("Clown Fish", Material.TROPICAL_FISH, 24, ConfigEntry.SHOP_PRICES_CLOWN_FISH, ChatColor.GOLD, "clownFish", "/clownfish");
/*
Shop GUI Layout:
Dimensions: 9x4 = 36
Key: g = Grappling Hook, l = Lightning Rod, f = Fire Ball, r = Rideable Ender Pearl, s = Stacking Potato, c = Clown Fish, m = Magical Saddle $ = Coins}
Key: g = Grappling Hook, l = Lightning Rod, f = Fire Ball, r = Rideable Ender Pearl, s = Stacking Potato, c = Clown Fish, $ = Coins}
---------
-g-l-f-r-
--s-m-c--
--s---c--
--------$
*/