@@ -288,18 +288,19 @@ private boolean landlord_claim(CommandSender sender, String[] args) {
288288 return true ;
289289
290290 }
291+ int orLimit = plugin .getConfig ().getInt ("limits.landLimit" ,10 );
291292 int limit = plugin .getConfig ().getInt ("limits.landLimit" ,10 );
292293
293294 if (player .hasPermission ("landlord.limit.extra5" )){
294- limit += limit += plugin .getConfig ().getInt ("limits.extra5" ,0 );
295+ limit = orLimit + plugin .getConfig ().getInt ("limits.extra5" ,0 );
295296 } else if (player .hasPermission ("landlord.limit.extra4" )){
296- limit += limit += plugin .getConfig ().getInt ("limits.extra4" ,0 );
297+ limit = orLimit + plugin .getConfig ().getInt ("limits.extra4" ,0 );
297298 } else if (player .hasPermission ("landlord.limit.extra3" )){
298- limit += limit += plugin .getConfig ().getInt ("limits.extra3" ,0 );
299+ limit = orLimit + plugin .getConfig ().getInt ("limits.extra3" ,0 );
299300 } else if (player .hasPermission ("landlord.limit.extra2" )){
300- limit += limit += plugin .getConfig ().getInt ("limits.extra2" ,0 );
301+ limit = orLimit + plugin .getConfig ().getInt ("limits.extra2" ,0 );
301302 } else if (player .hasPermission ("landlord.limit.extra" )){
302- limit += limit += plugin .getConfig ().getInt ("limits.extra" ,0 );
303+ limit = orLimit + plugin .getConfig ().getInt ("limits.extra" ,0 );
303304 }
304305
305306 if (limit >= 0 && !player .hasPermission ("landlord.limit.override" )){
@@ -309,11 +310,15 @@ private boolean landlord_claim(CommandSender sender, String[] args) {
309310 }
310311 } //
311312
313+ //Money Handling
312314 if (plugin .hasVault ()){
313315 if (plugin .getvHandler ().hasEconomy ()){
314316 Double amt = plugin .getConfig ().getDouble ("economy.buyPrice" , 100.0 );
315317 if (amt > 0 ){
316- 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 )){
317322 player .sendMessage (ChatColor .RED +"It costs " + plugin .getvHandler ().formatCash (amt ) + " to purchase land." );
318323 return true ;
319324 } else {
@@ -403,7 +408,10 @@ private boolean landlord_unclaim(CommandSender sender, String[] args, String lab
403408 if (plugin .getvHandler ().hasEconomy ()){
404409 Double amt = plugin .getConfig ().getDouble ("economy.sellPrice" , 100.0 );
405410 if (amt > 0 ){
406- 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 )){
407415 player .sendMessage (ChatColor .GREEN +"Land sold for " + plugin .getvHandler ().formatCash (amt ) + "." );
408416 //return true;
409417 }
@@ -823,11 +831,11 @@ private boolean landlord_list(CommandSender sender, String[] args, String label)
823831 if (myLand .size ()==0 ){
824832 player .sendMessage (ChatColor .YELLOW +"You do not own any land!" );
825833 } else {
826- String header = ChatColor .DARK_GREEN +" | ( X, Z ) - World Name | \n " ;
834+ String header = ChatColor .DARK_GREEN +" | Coords - Chunk Coords - World Name | \n " ;
827835 ArrayList <String > landList = new ArrayList <String >();
828836 //OwnedLand curr = myLand.get(0);
829837 for (OwnedLand aMyLand : myLand ) {
830- landList .add ((ChatColor .GOLD + " (" + aMyLand .getX () + ", " + aMyLand .getZ () + ") - "
838+ landList .add ((ChatColor .GOLD + " (" + aMyLand . getXBlock () + ", " + aMyLand . getZBlock () + ") - (" + aMyLand .getX () + ", " + aMyLand .getZ () + ") - "
831839 + aMyLand .getWorldName ()) + "\n " )
832840 ;
833841 }
@@ -900,11 +908,11 @@ private boolean landlord_listplayer(CommandSender sender, String[] args, String
900908 if (myLand .size ()==0 ){
901909 sender .sendMessage (ChatColor .YELLOW + owner +" does not own any land!" );
902910 } else {
903- String header = ChatColor .DARK_GREEN +" | ( X, Z ) - World Name | \n " ;
911+ String header = ChatColor .DARK_GREEN +" | Coords - Chunk Coords - World Name | \n " ;
904912 ArrayList <String > landList = new ArrayList <String >();
905913 //OwnedLand curr = myLand.get(0);
906914 for (OwnedLand aMyLand : myLand ) {
907- landList .add ((ChatColor .GOLD + " (" + aMyLand .getX () + ", " + aMyLand .getZ () + ") - "
915+ landList .add ((ChatColor .GOLD + " (" + aMyLand . getXBlock () + ", " + aMyLand . getZBlock () + ") - (" + aMyLand .getX () + ", " + aMyLand .getZ () + ") - "
908916 + aMyLand .getWorldName ()) + "\n " )
909917 ;
910918 }
0 commit comments