Fix NPE in econ if no econ plugin but usecon.
This commit is contained in:
@@ -28,6 +28,7 @@ public class Main extends JavaPlugin {
|
||||
public static Economy econ = null;
|
||||
public static boolean dropOnDeath = false;
|
||||
public static int inventoriesToDrop = 0;
|
||||
public static boolean useVault = false;
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
@@ -96,6 +97,7 @@ public class Main extends JavaPlugin {
|
||||
return false;
|
||||
}
|
||||
econ = rsp.getProvider();
|
||||
useVault = true;
|
||||
return econ != null;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ public class EconomyOperations {
|
||||
* @return transaction success
|
||||
*/
|
||||
public static boolean payToOpen(Player player) {
|
||||
if(!config.getBoolean("economy.enabled") || player.hasPermission("playervaults.free"))
|
||||
if(!config.getBoolean("economy.enabled") || player.hasPermission("playervaults.free") || !Main.useVault)
|
||||
return true;
|
||||
|
||||
double cost = config.getDouble("economy.cost-to-open");
|
||||
@@ -44,7 +44,7 @@ public class EconomyOperations {
|
||||
* @return transaction success
|
||||
*/
|
||||
public static boolean payToMake(Player player) {
|
||||
if(!config.getBoolean("economy.enabled") || player.hasPermission("playervaults.free"))
|
||||
if(!config.getBoolean("economy.enabled") || player.hasPermission("playervaults.free") || !Main.useVault)
|
||||
return true;
|
||||
|
||||
double cost = config.getDouble("economy.cost-to-create");
|
||||
@@ -64,7 +64,7 @@ public class EconomyOperations {
|
||||
* @return transaction success.
|
||||
*/
|
||||
public static boolean refundOnDelete(Player player) {
|
||||
if(!config.getBoolean("economy.enabled") || player.hasPermission("playervaults.free"))
|
||||
if(!config.getBoolean("economy.enabled") || player.hasPermission("playervaults.free") || !Main.useVault)
|
||||
return true;
|
||||
|
||||
double cost = config.getDouble("economy.refund-on-delete");
|
||||
|
||||
Reference in New Issue
Block a user