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 Economy econ = null;
|
||||||
public static boolean dropOnDeath = false;
|
public static boolean dropOnDeath = false;
|
||||||
public static int inventoriesToDrop = 0;
|
public static int inventoriesToDrop = 0;
|
||||||
|
public static boolean useVault = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
@@ -96,6 +97,7 @@ public class Main extends JavaPlugin {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
econ = rsp.getProvider();
|
econ = rsp.getProvider();
|
||||||
|
useVault = true;
|
||||||
return econ != null;
|
return econ != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class EconomyOperations {
|
|||||||
* @return transaction success
|
* @return transaction success
|
||||||
*/
|
*/
|
||||||
public static boolean payToOpen(Player player) {
|
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;
|
return true;
|
||||||
|
|
||||||
double cost = config.getDouble("economy.cost-to-open");
|
double cost = config.getDouble("economy.cost-to-open");
|
||||||
@@ -44,7 +44,7 @@ public class EconomyOperations {
|
|||||||
* @return transaction success
|
* @return transaction success
|
||||||
*/
|
*/
|
||||||
public static boolean payToMake(Player player) {
|
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;
|
return true;
|
||||||
|
|
||||||
double cost = config.getDouble("economy.cost-to-create");
|
double cost = config.getDouble("economy.cost-to-create");
|
||||||
@@ -64,7 +64,7 @@ public class EconomyOperations {
|
|||||||
* @return transaction success.
|
* @return transaction success.
|
||||||
*/
|
*/
|
||||||
public static boolean refundOnDelete(Player player) {
|
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;
|
return true;
|
||||||
|
|
||||||
double cost = config.getDouble("economy.refund-on-delete");
|
double cost = config.getDouble("economy.refund-on-delete");
|
||||||
|
|||||||
Reference in New Issue
Block a user