Retain cross-version compatibility & cleanup (#374)
This commit is contained in:
@@ -29,5 +29,6 @@
|
||||
*.ipr
|
||||
*.iws
|
||||
.idea/
|
||||
out/
|
||||
|
||||
*.DS_Store
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.drtshock</groupId>
|
||||
<artifactId>PlayerVaultsX</artifactId>
|
||||
<version>4.1.0</version>
|
||||
<version>4.1.1</version>
|
||||
<name>PlayerVaultsX</name>
|
||||
<url>https://www.spigotmc.org/resources/51204/</url>
|
||||
|
||||
@@ -53,13 +53,13 @@
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.13-R0.1-SNAPSHOT</version>
|
||||
<version>1.13.2-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.milkbowl.vault</groupId>
|
||||
<artifactId>VaultAPI</artifactId>
|
||||
<version>1.6</version>
|
||||
<version>1.7</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@@ -51,14 +51,14 @@ import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class PlayerVaults extends JavaPlugin {
|
||||
|
||||
private static PlayerVaults instance;
|
||||
public static boolean DEBUG = false;
|
||||
private static PlayerVaults instance;
|
||||
private final HashMap<String, SignSetInfo> setSign = new HashMap<>();
|
||||
// Player name - VaultViewInfo
|
||||
private final HashMap<String, VaultViewInfo> inVault = new HashMap<>();
|
||||
// VaultViewInfo - Inventory
|
||||
private final HashMap<String, Inventory> openInventories = new HashMap<>();
|
||||
private final Set<Material> blockedMats = new HashSet<>();
|
||||
private Economy economy = null;
|
||||
private boolean useVault = false;
|
||||
private YamlConfiguration signs;
|
||||
@@ -68,7 +68,24 @@ public class PlayerVaults extends JavaPlugin {
|
||||
private File backupsFolder = null;
|
||||
private File uuidData;
|
||||
private File vaultData;
|
||||
private final Set<Material> blockedMats = new HashSet<>();
|
||||
private String _versionString;
|
||||
|
||||
public static PlayerVaults getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static void debug(String s, long start) {
|
||||
long elapsed = System.currentTimeMillis() - start;
|
||||
if (DEBUG || elapsed > 4) {
|
||||
Bukkit.getLogger().log(Level.INFO, "At {0}. Time since start: {1}ms", new Object[]{s, (elapsed)});
|
||||
}
|
||||
}
|
||||
|
||||
public static void debug(String s) {
|
||||
if (DEBUG) {
|
||||
Bukkit.getLogger().log(Level.INFO, s);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
@@ -144,7 +161,7 @@ public class PlayerVaults extends JavaPlugin {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command cmd, String label, String args[]) {
|
||||
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
||||
if (cmd.getName().equalsIgnoreCase("pvreload")) {
|
||||
reloadConfig();
|
||||
loadConfig(); // To update blocked materials.
|
||||
@@ -362,20 +379,19 @@ public class PlayerVaults extends JavaPlugin {
|
||||
return blockedMats.contains(mat);
|
||||
}
|
||||
|
||||
public static PlayerVaults getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static void debug(String s, long start) {
|
||||
long elapsed = System.currentTimeMillis() - start;
|
||||
if (DEBUG || elapsed > 4) {
|
||||
Bukkit.getLogger().log(Level.INFO, "At {0}. Time since start: {1}ms", new Object[]{s, (elapsed)});
|
||||
}
|
||||
}
|
||||
|
||||
public static void debug(String s) {
|
||||
if (DEBUG) {
|
||||
Bukkit.getLogger().log(Level.INFO, s);
|
||||
/**
|
||||
* Tries to grab the server version as a string.
|
||||
*
|
||||
* @return Version as raw string
|
||||
*/
|
||||
public String getVersion() {
|
||||
if (_versionString == null) {
|
||||
if (Bukkit.getServer() == null) {
|
||||
return null;
|
||||
}
|
||||
final String name = Bukkit.getServer().getClass().getPackage().getName();
|
||||
_versionString = name.substring(name.lastIndexOf(46) + 1) + ".";
|
||||
}
|
||||
return _versionString;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class ConvertCommand implements CommandExecutor {
|
||||
sender.sendMessage(Lang.TITLE.toString() + Lang.NO_PERMS);
|
||||
} else {
|
||||
if (args.length == 0) {
|
||||
sender.sendMessage(Lang.TITLE + "/pvconvert <all | plugin name>");
|
||||
sender.sendMessage(Lang.TITLE + "/" + label + " <all | plugin name>");
|
||||
} else {
|
||||
String name = args[0];
|
||||
final List<Converter> applicableConverters = new ArrayList<>();
|
||||
@@ -39,7 +39,6 @@ public class ConvertCommand implements CommandExecutor {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (applicableConverters.size() <= 0) {
|
||||
sender.sendMessage(Lang.TITLE.toString() + Lang.CONVERT_PLUGIN_NOT_FOUND);
|
||||
} else {
|
||||
@@ -50,21 +49,18 @@ public class ConvertCommand implements CommandExecutor {
|
||||
public void run() {
|
||||
int converted = 0;
|
||||
VaultOperations.setLocked(true);
|
||||
|
||||
for (Converter converter : applicableConverters) {
|
||||
if (converter.canConvert()) {
|
||||
converted += converter.run(sender);
|
||||
}
|
||||
}
|
||||
|
||||
VaultOperations.setLocked(false);
|
||||
sender.sendMessage(Lang.TITLE + Lang.CONVERT_COMPLETE.toString().replace("%converted", converted + ""));
|
||||
}
|
||||
}, 5); // This comment is to annoy evilmidget38
|
||||
}, 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,6 @@ public class DeleteCommand implements CommandExecutor {
|
||||
sender.sendMessage(Lang.TITLE + Lang.LOCKED.toString());
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
if (sender instanceof Player) {
|
||||
@@ -40,15 +39,13 @@ public class DeleteCommand implements CommandExecutor {
|
||||
sender.sendMessage(Lang.TITLE.toString() + Lang.DELETE_OTHER_VAULT_ALL.toString().replaceAll("%p", target));
|
||||
break;
|
||||
}
|
||||
|
||||
VaultOperations.deleteOtherVault(sender, target, args[1]);
|
||||
break;
|
||||
default:
|
||||
sender.sendMessage(Lang.TITLE + "/pvdel <number>");
|
||||
sender.sendMessage(Lang.TITLE + "/pvdel <player> <number>");
|
||||
sender.sendMessage(Lang.TITLE + "/pvdel <player> all");
|
||||
sender.sendMessage(Lang.TITLE + "/" + label + " <number>");
|
||||
sender.sendMessage(Lang.TITLE + "/" + label + " <player> <number>");
|
||||
sender.sendMessage(Lang.TITLE + "/" + label + " <player> all");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ public class SignCommand implements CommandExecutor {
|
||||
i = Integer.parseInt(args[0]);
|
||||
} catch (NumberFormatException nfe) {
|
||||
sender.sendMessage(Lang.TITLE.toString() + Lang.MUST_BE_NUMBER);
|
||||
sender.sendMessage(Lang.TITLE.toString() + "Usage: /" + label + " <owner> <#>");
|
||||
sender.sendMessage(Lang.TITLE.toString() + "Usage: /" + label + " [owner] <#>");
|
||||
return true;
|
||||
}
|
||||
PlayerVaults.getInstance().getSetSign().put(sender.getName(), new SignSetInfo(i));
|
||||
@@ -30,7 +30,7 @@ public class SignCommand implements CommandExecutor {
|
||||
i = Integer.parseInt(args[1]);
|
||||
} catch (NumberFormatException nfe) {
|
||||
sender.sendMessage(Lang.TITLE.toString() + Lang.MUST_BE_NUMBER);
|
||||
sender.sendMessage(Lang.TITLE.toString() + "Usage: /" + label + " <owner> <#>");
|
||||
sender.sendMessage(Lang.TITLE.toString() + "Usage: /" + label + " [owner] <#>");
|
||||
return true;
|
||||
}
|
||||
PlayerVaults.getInstance().getSetSign().put(sender.getName(), new SignSetInfo(args[0].toLowerCase(), i));
|
||||
|
||||
@@ -22,8 +22,8 @@ package com.drtshock.playervaults.commands;
|
||||
*/
|
||||
public class SignSetInfo {
|
||||
|
||||
private String owner;
|
||||
private final int number;
|
||||
private String owner;
|
||||
private boolean self = false;
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,7 +22,6 @@ import com.drtshock.playervaults.vaultmanagement.VaultManager;
|
||||
import com.drtshock.playervaults.vaultmanagement.VaultViewInfo;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@@ -37,8 +36,6 @@ import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class Listeners implements Listener {
|
||||
|
||||
public final PlayerVaults plugin;
|
||||
@@ -89,10 +86,7 @@ public class Listeners implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
public void onClose(InventoryCloseEvent event) {
|
||||
HumanEntity he = event.getPlayer();
|
||||
if (he instanceof Player) {
|
||||
saveVault((Player) he, event.getInventory());
|
||||
}
|
||||
saveVault((Player) event.getPlayer(), event.getInventory());
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
|
||||
@@ -33,11 +33,11 @@ public class SignListener implements Listener {
|
||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
public void onInteract(PlayerInteractEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
Block block = event.getClickedBlock();
|
||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||
if (PlayerVaults.getInstance().getInVault().containsKey(player.getUniqueId().toString())) {
|
||||
Block block = event.getClickedBlock();
|
||||
// Different inventories that we don't want the player to open.
|
||||
if (block.getType() == Material.CHEST || block.getType() == Material.TRAPPED_CHEST || block.getType() == Material.ENDER_CHEST || block.getType() == Material.FURNACE || block.getType() == Material.BREWING_STAND || block.getType() == Material.ENCHANTING_TABLE || block.getType() == Material.BEACON) {
|
||||
if (isInvalidBlock(block.getType())) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
@@ -49,8 +49,8 @@ public class SignListener implements Listener {
|
||||
PlayerVaults.getInstance().getSetSign().remove(player.getName());
|
||||
event.setCancelled(true);
|
||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||
if (event.getClickedBlock().getType() == Material.WALL_SIGN || event.getClickedBlock().getType() == Material.SIGN) {
|
||||
Sign s = (Sign) event.getClickedBlock().getState();
|
||||
if (isValidSign(block.getType())) {
|
||||
Sign s = (Sign) block.getState();
|
||||
Location l = s.getLocation();
|
||||
String world = l.getWorld().getName();
|
||||
int x = l.getBlockX();
|
||||
@@ -72,10 +72,9 @@ public class SignListener implements Listener {
|
||||
}
|
||||
return;
|
||||
}
|
||||
Block b = event.getClickedBlock();
|
||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||
if (b.getType() == Material.WALL_SIGN || b.getType() == Material.SIGN) {
|
||||
Location l = b.getLocation();
|
||||
if (isValidSign(block.getType())) {
|
||||
Location l = block.getLocation();
|
||||
String world = l.getWorld().getName();
|
||||
int x = l.getBlockX();
|
||||
int y = l.getBlockY();
|
||||
@@ -154,4 +153,28 @@ public class SignListener implements Listener {
|
||||
plugin.saveSigns();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isValidSign(Material material) {
|
||||
if (PlayerVaults.getInstance().getVersion().contains("v1_13")) {
|
||||
PlayerVaults.debug("[PlayerVaults] [Debug/SignListener] Sign material checked for >= 1.13");
|
||||
return material == Material.SIGN || material == Material.WALL_SIGN;
|
||||
}
|
||||
PlayerVaults.debug("[PlayerVaults] [Debug/SignListener] Sign material checked for < 1.13");
|
||||
return material == Material.valueOf("SIGN_POST") || material == Material.WALL_SIGN;
|
||||
}
|
||||
|
||||
private boolean isInvalidBlock(Material material) {
|
||||
if (PlayerVaults.getInstance().getVersion().contains("v1_13")) {
|
||||
PlayerVaults.debug("[PlayerVaults] [Debug/SignListener] Block material checked for >= 1.13");
|
||||
return material == Material.CHEST || material == Material.TRAPPED_CHEST
|
||||
|| material == Material.ENDER_CHEST || material == Material.FURNACE
|
||||
|| material == Material.BREWING_STAND || material == Material.ENCHANTING_TABLE
|
||||
|| material == Material.BEACON;
|
||||
}
|
||||
PlayerVaults.debug("[PlayerVaults] [Debug/SignListener] Block material checked for < 1.13");
|
||||
return material == Material.CHEST || material == Material.TRAPPED_CHEST
|
||||
|| material == Material.ENDER_CHEST || material == Material.FURNACE
|
||||
|| material == Material.valueOf("BURNING_FURNACE") || material == Material.BREWING_STAND
|
||||
|| material == Material.valueOf("ENCHANTMENT_TABLE") || material == Material.BEACON;
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,3 @@
|
||||
/*
|
||||
* Copyright (C) 2013 drtshock
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.drtshock.playervaults.translations;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
@@ -52,9 +36,9 @@ public enum Lang {
|
||||
HELP("help", "/pv <number>"),
|
||||
BLOCKED_ITEM("blocked-item", "&6%m &cis blocked from vaults");
|
||||
|
||||
private static YamlConfiguration LANG;
|
||||
private final String path;
|
||||
private final String def;
|
||||
private static YamlConfiguration LANG;
|
||||
|
||||
/**
|
||||
* Lang enum constructor.
|
||||
|
||||
@@ -1,19 +1,3 @@
|
||||
/*
|
||||
* Copyright (C) 2013 drtshock
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.drtshock.playervaults.vaultmanagement;
|
||||
|
||||
import com.drtshock.playervaults.PlayerVaults;
|
||||
|
||||
@@ -1,19 +1,3 @@
|
||||
/*
|
||||
* Copyright (C) 2013 drtshock
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.drtshock.playervaults.vaultmanagement;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
@@ -27,13 +27,21 @@ import java.util.logging.Level;
|
||||
public class UUIDVaultManager {
|
||||
|
||||
private static UUIDVaultManager instance;
|
||||
private final File directory = PlayerVaults.getInstance().getUuidData();
|
||||
private final Map<String, YamlConfiguration> cachedVaultFiles = new ConcurrentHashMap<>();
|
||||
|
||||
public UUIDVaultManager() {
|
||||
instance = this;
|
||||
}
|
||||
|
||||
private final File directory = PlayerVaults.getInstance().getUuidData();
|
||||
private final Map<String, YamlConfiguration> cachedVaultFiles = new ConcurrentHashMap<>();
|
||||
/**
|
||||
* Get the instance of this class.
|
||||
*
|
||||
* @return - instance of this class.
|
||||
*/
|
||||
public static UUIDVaultManager getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the inventory to the specified player and vault number.
|
||||
@@ -251,9 +259,7 @@ public class UUIDVaultManager {
|
||||
}
|
||||
|
||||
public void removeCachedPlayerVaultFile(String holder) {
|
||||
if (cachedVaultFiles.containsKey(holder)) {
|
||||
cachedVaultFiles.remove(holder);
|
||||
}
|
||||
cachedVaultFiles.remove(holder);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -318,13 +324,4 @@ public class UUIDVaultManager {
|
||||
PlayerVaults.getInstance().getLogger().log(Level.SEVERE, "Failed to save vault file for: " + holder, e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the instance of this class.
|
||||
*
|
||||
* @return - instance of this class.
|
||||
*/
|
||||
public static UUIDVaultManager getInstance() {
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,3 @@
|
||||
/*
|
||||
* Copyright (C) 2013 drtshock
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.drtshock.playervaults.vaultmanagement;
|
||||
|
||||
import org.bukkit.inventory.Inventory;
|
||||
@@ -45,6 +29,11 @@ public class VaultHolder implements InventoryHolder {
|
||||
return vaultNumber;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Inventory getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the inventory this vault holder holds
|
||||
*
|
||||
@@ -53,9 +42,4 @@ public class VaultHolder implements InventoryHolder {
|
||||
public void setInventory(Inventory inventory) {
|
||||
this.inventory = inventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Inventory getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,15 +23,23 @@ import java.util.logging.Level;
|
||||
|
||||
public class VaultManager {
|
||||
|
||||
private static VaultManager instance;
|
||||
private static final String VAULTKEY = "vault%d";
|
||||
private static VaultManager instance;
|
||||
private final File directory = PlayerVaults.getInstance().getVaultData();
|
||||
private final Map<String, YamlConfiguration> cachedVaultFiles = new ConcurrentHashMap<>();
|
||||
|
||||
public VaultManager() {
|
||||
instance = this;
|
||||
}
|
||||
|
||||
private final File directory = PlayerVaults.getInstance().getVaultData();
|
||||
private final Map<String, YamlConfiguration> cachedVaultFiles = new ConcurrentHashMap<>();
|
||||
/**
|
||||
* Get the instance of this class.
|
||||
*
|
||||
* @return - instance of this class.
|
||||
*/
|
||||
public static VaultManager getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the inventory to the specified player and vault number.
|
||||
@@ -342,13 +350,4 @@ public class VaultManager {
|
||||
PlayerVaults.getInstance().getLogger().log(Level.SEVERE, "Failed to save vault file for: " + holder, e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the instance of this class.
|
||||
*
|
||||
* @return - instance of this class.
|
||||
*/
|
||||
public static VaultManager getInstance() {
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,3 @@
|
||||
/*
|
||||
* Copyright (C) 2013 drtshock
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.drtshock.playervaults.vaultmanagement;
|
||||
|
||||
import com.drtshock.playervaults.PlayerVaults;
|
||||
@@ -72,11 +56,11 @@ public class VaultOperations {
|
||||
* @return Whether or not they have permission.
|
||||
*/
|
||||
public static boolean checkPerms(CommandSender sender, int number) {
|
||||
if (sender.hasPermission("playervaults.amount." + String.valueOf(number))) {
|
||||
if (sender.hasPermission("playervaults.amount." + number)) {
|
||||
return true;
|
||||
}
|
||||
for (int x = number; x <= 99; x++) {
|
||||
if (sender.hasPermission("playervaults.amount." + String.valueOf(x))) {
|
||||
if (sender.hasPermission("playervaults.amount." + x)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -319,7 +303,7 @@ public class VaultOperations {
|
||||
|
||||
if (sender.hasPermission("playervaults.delete.all")) {
|
||||
VaultManager.getInstance().deleteAllVaults(holder);
|
||||
PlayerVaults.getInstance().getLogger().info(String.format("%s deleted ALL vaults belonging to %s", sender.getName(), holder.toString()));
|
||||
PlayerVaults.getInstance().getLogger().info(String.format("%s deleted ALL vaults belonging to %s", sender.getName(), holder));
|
||||
} else {
|
||||
sender.sendMessage(Lang.TITLE.toString() + Lang.NO_PERMS);
|
||||
}
|
||||
|
||||
@@ -1,19 +1,3 @@
|
||||
/*
|
||||
* Copyright (C) 2013 drtshock
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.drtshock.playervaults.vaultmanagement;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,60 +1,55 @@
|
||||
# PlayerVaults by https://github.com/drtshock/PlayerVaults/graphs/contributors
|
||||
# Spigot page: https://www.spigotmc.org/resources/playervaultsx.51204/
|
||||
# Made with love :3
|
||||
# PlayerVaults
|
||||
# Created by: https://github.com/drtshock/PlayerVaults/graphs/contributors/
|
||||
# Resource page: https://www.spigotmc.org/resources/51204/
|
||||
# Discord server: https://discordapp.com/invite/JZcWDEt/
|
||||
# Made with love <3
|
||||
|
||||
# Debug mode
|
||||
# This will print lots of spammy stuff to console.
|
||||
# Should probably only enabled this if you're working with drtshock to fix something.
|
||||
# Debug Mode
|
||||
# This will print everything the plugin is doing to console.
|
||||
# You should only enable this if you're working with a contributor to fix something.
|
||||
debug: false
|
||||
|
||||
# Lang files can be found in plugins/PlayerVaults/lang/
|
||||
# Set the below value to be one of the files in there without .yml
|
||||
# Currently can use: english, bulgarian, dutch, turkish
|
||||
# Language
|
||||
# This determines which language file the plugin will read from.
|
||||
# Valid options are (don't include .yml): bulgarian, dutch, english, german, turkish
|
||||
language: english
|
||||
|
||||
# Signs
|
||||
# Do you want to enable signs?
|
||||
# You can checkout the project page for info on what this is if you don't know.
|
||||
# This can save some performance on servers with 250+ players if disabled.
|
||||
# This will determine whether vault signs are enabled.
|
||||
# If you don't know what this is or if it's for you, see the resource page.
|
||||
# Reminder: This is only checked during startup.
|
||||
signs-enabled: false
|
||||
|
||||
# Settings here are for economy integration. playervaults.free bypasses it.
|
||||
# Economy
|
||||
# These are all of the settings for the economy integration. (Requires Vault)
|
||||
# Bypass permission is: playervaults.free
|
||||
economy:
|
||||
enabled: false
|
||||
|
||||
# Cost to create a vault. You can give players playervaults.free to bypass this.
|
||||
cost-to-create: 100
|
||||
cost-to-open: 10
|
||||
refund-on-delete: 50
|
||||
|
||||
# Blocked Items
|
||||
# Here you can block items in vaults.
|
||||
# You can give player's playervaults.bypassblockeditems permission to bypass this list.
|
||||
# Ops also have an automatic bypass.
|
||||
# Use material names. This does not work with ids.
|
||||
|
||||
# Should we even use this? If left to false, the list won't do anything.
|
||||
# This will allow you to block specific materials from vaults.
|
||||
# Bypass permission is: playervaults.bypassblockeditems
|
||||
blockitems: true
|
||||
|
||||
# Only effective if the above option is true.
|
||||
# Material list for blocked items (does not support ID's), only effective if the feature is enabled.
|
||||
# If you don't know material names: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html
|
||||
blocked-items:
|
||||
- PUMPKIN
|
||||
- DIAMOND_BLOCK
|
||||
|
||||
|
||||
# Cleanup
|
||||
# Should we cleanup vaults that haven't been used in awhile?
|
||||
# Only checks on restarts. Runs on another thread so it won't
|
||||
# lag the server.
|
||||
#
|
||||
# This will not touch the backups folder. You will have to delete those yourself.
|
||||
# Enabling this will purge vaults that haven't been touched in the specified time frame.
|
||||
# Reminder: This is only checked during startup.
|
||||
# This will not lag your server or touch the backups folder.
|
||||
# The time format is in days.
|
||||
cleanup:
|
||||
enable: false
|
||||
|
||||
# If a file hasn't been edited for this long, we'll clean it up.
|
||||
# Time is in days.
|
||||
lastEdit: 30
|
||||
|
||||
# Backups
|
||||
# Enabling this will create backups of vaults automagically.
|
||||
backups:
|
||||
# If you don't want any backups created change this to false.
|
||||
enabled: true
|
||||
enabled: true
|
||||
@@ -30,4 +30,4 @@ conversion-complete: "&aConverted %converted players to PlayerVaults"
|
||||
conversion-background: "&fConversion has been forked to the background. See console for updates."
|
||||
vaults-locked: "&cVaults are currently locked while conversion occurs. Please try again in a moment!"
|
||||
help: "/pv <number>"
|
||||
blocked-item: "&6%m &cis blocked from vaults."
|
||||
blocked-item: "&6%m &cis blocked from vaults."
|
||||
@@ -24,10 +24,10 @@ cost-to-create: "&fБяхте таксувани &c%price &fза създава
|
||||
cost-to-open: "&fБяхте таксувани &c%price &fза отварянето на този сейф."
|
||||
vault-title: "&4Сейф #%number"
|
||||
existing-vaults: "&f%p има &a%v &fсейфа"
|
||||
no-player-found: "&cНе успяхме да намерим &a%p"
|
||||
no-owner-found: "&cCannot find vault owner: &a%p"
|
||||
plugin-not-found: "&cНямаме конвертор за този плъгин."
|
||||
conversion-complete: "&aКонвертирахме %converted играч(а) към PlayerVaults"
|
||||
conversion-background: "&fЗапочнахме конвертирането на заден план. Следете конзолата за статуса на операцията."
|
||||
vaults-locked: "&cСейфовете са заключени докато тече конвертиране. Моля, опитайте пак по-късно!"
|
||||
help: "/pv <номер>"
|
||||
blocked-item: "&6%m &cне може да се слага в сейфове."
|
||||
blocked-item: "&6%m &cне може да се слага в сейфове."
|
||||
@@ -24,10 +24,10 @@ cost-to-create: "&fje bent &c%price aangerekend &fvoor deze vault te creëren."
|
||||
cost-to-open: "&fJe bent &c%price aangerekend &fvoor het openen van deze vault."
|
||||
vault-title: "&4Vault #%number"
|
||||
existing-vaults: "&f%p heeft vault: &a%v"
|
||||
no-player-found: "&cKan speler &a%p niet vinden"
|
||||
no-owner-found: "&cCannot find vault owner: &a%p"
|
||||
plugin-not-found: "&cGeen converter gevonden voor die plugin."
|
||||
conversion-complete: "&aEr zijn %converted spelers naar PlayerVaults geconverteerd"
|
||||
conversion-background: "&fHet converteren is naar de achtergrond geplaatst. Check de console voor de status van het converteren"
|
||||
vaults-locked: "&cVaults zijn op dit moment op slot terwijl het wordt geconverteerd. Probeer het later opnieuw!"
|
||||
help: "/pv <number>"
|
||||
blocked-item: "&6%m &cis geblokkeer van vaults."
|
||||
blocked-item: "&6%m &cis geblokkeer van vaults."
|
||||
@@ -24,10 +24,10 @@ cost-to-create: "&fYou were charged &c%price &ffor creating that vault."
|
||||
cost-to-open: "&fYou were charged &c%price &ffor opening that vault."
|
||||
vault-title: "&4Vault #%number"
|
||||
existing-vaults: "&f%p has vaults: &a%v"
|
||||
no-player-found: "&cCannot find player &a%p"
|
||||
no-owner-found: "&cCannot find vault owner: &a%p"
|
||||
plugin-not-found: "&cNo converter found for that plugin"
|
||||
conversion-complete: "&aConverted %converted players to PlayerVaults"
|
||||
conversion-background: "&fConversion has been forked to the background. See console for updates."
|
||||
vaults-locked: "&cVaults are currently locked while conversion occurs. Please try again in a moment!"
|
||||
help: "/pv <number>"
|
||||
blocked-item: "&6%m &cis blocked from vaults."
|
||||
blocked-item: "&6%m &cis blocked from vaults."
|
||||
@@ -24,10 +24,10 @@ cost-to-create: "&fDir wurden &c%price &ffür das Erstellen des Tresors berechne
|
||||
cost-to-open: "&fDir wurden von &c%price &ffür das Öffnen des Tresors berechnet."
|
||||
vault-title: "&4Tresor #%number"
|
||||
existing-vaults: "&f%p hat folgende Tresore: &a%v"
|
||||
no-player-found: "&cKann Spieler &a%p nicht finden"
|
||||
no-owner-found: "&cCannot find vault owner: &a%p"
|
||||
plugin-not-found: "&cKeinen Converter für das Plugin gefunden"
|
||||
conversion-complete: "&%converted Spieler zu PlayerVaults konvertiert"
|
||||
conversion-background: "&fKonvertierung wurde im Hintergrund genauer gezeigt. Schaue in die Konsole für mehr Details."
|
||||
vaults-locked: "&cTresore sind gerade wegen einer Konvertierung verschlossen. Versuche es in einem Moment nocheinmal!"
|
||||
help: "/pv <number>"
|
||||
blocked-item: "&6%m &cist von Tresoren geblockt."
|
||||
blocked-item: "&6%m &cist von Tresoren geblockt."
|
||||
@@ -6,7 +6,6 @@
|
||||
# %converted dönüştürülen depo sayısı (uygulanabilir olduğunda)
|
||||
# %m kara listeye alınmış malzeme ile değiştirilecek (uygulanabilir olduğunda)
|
||||
# Aşkla yapıldı :)
|
||||
# Çeviri, @Fix3d tarafından yapılmıştır.
|
||||
|
||||
title-name: "&4[&fPlayerVaultsX&4]:"
|
||||
open-vault: "&a%v. &fdepo açılıyor."
|
||||
@@ -25,10 +24,10 @@ cost-to-create: "&fBu kasayı oluşturmak için &c%price &födedin."
|
||||
cost-to-open: "&fDepo açılış ücreti olarak &c%price &födedin."
|
||||
vault-title: "&4Depo #%number"
|
||||
existing-vaults: "&f%p oyuncusunun depoları: &a%v"
|
||||
no-player-found: "&cOyuncu &a%p &cbulunamıyor!"
|
||||
no-owner-found: "&cCannot find vault owner: &a%p"
|
||||
plugin-not-found: "&cBu eklenti için dönüştürücü bulunamadı"
|
||||
conversion-complete: "&a%converted depo PlayerVaults'a dönüştürüldü"
|
||||
conversion-background: "&fDönüşüm, arka plana aktarıldı. Detaylar için konsola bakın."
|
||||
vaults-locked: "&cDönüşüm gerçekleştiğinde kasalar kilitlenir. Lütfen biraz sonra tekrar deneyin!"
|
||||
help: "/pv <numara>"
|
||||
blocked-item: "&6%m &cdepoda barındırılamaz!"
|
||||
blocked-item: "&6%m &cdepoda barındırılamaz!"
|
||||
@@ -1,32 +1,33 @@
|
||||
name: PlayerVaults
|
||||
main: com.drtshock.playervaults.PlayerVaults
|
||||
authors: [drtshock, kashike]
|
||||
website: ${project.url}
|
||||
|
||||
version: ${project.version}
|
||||
website: https://www.spigotmc.org/resources/51204/
|
||||
main: com.drtshock.playervaults.PlayerVaults
|
||||
softdepend: [Vault]
|
||||
api-version: 1.13
|
||||
|
||||
commands:
|
||||
pv:
|
||||
description: Open a vault with /pv <number>
|
||||
description: Open a vault.
|
||||
aliases: [vault, chest, playervaults, vc]
|
||||
pvdel:
|
||||
description: Delete a vault.
|
||||
aliases: [vaultdel]
|
||||
pvsign:
|
||||
description: Do pv signs.
|
||||
description: Manage vault signs.
|
||||
aliases: [vaultsign]
|
||||
pvconvert:
|
||||
description: Convert other plugins to PlayerVaults
|
||||
description: Convert other plugins to PlayerVaultsX.
|
||||
aliases: [vaultconvert]
|
||||
pvreload:
|
||||
description: Reload the config and lang files.
|
||||
description: Reload the configuration and language files.
|
||||
permission: playervaults.admin
|
||||
|
||||
permissions:
|
||||
playervaults.admin:
|
||||
description: Admin vault operations.
|
||||
description: Grants access to admin commands for vaults.
|
||||
default: op
|
||||
playervaults.bypassblockeditems:
|
||||
description: Bypass blocked items.
|
||||
default: op
|
||||
description: Grants access to bypass blocked vault items.
|
||||
default: op
|
||||
Reference in New Issue
Block a user