Some more cleanup and formatting.
This commit is contained in:
@@ -42,20 +42,16 @@ public class PlayerVaults extends JavaPlugin {
|
||||
private static PlayerVaults instance;
|
||||
private boolean update = false;
|
||||
private String newVersion = "";
|
||||
private String link = "";
|
||||
private HashMap<String, SignSetInfo> setSign = new HashMap<>();
|
||||
// Player name - VaultViewInfo
|
||||
private HashMap<String, VaultViewInfo> inVault = new HashMap<>();
|
||||
// VaultViewInfo - Inventory
|
||||
private HashMap<String, Inventory> openInventories = new HashMap<>();
|
||||
private Economy economy = null;
|
||||
private boolean dropOnDeath = false;
|
||||
private boolean useVault = false;
|
||||
private int inventoriesToDrop = 0;
|
||||
private YamlConfiguration signs;
|
||||
private File signsFile;
|
||||
private boolean saveQueued;
|
||||
private String name = "";
|
||||
private File configFile;
|
||||
private boolean backupsEnabled;
|
||||
private File backupsFolder = null;
|
||||
@@ -81,11 +77,6 @@ public class PlayerVaults extends JavaPlugin {
|
||||
getCommand("pvconvert").setExecutor(new ConvertCommand());
|
||||
useVault = setupEconomy();
|
||||
|
||||
if (getConfig().getBoolean("drop-on-death.enabled")) {
|
||||
dropOnDeath = true;
|
||||
inventoriesToDrop = getConfig().getInt("drop-on-death.inventories");
|
||||
}
|
||||
|
||||
if (getConfig().getBoolean("cleanup.enable", false)) {
|
||||
getServer().getScheduler().runTaskAsynchronously(this, new Cleanup(getConfig().getInt("cleanup.lastEdit", 30)));
|
||||
}
|
||||
@@ -134,7 +125,7 @@ public class PlayerVaults extends JavaPlugin {
|
||||
@Override
|
||||
public void run() {
|
||||
update = updater.getResult() == Updater.UpdateResult.UPDATE_AVAILABLE;
|
||||
name = updater.getLatestName();
|
||||
newVersion = updater.getLatestName();
|
||||
if (updater.getResult() == Updater.UpdateResult.SUCCESS) {
|
||||
getLogger().log(Level.INFO, "Successfully updated PlayerVaults to version {0} for next restart!", updater.getLatestName());
|
||||
} else if (updater.getResult() == Updater.UpdateResult.NO_UPDATE) {
|
||||
@@ -156,7 +147,6 @@ public class PlayerVaults extends JavaPlugin {
|
||||
}
|
||||
|
||||
economy = provider.getProvider();
|
||||
|
||||
return economy != null;
|
||||
}
|
||||
|
||||
@@ -328,10 +318,6 @@ public class PlayerVaults extends JavaPlugin {
|
||||
return this.newVersion;
|
||||
}
|
||||
|
||||
public String getLink() {
|
||||
return this.link;
|
||||
}
|
||||
|
||||
public Economy getEconomy() {
|
||||
return this.economy;
|
||||
}
|
||||
|
||||
@@ -81,8 +81,8 @@ public class Listeners implements Listener {
|
||||
public void onJoin(PlayerJoinEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
if (PlayerVaults.getInstance().needsUpdate() && (player.isOp() || player.hasPermission("playervaults.notify"))) {
|
||||
player.sendMessage(ChatColor.GREEN + "Version " + PlayerVaults.getInstance().getNewVersion() + " of PlayerVaults is available for download!");
|
||||
player.sendMessage(ChatColor.GREEN + PlayerVaults.getInstance().getLink() + " to view the changelog and download!");
|
||||
player.sendMessage(ChatColor.GREEN + "Version " + ChatColor.RED + PlayerVaults.getInstance().getNewVersion() + ChatColor.GREEN + " of PlayerVaults is available for download!");
|
||||
player.sendMessage(ChatColor.GOLD + "http://dev.bukkit.org/pancakes/playervaults" + ChatColor.GREEN + " to view the changelog and download!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,10 +114,7 @@ public class Listeners implements Listener {
|
||||
if (PlayerVaults.getInstance().getSetSign().containsKey(player.getName())) {
|
||||
int i = PlayerVaults.getInstance().getSetSign().get(player.getName()).getChest();
|
||||
boolean self = PlayerVaults.getInstance().getSetSign().get(player.getName()).isSelf();
|
||||
String owner = null;
|
||||
if (!self) {
|
||||
owner = PlayerVaults.getInstance().getSetSign().get(player.getName()).getOwner();
|
||||
}
|
||||
String owner = self ? null : PlayerVaults.getInstance().getSetSign().get(player.getName()).getOwner();
|
||||
PlayerVaults.getInstance().getSetSign().remove(player.getName());
|
||||
event.setCancelled(true);
|
||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.drtshock.playervaults.vaultmanagement;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.configuration.serialization.ConfigurationSerializable;
|
||||
import org.bukkit.configuration.serialization.ConfigurationSerialization;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
|
||||
Reference in New Issue
Block a user