@@ -310,11 +310,15 @@ private boolean landlord_claim(CommandSender sender, String[] args) {
310310 }
311311 } //
312312
313+ //Money Handling
313314 if (plugin .hasVault ()){
314315 if (plugin .getvHandler ().hasEconomy ()){
315316 Double amt = plugin .getConfig ().getDouble ("economy.buyPrice" , 100.0 );
316317 if (amt > 0 ){
317- if (!plugin .getvHandler ().chargeCash (player , amt )){
318+ int numFree = plugin .getConfig ().getInt ("economy.freeLand" , 0 );
319+ if (numFree > 0 && plugin .getDatabase ().find (OwnedLand .class ).where ().eq ("ownerName" ,player .getUniqueId ().toString ()).findRowCount () < numFree ) {
320+ //player.sendMessage(ChatColor.YELLOW+"You have been charged " + plugin.getvHandler().formatCash(amt) + " to purchase land.");
321+ } else if (!plugin .getvHandler ().chargeCash (player , amt )){
318322 player .sendMessage (ChatColor .RED +"It costs " + plugin .getvHandler ().formatCash (amt ) + " to purchase land." );
319323 return true ;
320324 } else {
@@ -404,7 +408,10 @@ private boolean landlord_unclaim(CommandSender sender, String[] args, String lab
404408 if (plugin .getvHandler ().hasEconomy ()){
405409 Double amt = plugin .getConfig ().getDouble ("economy.sellPrice" , 100.0 );
406410 if (amt > 0 ){
407- if (plugin .getvHandler ().giveCash (player , amt )){
411+ int numFree = plugin .getConfig ().getInt ("economy.freeLand" , 0 );
412+ if (numFree > 0 && plugin .getDatabase ().find (OwnedLand .class ).where ().eq ("ownerName" ,player .getUniqueId ().toString ()).findRowCount () <= numFree ) {
413+ //player.sendMessage(ChatColor.YELLOW+"You have been charged " + plugin.getvHandler().formatCash(amt) + " to purchase land.");
414+ } else if (plugin .getvHandler ().giveCash (player , amt )){
408415 player .sendMessage (ChatColor .GREEN +"Land sold for " + plugin .getvHandler ().formatCash (amt ) + "." );
409416 //return true;
410417 }
0 commit comments