mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-11-04 03:03:43 +01:00 
			
		
		
		
	feat: check merge limits when completing auto-merge (#3868)
- Closes #3748
This commit is contained in:
		@@ -142,6 +142,14 @@ public class Auto extends SubCommand {
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        int maxMerge = Permissions.hasPermissionRange(player, Permission.PERMISSION_MERGE, Settings.Limit.MAX_PLOTS);
 | 
			
		||||
        if (sizeX * sizeZ > maxMerge) {
 | 
			
		||||
            player.sendMessage(
 | 
			
		||||
                    TranslatableCaption.of("permission.no_permission"),
 | 
			
		||||
                    Template.of("node", Permission.PERMISSION_MERGE + "." + (sizeX * sizeZ))
 | 
			
		||||
            );
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -124,7 +124,7 @@ public class Merge extends SubCommand {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
        final int size = plot.getConnectedPlots().size();
 | 
			
		||||
        int max = Permissions.hasPermissionRange(player, "plots.merge", Settings.Limit.MAX_PLOTS);
 | 
			
		||||
        int max = Permissions.hasPermissionRange(player, Permission.PERMISSION_MERGE, Settings.Limit.MAX_PLOTS);
 | 
			
		||||
        PlotMergeEvent event =
 | 
			
		||||
                this.eventDispatcher.callMerge(plot, direction, max, player);
 | 
			
		||||
        if (event.getEventResult() == Result.DENY) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user