[1.15.2.a.7] Fixed offline enderbanks & added blacklisting
This commit is contained in:
parent
09e7085979
commit
f4b43fc915
@ -35,6 +35,13 @@ Open_Bank_Noise_Global: true
|
||||
#bank will be heard by all nearby players. If false, only
|
||||
#the player opening the bank will hear it.
|
||||
|
||||
#Disabled_Worlds:
|
||||
#- Default
|
||||
#- Default_Nether
|
||||
#- Example3
|
||||
#This is a list of worlds that the plugin is disabled in.
|
||||
#To enable this feature, simply uncomment it.
|
||||
|
||||
##########################################################
|
||||
# GUI Items #
|
||||
##########################################################
|
||||
@ -84,5 +91,5 @@ GUI:
|
||||
# Version #
|
||||
##########################################################
|
||||
|
||||
VERSION: 3
|
||||
VERSION: 4
|
||||
#Do not touch this. No touchy.
|
||||
@ -1,6 +1,6 @@
|
||||
name: "EnderBank"
|
||||
author: TheTealViper
|
||||
version: "1.15.2.a.6"
|
||||
version: "1.15.2.a.7"
|
||||
api-version: 1.13
|
||||
description: "Bank system from popular RPG's."
|
||||
main: me.TheTealViper.enderbank.EnderBank
|
||||
|
||||
@ -42,6 +42,14 @@ public class BankStorage {
|
||||
return new BankStorage(bankOwner);
|
||||
}
|
||||
|
||||
public static boolean hasBank(UUID bankOwner) {
|
||||
PluginFile pf = new PluginFile(plugin, "banks/banks." + bankOwner.toString() + ".yml");
|
||||
if(pf.contains("unlockedPages"))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
public BankStorage(UUID bankOwnerUUID) {
|
||||
bankDatabase.put(bankOwnerUUID, this);
|
||||
this.bankOwnerUUID = bankOwnerUUID;
|
||||
|
||||
@ -39,6 +39,7 @@ public class EnderBank extends JavaPlugin implements Listener {
|
||||
public static VersionType version;
|
||||
public static String notificationString = ChatColor.BOLD + "[" + ChatColor.AQUA + ChatColor.BOLD + "!" + ChatColor.WHITE + ChatColor.BOLD + "]" + ChatColor.RESET
|
||||
, questionString = ChatColor.BOLD + "[" + ChatColor.AQUA + ChatColor.BOLD + "?" + ChatColor.WHITE + ChatColor.BOLD + "]" + ChatColor.RESET;
|
||||
private List<String> disabledWorlds;
|
||||
|
||||
//Chat Queue (for asking which tracker you'd like to add)
|
||||
public static Map<Player, List<String>> chatHandlerQueue = new HashMap<Player, List<String>>();
|
||||
@ -84,6 +85,7 @@ public class EnderBank extends JavaPlugin implements Listener {
|
||||
equipmentTypes.add(Material.DIAMOND_CHESTPLATE);
|
||||
equipmentTypes.add(Material.DIAMOND_HELMET);
|
||||
equipmentTypes.add(Material.DIAMOND_LEGGINGS);
|
||||
disabledWorlds = getConfig().contains("Disabled_Worlds") ? getConfig().getStringList("Disabled_Worlds") : new ArrayList<String>();
|
||||
|
||||
RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
|
||||
if (rsp != null)
|
||||
@ -117,7 +119,7 @@ public class EnderBank extends JavaPlugin implements Listener {
|
||||
@SuppressWarnings("deprecation")
|
||||
OfflinePlayer oPlayerOffline = Bukkit.getOfflinePlayer(oPlayerName);
|
||||
UUID oPlayerUUID = oPlayerOffline.getUniqueId();
|
||||
if(BankStorage.bankDatabase.containsKey(oPlayerUUID)) {
|
||||
if(BankStorage.hasBank(oPlayerUUID)) {
|
||||
BankStorage bank = BankStorage.getBank(oPlayerUUID);
|
||||
bank.openPage(1, p);
|
||||
if(!oPlayerOffline.isOnline()){
|
||||
@ -310,7 +312,7 @@ public class EnderBank extends JavaPlugin implements Listener {
|
||||
//[1.15.2.a.4] This is still here to handle the command /ec as that would open vanilla chest
|
||||
@EventHandler
|
||||
public void onInventoryOpen(InventoryOpenEvent e) {
|
||||
if(e.getInventory().getType().equals(InventoryType.ENDER_CHEST)) {
|
||||
if(e.getInventory().getType().equals(InventoryType.ENDER_CHEST) && !disabledWorlds.contains(e.getPlayer().getWorld().getName())) {
|
||||
e.setCancelled(true);
|
||||
Player p = (Player) e.getPlayer();
|
||||
openEnderBank(p);
|
||||
@ -319,7 +321,7 @@ public class EnderBank extends JavaPlugin implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onChestClick(PlayerInteractEvent e) {
|
||||
if(e.getAction().equals(Action.RIGHT_CLICK_BLOCK) && e.getClickedBlock().getType().equals(Material.ENDER_CHEST)) {
|
||||
if(e.getAction().equals(Action.RIGHT_CLICK_BLOCK) && e.getClickedBlock().getType().equals(Material.ENDER_CHEST) && !disabledWorlds.contains(e.getPlayer().getWorld().getName())) {
|
||||
e.setCancelled(true);
|
||||
Player p = (Player) e.getPlayer();
|
||||
openEnderBank(p);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user