mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-10-30 00:53:44 +01:00 
			
		
		
		
	Compare commits
	
		
			6 Commits
		
	
	
		
			shadow-deb
			...
			fix/v6/hom
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | a85cab7261 | ||
|   | 9cd0ffb709 | ||
|   | 5fd314818f | ||
|   | 8d76ec549e | ||
|   | d354c626c5 | ||
|   | 78c107f176 | 
							
								
								
									
										4
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							| @@ -1,4 +0,0 @@ | ||||
| * text=auto | ||||
|  | ||||
| *.java text | ||||
| *.jar binary | ||||
							
								
								
									
										23
									
								
								.github/workflows/build-pr.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										23
									
								
								.github/workflows/build-pr.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,23 +0,0 @@ | ||||
| name: Build PR | ||||
|  | ||||
| on: [ pull_request ] | ||||
|  | ||||
| jobs: | ||||
|   build_pr: | ||||
|     if: github.repository_owner == 'IntellectualSites' | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       matrix: | ||||
|         os: [ ubuntu-latest, windows-latest, macos-latest ] | ||||
|     steps: | ||||
|       - name: Checkout Repository | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: Validate Gradle Wrapper | ||||
|         uses: gradle/wrapper-validation-action@v1 | ||||
|       - name: Setup Java | ||||
|         uses: actions/setup-java@v3 | ||||
|         with: | ||||
|           distribution: temurin | ||||
|           java-version: 17 | ||||
|       - name: Clean Build | ||||
|         run: ./gradlew clean build | ||||
							
								
								
									
										61
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										61
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,23 +1,66 @@ | ||||
| name: build | ||||
|  | ||||
| on: | ||||
|   push: | ||||
|     branches: | ||||
|       - shadow-debug | ||||
| on: [ pull_request, push ] | ||||
|  | ||||
| jobs: | ||||
|   build: | ||||
|     if: github.repository_owner == 'IntellectualSites' | ||||
|     runs-on: macos-latest | ||||
|     if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }} | ||||
|     runs-on: ubuntu-latest | ||||
|     steps: | ||||
|       - name: Checkout Repository | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: Validate Gradle Wrapper | ||||
|       - name: Validate Gradle Wrapper" | ||||
|         uses: gradle/wrapper-validation-action@v1 | ||||
|       - name: Setup Java | ||||
|         uses: actions/setup-java@v3 | ||||
|         with: | ||||
|           distribution: temurin | ||||
|           java-version: 17 | ||||
|       - name: Build on macos-latest | ||||
|         run: ./gradlew clean build --warning-mode all | ||||
|       - name: Clean Build | ||||
|         run: ./gradlew clean build | ||||
|       - name: Determine release status | ||||
|         if: ${{ runner.os == 'Linux' }} | ||||
|         run: | | ||||
|           if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then | ||||
|             echo "STATUS=snapshot" >> $GITHUB_ENV | ||||
|           else | ||||
|             echo "STATUS=release" >> $GITHUB_ENV | ||||
|           fi | ||||
|       - name: Publish Release | ||||
|         if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6'}} | ||||
|         run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository | ||||
|         env: | ||||
|           ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} | ||||
|           ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} | ||||
|           ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }} | ||||
|           ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }} | ||||
|       - name: Publish Snapshot | ||||
|         if: ${{ runner.os == 'Linux' && env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6' }} | ||||
|         run: ./gradlew publishToSonatype | ||||
|         env: | ||||
|           ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} | ||||
|           ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} | ||||
|       - name: Publish core javadoc | ||||
|         if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6'}} | ||||
|         uses: cpina/github-action-push-to-another-repository@main | ||||
|         env: | ||||
|           SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} | ||||
|         with: | ||||
|           source-directory: 'Core/build/docs/javadoc' | ||||
|           destination-github-username: 'IntellectualSites' | ||||
|           destination-repository-name: 'plotsquared-javadocs' | ||||
|           user-email: ${{ secrets.USER_EMAIL }} | ||||
|           target-branch: main | ||||
|           target-directory: core | ||||
|       - name: Publish bukkit javadoc | ||||
|         if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6'}} | ||||
|         uses: cpina/github-action-push-to-another-repository@main | ||||
|         env: | ||||
|           SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} | ||||
|         with: | ||||
|           source-directory: 'Bukkit/build/docs/javadoc' | ||||
|           destination-github-username: 'IntellectualSites' | ||||
|           destination-repository-name: 'plotsquared-javadocs' | ||||
|           user-email: ${{ secrets.USER_EMAIL }} | ||||
|           target-branch: main | ||||
|           target-directory: bukkit | ||||
|   | ||||
							
								
								
									
										2
									
								
								.github/workflows/codeql.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/codeql.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,6 +1,8 @@ | ||||
| name: "CodeQL" | ||||
|  | ||||
| on: | ||||
|   push: | ||||
|     branches: [ v6 ] | ||||
|   pull_request: | ||||
|     # The branches below must be a subset of the branches above | ||||
|     branches: [ v6 ] | ||||
|   | ||||
| @@ -98,7 +98,6 @@ tasks.named<ShadowJar>("shadowJar") { | ||||
|  | ||||
| tasks { | ||||
|     withType<Javadoc> { | ||||
|         val isRelease = if (rootProject.version.toString().endsWith("-SNAPSHOT")) "TODO" else rootProject.version.toString() | ||||
|         val opt = options as StandardJavadocDocletOptions | ||||
|         opt.links("https://jd.papermc.io/paper/1.18/") | ||||
|         opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-bukkit/" + libs.worldeditBukkit.get().versionConstraint.toString()) | ||||
| @@ -106,11 +105,6 @@ tasks { | ||||
|         opt.links("https://jd.adventure.kyori.net/api/4.9.3/") | ||||
|         opt.links("https://google.github.io/guice/api-docs/" + libs.guice.get().versionConstraint.toString() + "/javadoc/") | ||||
|         opt.links("https://checkerframework.org/api/") | ||||
|         opt.isLinkSource = true | ||||
|         opt.bottom(File("$rootDir/javadocfooter.html").readText()) | ||||
|         opt.isUse = true | ||||
|         opt.encoding("UTF-8") | ||||
|         opt.keyWords() | ||||
|         opt.addStringOption("-since", isRelease) | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -36,6 +36,7 @@ import com.plotsquared.bukkit.listener.ChunkListener; | ||||
| import com.plotsquared.bukkit.listener.EntityEventListener; | ||||
| import com.plotsquared.bukkit.listener.EntitySpawnListener; | ||||
| import com.plotsquared.bukkit.listener.PaperListener; | ||||
| import com.plotsquared.bukkit.listener.PaperListener113; | ||||
| import com.plotsquared.bukkit.listener.PlayerEventListener; | ||||
| import com.plotsquared.bukkit.listener.ProjectileEventListener; | ||||
| import com.plotsquared.bukkit.listener.ServerListener; | ||||
| @@ -355,7 +356,11 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl | ||||
|             getServer().getPluginManager().registerEvents(injector().getInstance(ServerListener.class), this); | ||||
|             getServer().getPluginManager().registerEvents(injector().getInstance(EntitySpawnListener.class), this); | ||||
|             if (PaperLib.isPaper() && Settings.Paper_Components.PAPER_LISTENERS) { | ||||
|                 if (serverVersion()[1] == 13) { | ||||
|                     getServer().getPluginManager().registerEvents(injector().getInstance(PaperListener113.class), this); | ||||
|                 } else { | ||||
|                     getServer().getPluginManager().registerEvents(injector().getInstance(PaperListener.class), this); | ||||
|                 } | ||||
|             } else { | ||||
|                 getServer().getPluginManager().registerEvents(injector().getInstance(SpigotListener.class), this); | ||||
|             } | ||||
|   | ||||
| @@ -55,6 +55,7 @@ import com.plotsquared.core.plot.flag.implementations.VineGrowFlag; | ||||
| import com.plotsquared.core.plot.flag.types.BlockTypeWrapper; | ||||
| import com.plotsquared.core.plot.flag.types.BooleanFlag; | ||||
| import com.plotsquared.core.plot.world.PlotAreaManager; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.PlotFlagUtil; | ||||
| import com.plotsquared.core.util.task.TaskManager; | ||||
| import com.plotsquared.core.util.task.TaskTime; | ||||
| @@ -277,7 +278,7 @@ public class BlockEventListener implements Listener { | ||||
|                 return; | ||||
|             } | ||||
|             if (!plot.hasOwner()) { | ||||
|                 if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) { | ||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) { | ||||
|                     pp.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission_event"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) | ||||
| @@ -294,7 +295,7 @@ public class BlockEventListener implements Listener { | ||||
|                         return; | ||||
|                     } | ||||
|                 } | ||||
|                 if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||
|                     pp.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission_event"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER)) | ||||
| @@ -305,7 +306,7 @@ public class BlockEventListener implements Listener { | ||||
|                     return; | ||||
|                 } | ||||
|             } else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { | ||||
|                 if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||
|                     pp.sendMessage( | ||||
|                             TranslatableCaption.of("done.building_restricted") | ||||
|                     ); | ||||
| @@ -321,7 +322,7 @@ public class BlockEventListener implements Listener { | ||||
|                             + " did not fall because of disable-physics = true"); | ||||
|                 } | ||||
|             } | ||||
|         } else if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_ROAD)) { | ||||
|         } else if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) { | ||||
|             pp.sendMessage( | ||||
|                     TranslatableCaption.of("permission.no_permission_event"), | ||||
|                     Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD)) | ||||
| @@ -343,7 +344,8 @@ public class BlockEventListener implements Listener { | ||||
|             BukkitPlayer plotPlayer = BukkitUtil.adapt(player); | ||||
|             // == rather than <= as we only care about the "ground level" not being destroyed | ||||
|             if (event.getBlock().getY() == area.getMinGenHeight()) { | ||||
|                 if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL)) { | ||||
|                 if (!Permissions | ||||
|                         .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL)) { | ||||
|                     plotPlayer.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission_event"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL)) | ||||
| @@ -356,7 +358,8 @@ public class BlockEventListener implements Listener { | ||||
|                 return; | ||||
|             } | ||||
|             if (!plot.hasOwner()) { | ||||
|                 if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_UNOWNED, true)) { | ||||
|                 if (!Permissions | ||||
|                         .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_UNOWNED, true)) { | ||||
|                     event.setCancelled(true); | ||||
|                 } | ||||
|                 return; | ||||
| @@ -370,7 +373,8 @@ public class BlockEventListener implements Listener { | ||||
|                         return; | ||||
|                     } | ||||
|                 } | ||||
|                 if (plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_OTHER)) { | ||||
|                 if (Permissions | ||||
|                         .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_OTHER)) { | ||||
|                     return; | ||||
|                 } | ||||
|                 plotPlayer.sendMessage( | ||||
| @@ -379,7 +383,7 @@ public class BlockEventListener implements Listener { | ||||
|                 ); | ||||
|                 event.setCancelled(true); | ||||
|             } else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { | ||||
|                 if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||
|                 if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||
|                     plotPlayer.sendMessage( | ||||
|                             TranslatableCaption.of("done.building_restricted") | ||||
|                     ); | ||||
| @@ -390,7 +394,7 @@ public class BlockEventListener implements Listener { | ||||
|             return; | ||||
|         } | ||||
|         BukkitPlayer pp = BukkitUtil.adapt(player); | ||||
|         if (pp.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_ROAD)) { | ||||
|         if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_ROAD)) { | ||||
|             return; | ||||
|         } | ||||
|         if (this.worldEdit != null && pp.getAttribute("worldedit")) { | ||||
| @@ -475,18 +479,18 @@ public class BlockEventListener implements Listener { | ||||
|                     BukkitPlayer plotPlayer = BukkitUtil.adapt(player); | ||||
|                     if (plot != null) { | ||||
|                         if (!plot.hasOwner()) { | ||||
|                             if (plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) { | ||||
|                             if (Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) { | ||||
|                                 return; | ||||
|                             } | ||||
|                         } else if (!plot.isAdded(plotPlayer.getUUID())) { | ||||
|                             if (plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_OTHER)) { | ||||
|                             if (Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) { | ||||
|                                 return; | ||||
|                             } | ||||
|                         } else { | ||||
|                             return; | ||||
|                         } | ||||
|                     } else { | ||||
|                         if (plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_ROAD)) { | ||||
|                         if (Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_INTERACT_ROAD)) { | ||||
|                             return; | ||||
|                         } | ||||
|                         if (this.worldEdit != null && plotPlayer.getAttribute("worldedit")) { | ||||
| @@ -631,7 +635,8 @@ public class BlockEventListener implements Listener { | ||||
|             } | ||||
|             if (!plot.hasOwner()) { | ||||
|                 BukkitPlayer plotPlayer = BukkitUtil.adapt(player); | ||||
|                 if (plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) { | ||||
|                 if (Permissions | ||||
|                         .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) { | ||||
|                     return; | ||||
|                 } | ||||
|                 event.setCancelled(true); | ||||
| @@ -643,7 +648,8 @@ public class BlockEventListener implements Listener { | ||||
|                 Block block = event.getBlock(); | ||||
|                 if (destroy | ||||
|                         .contains(BlockTypeWrapper.get(BukkitAdapter.asBlockType(block.getType()))) | ||||
|                         || plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_OTHER)) { | ||||
|                         || Permissions | ||||
|                         .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_OTHER)) { | ||||
|                     return; | ||||
|                 } | ||||
|                 plot.debug(player.getName() + " could not break " + block.getType() | ||||
| @@ -654,7 +660,7 @@ public class BlockEventListener implements Listener { | ||||
|             return; | ||||
|         } | ||||
|         BukkitPlayer plotPlayer = BukkitUtil.adapt(player); | ||||
|         if (plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_ROAD)) { | ||||
|         if (Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_ROAD)) { | ||||
|             return; | ||||
|         } | ||||
|         event.setCancelled(true); | ||||
| @@ -1082,7 +1088,8 @@ public class BlockEventListener implements Listener { | ||||
|                 return; | ||||
|             } | ||||
|             if (plot == null) { | ||||
|                 if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, BlockIgnitionFlag.class, true) && !pp.hasPermission( | ||||
|                 if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, BlockIgnitionFlag.class, true) && !Permissions.hasPermission( | ||||
|                         pp, | ||||
|                         Permission.PERMISSION_ADMIN_BUILD_ROAD | ||||
|                 )) { | ||||
|                     pp.sendMessage( | ||||
| @@ -1092,7 +1099,8 @@ public class BlockEventListener implements Listener { | ||||
|                     event.setCancelled(true); | ||||
|                 } | ||||
|             } else if (!plot.hasOwner()) { | ||||
|                 if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, BlockIgnitionFlag.class, true) && !pp.hasPermission( | ||||
|                 if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, BlockIgnitionFlag.class, true) && !Permissions.hasPermission( | ||||
|                         pp, | ||||
|                         Permission.PERMISSION_ADMIN_BUILD_UNOWNED | ||||
|                 )) { | ||||
|                     pp.sendMessage( | ||||
| @@ -1102,7 +1110,7 @@ public class BlockEventListener implements Listener { | ||||
|                     event.setCancelled(true); | ||||
|                 } | ||||
|             } else if (!plot.isAdded(pp.getUUID())) { | ||||
|                 if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||
|                     pp.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission_event"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER)) | ||||
| @@ -1226,7 +1234,8 @@ public class BlockEventListener implements Listener { | ||||
|  | ||||
|         for (final BlockState state : event.getReplacedBlockStates()) { | ||||
|             Location currentLocation = BukkitUtil.adapt(state.getLocation()); | ||||
|             if (!pp.hasPermission( | ||||
|             if (!Permissions.hasPermission( | ||||
|                     pp, | ||||
|                     Permission.PERMISSION_ADMIN_BUILD_ROAD | ||||
|             ) && !(Objects.equals(currentLocation.getPlot(), plot))) { | ||||
|                 pp.sendMessage( | ||||
|   | ||||
| @@ -37,6 +37,7 @@ import com.plotsquared.core.plot.flag.implementations.ExplosionFlag; | ||||
| import com.plotsquared.core.plot.flag.implementations.InvincibleFlag; | ||||
| import com.plotsquared.core.plot.world.PlotAreaManager; | ||||
| import com.plotsquared.core.util.EventDispatcher; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.PlotFlagUtil; | ||||
| import com.sk89q.worldedit.bukkit.BukkitAdapter; | ||||
| import com.sk89q.worldedit.world.block.BlockType; | ||||
| @@ -370,13 +371,14 @@ public class EntityEventListener implements Listener { | ||||
|             if (shooter instanceof Player) { | ||||
|                 PlotPlayer<?> pp = BukkitUtil.adapt((Player) shooter); | ||||
|                 if (plot == null) { | ||||
|                     if (!pp.hasPermission(Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) { | ||||
|                     if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) { | ||||
|                         entity.remove(); | ||||
|                         event.setCancelled(true); | ||||
|                     } | ||||
|                     return; | ||||
|                 } | ||||
|                 if (plot.isAdded(pp.getUUID()) || pp.hasPermission(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) { | ||||
|                 if (plot.isAdded(pp.getUUID()) || Permissions | ||||
|                         .hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) { | ||||
|                     return; | ||||
|                 } | ||||
|                 entity.remove(); | ||||
|   | ||||
| @@ -25,6 +25,7 @@ import com.plotsquared.core.permissions.Permission; | ||||
| import com.plotsquared.core.player.PlotPlayer; | ||||
| import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.plot.flag.implementations.ForcefieldFlag; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import org.bukkit.entity.Player; | ||||
| import org.bukkit.util.Vector; | ||||
|  | ||||
| @@ -108,7 +109,8 @@ public class ForceFieldListener { | ||||
|             if (plot.isAdded(uuid)) { | ||||
|                 Set<PlotPlayer<?>> players = getNearbyPlayers(player, plot); | ||||
|                 for (PlotPlayer<?> oPlayer : players) { | ||||
|                     if (!oPlayer.hasPermission(Permission.PERMISSION_ADMIN_ENTRY_FORCEFIELD)) { | ||||
|                     if (!Permissions | ||||
|                             .hasPermission(oPlayer, Permission.PERMISSION_ADMIN_ENTRY_FORCEFIELD)) { | ||||
|                         ((BukkitPlayer) oPlayer).player | ||||
|                                 .setVelocity(calculateVelocity(plotPlayer, oPlayer)); | ||||
|                     } | ||||
| @@ -118,7 +120,8 @@ public class ForceFieldListener { | ||||
|                 if (oPlayer == null) { | ||||
|                     return; | ||||
|                 } | ||||
|                 if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_ENTRY_FORCEFIELD)) { | ||||
|                 if (!Permissions | ||||
|                         .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_ENTRY_FORCEFIELD)) { | ||||
|                     player.setVelocity(calculateVelocity(oPlayer, plotPlayer)); | ||||
|                 } | ||||
|             } | ||||
|   | ||||
| @@ -43,6 +43,7 @@ import com.plotsquared.core.plot.flag.implementations.DoneFlag; | ||||
| import com.plotsquared.core.plot.flag.implementations.ProjectilesFlag; | ||||
| import com.plotsquared.core.plot.flag.types.BooleanFlag; | ||||
| import com.plotsquared.core.plot.world.PlotAreaManager; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.PlotFlagUtil; | ||||
| import net.kyori.adventure.text.minimessage.Template; | ||||
| import org.bukkit.Chunk; | ||||
| @@ -334,7 +335,8 @@ public class PaperListener implements Listener { | ||||
|         Plot plot = location.getOwnedPlot(); | ||||
|  | ||||
|         if (plot == null) { | ||||
|             if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, ProjectilesFlag.class, true) && !pp.hasPermission( | ||||
|             if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, ProjectilesFlag.class, true) && !Permissions.hasPermission( | ||||
|                     pp, | ||||
|                     Permission.PERMISSION_ADMIN_PROJECTILE_ROAD | ||||
|             )) { | ||||
|                 pp.sendMessage( | ||||
| @@ -345,7 +347,7 @@ public class PaperListener implements Listener { | ||||
|                 event.setCancelled(true); | ||||
|             } | ||||
|         } else if (!plot.hasOwner()) { | ||||
|             if (!pp.hasPermission(Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) { | ||||
|             if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) { | ||||
|                 pp.sendMessage( | ||||
|                         TranslatableCaption.of("permission.no_permission_event"), | ||||
|                         Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) | ||||
| @@ -355,7 +357,7 @@ public class PaperListener implements Listener { | ||||
|             } | ||||
|         } else if (!plot.isAdded(pp.getUUID())) { | ||||
|             if (!plot.getFlag(ProjectilesFlag.class)) { | ||||
|                 if (!pp.hasPermission(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) { | ||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) { | ||||
|                     pp.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission_event"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) | ||||
|   | ||||
| @@ -67,6 +67,7 @@ import com.plotsquared.core.plot.flag.implementations.VillagerInteractFlag; | ||||
| import com.plotsquared.core.plot.world.PlotAreaManager; | ||||
| import com.plotsquared.core.util.EventDispatcher; | ||||
| import com.plotsquared.core.util.MathMan; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.PlotFlagUtil; | ||||
| import com.plotsquared.core.util.PremiumVerification; | ||||
| import com.plotsquared.core.util.entity.EntityCategories; | ||||
| @@ -274,10 +275,8 @@ public class PlayerEventListener implements Listener { | ||||
|         switch (parts[0]) { | ||||
|             case "up": | ||||
|             case "worldedit:up": | ||||
|                 if (plot == null || (!plot.isAdded(plotPlayer.getUUID()) && !plotPlayer.hasPermission( | ||||
|                         Permission.PERMISSION_ADMIN_BUILD_OTHER, | ||||
|                         true | ||||
|                 ))) { | ||||
|                 if (plot == null || (!plot.isAdded(plotPlayer.getUUID()) && !Permissions | ||||
|                         .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER, true))) { | ||||
|                     event.setCancelled(true); | ||||
|                     return; | ||||
|                 } | ||||
| @@ -292,7 +291,7 @@ public class PlayerEventListener implements Listener { | ||||
|         if (blockedCommands.isEmpty()) { | ||||
|             return; | ||||
|         } | ||||
|         if (plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_BLOCKED_CMDS)) { | ||||
|         if (Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_INTERACT_BLOCKED_CMDS)) { | ||||
|             return; | ||||
|         } | ||||
|         // When using namespaced commands, we're not interested in the namespace | ||||
| @@ -311,7 +310,7 @@ public class PlayerEventListener implements Listener { | ||||
|                 } else { | ||||
|                     perm = "plots.admin.command.blocked-cmds.road"; | ||||
|                 } | ||||
|                 if (!plotPlayer.hasPermission(perm)) { | ||||
|                 if (!Permissions.hasPermission(plotPlayer, perm)) { | ||||
|                     plotPlayer.sendMessage(TranslatableCaption.of("blockedcmds.command_blocked")); | ||||
|                     event.setCancelled(true); | ||||
|                 } | ||||
| @@ -601,7 +600,7 @@ public class PlayerEventListener implements Listener { | ||||
|             int border = area.getBorder(); | ||||
|             int x1; | ||||
|             if (x2 > border && this.tmpTeleport) { | ||||
|                 if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BYPASS_BORDER)) { | ||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) { | ||||
|                     to.setX(border - 1); | ||||
|                     this.tmpTeleport = false; | ||||
|                     player.teleport(event.getTo()); | ||||
| @@ -611,7 +610,7 @@ public class PlayerEventListener implements Listener { | ||||
|                     pp.sendMessage(TranslatableCaption.of("border.bypass.exited")); | ||||
|                 } | ||||
|             } else if (x2 < -border && this.tmpTeleport) { | ||||
|                 if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BYPASS_BORDER)) { | ||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) { | ||||
|                     to.setX(-border + 1); | ||||
|                     this.tmpTeleport = false; | ||||
|                     player.teleport(event.getTo()); | ||||
| @@ -621,7 +620,7 @@ public class PlayerEventListener implements Listener { | ||||
|                     pp.sendMessage(TranslatableCaption.of("border.bypass.exited")); | ||||
|                 } | ||||
|             } else if (((x1 = MathMan.roundInt(from.getX())) >= border && x2 <= border) || (x1 <= -border && x2 >= -border)) { | ||||
|                 if (pp.hasPermission(Permission.PERMISSION_ADMIN_BYPASS_BORDER)) { | ||||
|                 if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) { | ||||
|                     pp.sendMessage(TranslatableCaption.of("border.bypass.entered")); | ||||
|                 } | ||||
|             } | ||||
| @@ -692,7 +691,7 @@ public class PlayerEventListener implements Listener { | ||||
|             int border = area.getBorder(); | ||||
|             int z1; | ||||
|             if (z2 > border && this.tmpTeleport) { | ||||
|                 if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BYPASS_BORDER)) { | ||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) { | ||||
|                     to.setZ(border - 1); | ||||
|                     this.tmpTeleport = false; | ||||
|                     player.teleport(event.getTo()); | ||||
| @@ -702,7 +701,7 @@ public class PlayerEventListener implements Listener { | ||||
|                     pp.sendMessage(TranslatableCaption.of("border.bypass.exited")); | ||||
|                 } | ||||
|             } else if (z2 < -border && this.tmpTeleport) { | ||||
|                 if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BYPASS_BORDER)) { | ||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) { | ||||
|                     to.setZ(-border + 1); | ||||
|                     this.tmpTeleport = false; | ||||
|                     player.teleport(event.getTo()); | ||||
| @@ -712,7 +711,7 @@ public class PlayerEventListener implements Listener { | ||||
|                     pp.sendMessage(TranslatableCaption.of("border.bypass.exited")); | ||||
|                 } | ||||
|             } else if (((z1 = MathMan.roundInt(from.getZ())) >= border && z2 <= border) || (z1 <= -border && z2 >= -border)) { | ||||
|                 if (pp.hasPermission(Permission.PERMISSION_ADMIN_BYPASS_BORDER)) { | ||||
|                 if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) { | ||||
|                     pp.sendMessage(TranslatableCaption.of("border.bypass.entered")); | ||||
|                 } | ||||
|             } | ||||
| @@ -739,7 +738,8 @@ public class PlayerEventListener implements Listener { | ||||
|                 || area.isForcingPlotChat())) { | ||||
|             return; | ||||
|         } | ||||
|         if (plot.isDenied(plotPlayer.getUUID()) && !plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_CHAT_BYPASS)) { | ||||
|         if (plot.isDenied(plotPlayer.getUUID()) && !Permissions | ||||
|                 .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_CHAT_BYPASS)) { | ||||
|             return; | ||||
|         } | ||||
|         event.setCancelled(true); | ||||
| @@ -824,7 +824,7 @@ public class PlayerEventListener implements Listener { | ||||
|             plotListener.plotExit(pp, plot); | ||||
|         } | ||||
|         if (this.worldEdit != null) { | ||||
|             if (!pp.hasPermission(Permission.PERMISSION_WORLDEDIT_BYPASS)) { | ||||
|             if (!Permissions.hasPermission(pp, Permission.PERMISSION_WORLDEDIT_BYPASS)) { | ||||
|                 if (pp.getAttribute("worldedit")) { | ||||
|                     pp.removeAttribute("worldedit"); | ||||
|                 } | ||||
| @@ -880,7 +880,8 @@ public class PlayerEventListener implements Listener { | ||||
|             final Plot plot = pp.getCurrentPlot(); | ||||
|             if (plot != null) { | ||||
|                 if (plot.getFlag(PreventCreativeCopyFlag.class) && !plot | ||||
|                         .isAdded(player.getUniqueId()) && !pp.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_OTHER)) { | ||||
|                         .isAdded(player.getUniqueId()) && !Permissions | ||||
|                         .hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) { | ||||
|                     final ItemStack newStack = | ||||
|                             new ItemStack(newItem.getType(), newItem.getAmount()); | ||||
|                     event.setCursor(newStack); | ||||
| @@ -942,7 +943,7 @@ public class PlayerEventListener implements Listener { | ||||
|         Plot plot = area.getPlotAbs(location); | ||||
|         boolean cancelled = false; | ||||
|         if (plot == null) { | ||||
|             if (!pp.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_ROAD)) { | ||||
|             if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_ROAD)) { | ||||
|                 pp.sendMessage( | ||||
|                         TranslatableCaption.of("permission.no_permission_event"), | ||||
|                         Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD)) | ||||
| @@ -950,7 +951,7 @@ public class PlayerEventListener implements Listener { | ||||
|                 cancelled = true; | ||||
|             } | ||||
|         } else if (!plot.hasOwner()) { | ||||
|             if (!pp.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) { | ||||
|             if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) { | ||||
|                 pp.sendMessage( | ||||
|                         TranslatableCaption.of("permission.no_permission_event"), | ||||
|                         Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) | ||||
| @@ -960,7 +961,7 @@ public class PlayerEventListener implements Listener { | ||||
|         } else { | ||||
|             UUID uuid = pp.getUUID(); | ||||
|             if (!plot.isAdded(uuid)) { | ||||
|                 if (!pp.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_OTHER)) { | ||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) { | ||||
|                     pp.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission_event"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_OTHER)) | ||||
| @@ -997,7 +998,8 @@ public class PlayerEventListener implements Listener { | ||||
|         Plot plot = location.getPlotAbs(); | ||||
|         BukkitPlayer pp = BukkitUtil.adapt(e.getPlayer()); | ||||
|         if (plot == null) { | ||||
|             if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, MiscInteractFlag.class, true) && !pp.hasPermission( | ||||
|             if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, MiscInteractFlag.class, true) && !Permissions.hasPermission( | ||||
|                     pp, | ||||
|                     Permission.PERMISSION_ADMIN_INTERACT_ROAD | ||||
|             )) { | ||||
|                 pp.sendMessage( | ||||
| @@ -1008,14 +1010,14 @@ public class PlayerEventListener implements Listener { | ||||
|             } | ||||
|         } else { | ||||
|             if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { | ||||
|                 if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||
|                     pp.sendMessage(TranslatableCaption.of("done.building_restricted")); | ||||
|                     e.setCancelled(true); | ||||
|                     return; | ||||
|                 } | ||||
|             } | ||||
|             if (!plot.hasOwner()) { | ||||
|                 if (!pp.hasPermission("plots.admin.interact.unowned")) { | ||||
|                 if (!Permissions.hasPermission(pp, "plots.admin.interact.unowned")) { | ||||
|                     pp.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission_event"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) | ||||
| @@ -1030,7 +1032,7 @@ public class PlayerEventListener implements Listener { | ||||
|                 if (plot.getFlag(MiscInteractFlag.class)) { | ||||
|                     return; | ||||
|                 } | ||||
|                 if (!pp.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_OTHER)) { | ||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) { | ||||
|                     pp.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission_event"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_OTHER)) | ||||
| @@ -1255,7 +1257,7 @@ public class PlayerEventListener implements Listener { | ||||
|         BukkitPlayer pp = BukkitUtil.adapt(event.getPlayer()); | ||||
|         Plot plot = area.getPlot(location); | ||||
|         if (plot == null) { | ||||
|             if (pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_ROAD)) { | ||||
|             if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) { | ||||
|                 return; | ||||
|             } | ||||
|             pp.sendMessage( | ||||
| @@ -1264,7 +1266,7 @@ public class PlayerEventListener implements Listener { | ||||
|             ); | ||||
|             event.setCancelled(true); | ||||
|         } else if (!plot.hasOwner()) { | ||||
|             if (pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) { | ||||
|             if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) { | ||||
|                 return; | ||||
|             } | ||||
|             pp.sendMessage( | ||||
| @@ -1273,7 +1275,7 @@ public class PlayerEventListener implements Listener { | ||||
|             ); | ||||
|             event.setCancelled(true); | ||||
|         } else if (!plot.isAdded(pp.getUUID())) { | ||||
|             if (pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||
|             if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||
|                 return; | ||||
|             } | ||||
|             pp.sendMessage( | ||||
| @@ -1282,7 +1284,7 @@ public class PlayerEventListener implements Listener { | ||||
|             ); | ||||
|             event.setCancelled(true); | ||||
|         } else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { | ||||
|             if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||
|             if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||
|                 pp.sendMessage( | ||||
|                         TranslatableCaption.of("done.building_restricted") | ||||
|                 ); | ||||
| @@ -1320,7 +1322,7 @@ public class PlayerEventListener implements Listener { | ||||
|         BukkitPlayer plotPlayer = BukkitUtil.adapt(player); | ||||
|         Plot plot = area.getPlot(location); | ||||
|         if (plot == null) { | ||||
|             if (plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_BUILD_ROAD)) { | ||||
|             if (Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_ROAD)) { | ||||
|                 return; | ||||
|             } | ||||
|             plotPlayer.sendMessage( | ||||
| @@ -1329,7 +1331,7 @@ public class PlayerEventListener implements Listener { | ||||
|             ); | ||||
|             event.setCancelled(true); | ||||
|         } else if (!plot.hasOwner()) { | ||||
|             if (plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) { | ||||
|             if (Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) { | ||||
|                 return; | ||||
|             } | ||||
|             plotPlayer.sendMessage( | ||||
| @@ -1338,7 +1340,7 @@ public class PlayerEventListener implements Listener { | ||||
|             ); | ||||
|             event.setCancelled(true); | ||||
|         } else if (!plot.isAdded(plotPlayer.getUUID())) { | ||||
|             if (plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||
|             if (Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||
|                 return; | ||||
|             } | ||||
|             plotPlayer.sendMessage( | ||||
| @@ -1347,7 +1349,7 @@ public class PlayerEventListener implements Listener { | ||||
|             ); | ||||
|             event.setCancelled(true); | ||||
|         } else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { | ||||
|             if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||
|             if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||
|                 plotPlayer.sendMessage( | ||||
|                         TranslatableCaption.of("done.building_restricted") | ||||
|                 ); | ||||
| @@ -1372,7 +1374,7 @@ public class PlayerEventListener implements Listener { | ||||
|         BukkitPlayer pp = BukkitUtil.adapt(p); | ||||
|         Plot plot = area.getPlot(location); | ||||
|         if (plot == null) { | ||||
|             if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_ROAD)) { | ||||
|             if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) { | ||||
|                 pp.sendMessage( | ||||
|                         TranslatableCaption.of("permission.no_permission_event"), | ||||
|                         Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD)) | ||||
| @@ -1381,7 +1383,7 @@ public class PlayerEventListener implements Listener { | ||||
|             } | ||||
|         } else { | ||||
|             if (!plot.hasOwner()) { | ||||
|                 if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) { | ||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) { | ||||
|                     pp.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission_event"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) | ||||
| @@ -1392,7 +1394,7 @@ public class PlayerEventListener implements Listener { | ||||
|             } | ||||
|             if (!plot.isAdded(pp.getUUID())) { | ||||
|                 if (!plot.getFlag(HangingPlaceFlag.class)) { | ||||
|                     if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||
|                     if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||
|                         pp.sendMessage( | ||||
|                                 TranslatableCaption.of("permission.no_permission_event"), | ||||
|                                 Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER)) | ||||
| @@ -1421,7 +1423,7 @@ public class PlayerEventListener implements Listener { | ||||
|             BukkitPlayer pp = BukkitUtil.adapt(p); | ||||
|             Plot plot = area.getPlot(location); | ||||
|             if (plot == null) { | ||||
|                 if (!pp.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_ROAD)) { | ||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_ROAD)) { | ||||
|                     pp.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission_event"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_ROAD)) | ||||
| @@ -1429,7 +1431,7 @@ public class PlayerEventListener implements Listener { | ||||
|                     event.setCancelled(true); | ||||
|                 } | ||||
|             } else if (!plot.hasOwner()) { | ||||
|                 if (!pp.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) { | ||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) { | ||||
|                     pp.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission_event"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) | ||||
| @@ -1440,7 +1442,7 @@ public class PlayerEventListener implements Listener { | ||||
|                 if (plot.getFlag(HangingBreakFlag.class)) { | ||||
|                     return; | ||||
|                 } | ||||
|                 if (!pp.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_OTHER)) { | ||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_OTHER)) { | ||||
|                     pp.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission_event"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER)) | ||||
| @@ -1461,7 +1463,8 @@ public class PlayerEventListener implements Listener { | ||||
|                 Plot plot = area.getPlot(BukkitUtil.adapt(event.getEntity().getLocation())); | ||||
|                 if (plot != null) { | ||||
|                     if (!plot.hasOwner()) { | ||||
|                         if (!player.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) { | ||||
|                         if (!Permissions | ||||
|                                 .hasPermission(player, Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) { | ||||
|                             player.sendMessage( | ||||
|                                     TranslatableCaption.of("permission.no_permission_event"), | ||||
|                                     Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) | ||||
| @@ -1470,7 +1473,8 @@ public class PlayerEventListener implements Listener { | ||||
|                         } | ||||
|                     } else if (!plot.isAdded(player.getUUID())) { | ||||
|                         if (!plot.getFlag(HangingBreakFlag.class)) { | ||||
|                             if (!player.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_OTHER)) { | ||||
|                             if (!Permissions | ||||
|                                     .hasPermission(player, Permission.PERMISSION_ADMIN_DESTROY_OTHER)) { | ||||
|                                 player.sendMessage( | ||||
|                                         TranslatableCaption.of("permission.no_permission_event"), | ||||
|                                         Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER)) | ||||
| @@ -1502,7 +1506,7 @@ public class PlayerEventListener implements Listener { | ||||
|         BukkitPlayer pp = BukkitUtil.adapt(p); | ||||
|         Plot plot = area.getPlot(location); | ||||
|         if (plot == null && !area.isRoadFlags()) { | ||||
|             if (!pp.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_ROAD)) { | ||||
|             if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_ROAD)) { | ||||
|                 pp.sendMessage( | ||||
|                         TranslatableCaption.of("permission.no_permission_event"), | ||||
|                         Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD)) | ||||
| @@ -1510,7 +1514,7 @@ public class PlayerEventListener implements Listener { | ||||
|                 event.setCancelled(true); | ||||
|             } | ||||
|         } else if (plot != null && !plot.hasOwner()) { | ||||
|             if (!pp.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) { | ||||
|             if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) { | ||||
|                 pp.sendMessage( | ||||
|                         TranslatableCaption.of("permission.no_permission_event"), | ||||
|                         Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) | ||||
| @@ -1568,7 +1572,7 @@ public class PlayerEventListener implements Listener { | ||||
|                 return; | ||||
|             } | ||||
|  | ||||
|             if (!pp.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_OTHER)) { | ||||
|             if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) { | ||||
|                 pp.sendMessage( | ||||
|                         TranslatableCaption.of("permission.no_permission_event"), | ||||
|                         Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_OTHER)) | ||||
| @@ -1590,7 +1594,8 @@ public class PlayerEventListener implements Listener { | ||||
|             BukkitPlayer pp = BukkitUtil.adapt(p); | ||||
|             Plot plot = area.getPlot(location); | ||||
|             if (plot == null) { | ||||
|                 if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, VehicleBreakFlag.class, true) && !pp.hasPermission( | ||||
|                 if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, VehicleBreakFlag.class, true) && !Permissions.hasPermission( | ||||
|                         pp, | ||||
|                         Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_ROAD | ||||
|                 )) { | ||||
|                     pp.sendMessage( | ||||
| @@ -1601,7 +1606,7 @@ public class PlayerEventListener implements Listener { | ||||
|                 } | ||||
|             } else { | ||||
|                 if (!plot.hasOwner()) { | ||||
|                     if (!pp.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_UNOWNED)) { | ||||
|                     if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_UNOWNED)) { | ||||
|                         pp.sendMessage( | ||||
|                                 TranslatableCaption.of("permission.no_permission_event"), | ||||
|                                 Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_UNOWNED)) | ||||
| @@ -1615,7 +1620,7 @@ public class PlayerEventListener implements Listener { | ||||
|                     if (plot.getFlag(VehicleBreakFlag.class)) { | ||||
|                         return; | ||||
|                     } | ||||
|                     if (!pp.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_OTHER)) { | ||||
|                     if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_OTHER)) { | ||||
|                         pp.sendMessage( | ||||
|                                 TranslatableCaption.of("permission.no_permission_event"), | ||||
|                                 Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_OTHER)) | ||||
|   | ||||
| @@ -30,6 +30,7 @@ import com.plotsquared.core.plot.PlotArea; | ||||
| import com.plotsquared.core.plot.PlotHandler; | ||||
| import com.plotsquared.core.plot.flag.implementations.ProjectilesFlag; | ||||
| import com.plotsquared.core.plot.world.PlotAreaManager; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.PlotFlagUtil; | ||||
| import net.kyori.adventure.text.minimessage.Template; | ||||
| import org.bukkit.entity.Entity; | ||||
| @@ -105,7 +106,8 @@ public class ProjectileEventListener implements Listener { | ||||
|         Plot plot = location.getOwnedPlot(); | ||||
|  | ||||
|         if (plot == null) { | ||||
|             if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, ProjectilesFlag.class, true) && !pp.hasPermission( | ||||
|             if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, ProjectilesFlag.class, true) && !Permissions.hasPermission( | ||||
|                     pp, | ||||
|                     Permission.PERMISSION_ADMIN_PROJECTILE_ROAD | ||||
|             )) { | ||||
|                 pp.sendMessage( | ||||
| @@ -116,7 +118,7 @@ public class ProjectileEventListener implements Listener { | ||||
|                 event.setCancelled(true); | ||||
|             } | ||||
|         } else if (!plot.hasOwner()) { | ||||
|             if (!pp.hasPermission(Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) { | ||||
|             if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) { | ||||
|                 pp.sendMessage( | ||||
|                         TranslatableCaption.of("permission.no_permission_event"), | ||||
|                         Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) | ||||
| @@ -126,7 +128,7 @@ public class ProjectileEventListener implements Listener { | ||||
|             } | ||||
|         } else if (!plot.isAdded(pp.getUUID())) { | ||||
|             if (!plot.getFlag(ProjectilesFlag.class)) { | ||||
|                 if (!pp.hasPermission(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) { | ||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) { | ||||
|                     pp.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission_event"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) | ||||
| @@ -168,7 +170,8 @@ public class ProjectileEventListener implements Listener { | ||||
|  | ||||
|             PlotPlayer<?> pp = BukkitUtil.adapt((Player) shooter); | ||||
|             if (plot == null) { | ||||
|                 if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, ProjectilesFlag.class, true) && !pp.hasPermission( | ||||
|                 if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, ProjectilesFlag.class, true) && !Permissions.hasPermission( | ||||
|                         pp, | ||||
|                         Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED | ||||
|                 )) { | ||||
|                     entity.remove(); | ||||
| @@ -176,8 +179,8 @@ public class ProjectileEventListener implements Listener { | ||||
|                 } | ||||
|                 return; | ||||
|             } | ||||
|             if (plot.isAdded(pp.getUUID()) || pp.hasPermission(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER) || plot.getFlag( | ||||
|                     ProjectilesFlag.class)) { | ||||
|             if (plot.isAdded(pp.getUUID()) || Permissions | ||||
|                     .hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER) || plot.getFlag(ProjectilesFlag.class)) { | ||||
|                 return; | ||||
|             } | ||||
|             entity.remove(); | ||||
|   | ||||
| @@ -30,9 +30,8 @@ import org.checkerframework.checker.nullness.qual.Nullable; | ||||
|  * | ||||
|  * @deprecated Deprecated and scheduled for removal without replacement | ||||
|  *         in favor of the build in setup wizard. | ||||
|  *         However, this class will be kept around for a while, given it's not a maintenance burden. | ||||
|  */ | ||||
| @Deprecated | ||||
| @Deprecated(forRemoval = true, since = "6.0.0") | ||||
| @Singleton | ||||
| public class MultiverseWorldManager extends BukkitWorldManager { | ||||
|  | ||||
|   | ||||
| @@ -87,9 +87,4 @@ public class BukkitOfflinePlayer implements OfflinePlotPlayer { | ||||
|         ); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public boolean hasPermission(@NonNull final String permission, final boolean notify) { | ||||
|         return hasPermission(permission); | ||||
|     } | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -67,15 +67,14 @@ public class BukkitPlayer extends PlotPlayer<Player> { | ||||
|     private String name; | ||||
|  | ||||
|     /** | ||||
|      * <p>Please do not use this method. Instead use | ||||
|      * BukkitUtil.getPlayer(Player), as it caches player objects.</p> | ||||
|      * | ||||
|      * @param plotAreaManager   PlotAreaManager instance | ||||
|      * @param eventDispatcher   EventDispatcher instance | ||||
|      * @param player            Bukkit player instance | ||||
|      * @param permissionHandler PermissionHandler instance | ||||
|      * | ||||
|      * @deprecated Please do not use this method. Instead use {@link BukkitUtil#adapt(Player)}, as it caches player objects. | ||||
|      * This method will be made private in a future release. | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "TODO") | ||||
|     public BukkitPlayer( | ||||
|             final @NonNull PlotAreaManager plotAreaManager, final @NonNull EventDispatcher eventDispatcher, | ||||
|             final @NonNull Player player, final @NonNull PermissionHandler permissionHandler | ||||
| @@ -83,16 +82,6 @@ public class BukkitPlayer extends PlotPlayer<Player> { | ||||
|         this(plotAreaManager, eventDispatcher, player, false, permissionHandler); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @param plotAreaManager   PlotAreaManager instance | ||||
|      * @param eventDispatcher   EventDispatcher instance | ||||
|      * @param player            Bukkit player instance | ||||
|      * @param permissionHandler PermissionHandler instance | ||||
|      * | ||||
|      * @deprecated Please do not use this method. Instead use {@link BukkitUtil#adapt(Player)}, as it caches player objects. | ||||
|      * This method will be made private in a future release. | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "TODO") | ||||
|     public BukkitPlayer( | ||||
|             final @NonNull PlotAreaManager plotAreaManager, final @NonNull | ||||
|             EventDispatcher eventDispatcher, final @NonNull Player player, | ||||
|   | ||||
| @@ -54,7 +54,6 @@ public class BukkitPlayerManager extends PlayerManager<BukkitPlayer, Player> { | ||||
|  | ||||
|     @NonNull | ||||
|     @Override | ||||
|     @SuppressWarnings("deprecation") | ||||
|     public BukkitPlayer getPlayer(final @NonNull Player object) { | ||||
|         if (object.getUniqueId().version() == 2) { // not a real player | ||||
|             return new BukkitPlayer(this.plotAreaManager, this.eventDispatcher, object, false, this.permissionHandler); | ||||
| @@ -66,7 +65,6 @@ public class BukkitPlayerManager extends PlayerManager<BukkitPlayer, Player> { | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @SuppressWarnings("deprecation") | ||||
|     public @NonNull BukkitPlayer createPlayer(final @NonNull UUID uuid) { | ||||
|         final Player player = Bukkit.getPlayer(uuid); | ||||
|         if (player == null || !player.isOnline()) { | ||||
|   | ||||
| @@ -40,6 +40,7 @@ import com.plotsquared.core.plot.flag.implementations.PvpFlag; | ||||
| import com.plotsquared.core.plot.flag.implementations.TamedAttackFlag; | ||||
| import com.plotsquared.core.plot.flag.implementations.VehicleCapFlag; | ||||
| import com.plotsquared.core.util.EntityUtil; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.entity.EntityCategories; | ||||
| import com.sk89q.worldedit.bukkit.BukkitAdapter; | ||||
| import net.kyori.adventure.text.minimessage.Template; | ||||
| @@ -167,7 +168,8 @@ public class BukkitEntityUtil { | ||||
|                 if (plot != null && (plot.getFlag(HangingBreakFlag.class) || plot | ||||
|                         .isAdded(plotPlayer.getUUID()))) { | ||||
|                     if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { | ||||
|                         if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||
|                         if (!Permissions | ||||
|                                 .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||
|                             plotPlayer.sendMessage( | ||||
|                                     TranslatableCaption.of("done.building_restricted") | ||||
|                             ); | ||||
| @@ -176,7 +178,7 @@ public class BukkitEntityUtil { | ||||
|                     } | ||||
|                     return true; | ||||
|                 } | ||||
|                 if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_DESTROY + "." + stub)) { | ||||
|                 if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY + "." + stub)) { | ||||
|                     plotPlayer.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission_event"), | ||||
|                             Template.of("node", Permission.PERMISSION_ADMIN_DESTROY + "." + stub) | ||||
| @@ -188,7 +190,7 @@ public class BukkitEntityUtil { | ||||
|                         .isAdded(plotPlayer.getUUID()))) { | ||||
|                     return true; | ||||
|                 } | ||||
|                 if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_DESTROY + "." + stub)) { | ||||
|                 if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY + "." + stub)) { | ||||
|                     plotPlayer.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission_event"), | ||||
|                             Template.of("node", Permission.PERMISSION_ADMIN_DESTROY + "." + stub) | ||||
| @@ -209,7 +211,7 @@ public class BukkitEntityUtil { | ||||
|                         .getFlag(PveFlag.class))) { | ||||
|                     return true; | ||||
|                 } | ||||
|                 if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_PVE + "." + stub)) { | ||||
|                 if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) { | ||||
|                     plotPlayer.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission_event"), | ||||
|                             Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub) | ||||
| @@ -230,7 +232,7 @@ public class BukkitEntityUtil { | ||||
|                         .getFlag(PveFlag.class))) { | ||||
|                     return true; | ||||
|                 } | ||||
|                 if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_PVE + "." + stub)) { | ||||
|                 if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) { | ||||
|                     plotPlayer.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission_event"), | ||||
|                             Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub) | ||||
| @@ -243,7 +245,8 @@ public class BukkitEntityUtil { | ||||
|                 } | ||||
|             } else if (EntityCategories.PLAYER.contains(entityType)) { | ||||
|                 if (isPlot) { | ||||
|                     if (!plot.getFlag(PvpFlag.class) && !plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_PVP + "." + stub)) { | ||||
|                     if (!plot.getFlag(PvpFlag.class) && !Permissions | ||||
|                             .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVP + "." + stub)) { | ||||
|                         plotPlayer.sendMessage( | ||||
|                                 TranslatableCaption.of("permission.no_permission_event"), | ||||
|                                 Template.of("node", Permission.PERMISSION_ADMIN_PVP + "." + stub) | ||||
| @@ -257,7 +260,7 @@ public class BukkitEntityUtil { | ||||
|                 } else if (roadFlags && area.getRoadFlag(PvpFlag.class)) { | ||||
|                     return true; | ||||
|                 } | ||||
|                 if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_PVP + "." + stub)) { | ||||
|                 if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVP + "." + stub)) { | ||||
|                     plotPlayer.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission_event"), | ||||
|                             Template.of("node", Permission.PERMISSION_ADMIN_PVP + "." + stub) | ||||
| @@ -274,7 +277,7 @@ public class BukkitEntityUtil { | ||||
|                         .getFlag(PveFlag.class))) { | ||||
|                     return true; | ||||
|                 } | ||||
|                 if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_PVE + "." + stub)) { | ||||
|                 if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) { | ||||
|                     plotPlayer.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission_event"), | ||||
|                             Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub) | ||||
| @@ -296,7 +299,7 @@ public class BukkitEntityUtil { | ||||
|                 } else if (roadFlags && area.getRoadFlag(PveFlag.class)) { | ||||
|                     return true; | ||||
|                 } | ||||
|                 if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_PVE + "." + stub)) { | ||||
|                 if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) { | ||||
|                     plotPlayer.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission_event"), | ||||
|                             Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub) | ||||
|   | ||||
| @@ -24,6 +24,7 @@ import org.bukkit.Bukkit; | ||||
| import org.checkerframework.checker.nullness.qual.NonNull; | ||||
|  | ||||
| import java.util.Map; | ||||
| import java.util.Objects; | ||||
|  | ||||
| public class BukkitWorld implements World<org.bukkit.World> { | ||||
|  | ||||
|   | ||||
| @@ -80,3 +80,4 @@ public class FaweSchematicHandler extends SchematicHandler { | ||||
|     } | ||||
|  | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -65,18 +65,12 @@ tasks.processResources { | ||||
|  | ||||
| tasks { | ||||
|     withType<Javadoc> { | ||||
|         val isRelease = if (rootProject.version.toString().endsWith("-SNAPSHOT")) "TODO" else rootProject.version.toString() | ||||
|         val opt = options as StandardJavadocDocletOptions | ||||
|         opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-core/" + libs.worldeditCore.get().versionConstraint.toString()) | ||||
|         opt.links("https://jd.adventure.kyori.net/api/4.9.3/") | ||||
|         opt.links("https://google.github.io/guice/api-docs/" + libs.guice.get().versionConstraint.toString() + "/javadoc/") | ||||
|         opt.links("https://checkerframework.org/api/") | ||||
|         opt.links("https://javadoc.io/doc/com.intellectualsites.informative-annotations/informative-annotations/latest/") | ||||
|         opt.isLinkSource = true | ||||
|         opt.bottom(File("$rootDir/javadocfooter.html").readText()) | ||||
|         opt.isUse = true | ||||
|         opt.encoding("UTF-8") | ||||
|         opt.keyWords() | ||||
|         opt.addStringOption("-since", isRelease) | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -26,6 +26,7 @@ import com.plotsquared.core.permissions.Permission; | ||||
| import com.plotsquared.core.player.PlotPlayer; | ||||
| import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.util.EventDispatcher; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.PlayerManager; | ||||
| import com.plotsquared.core.util.TabCompletions; | ||||
| import com.plotsquared.core.util.task.RunnableVal2; | ||||
| @@ -57,20 +58,18 @@ public class Add extends Command { | ||||
|  | ||||
|     @Override | ||||
|     public CompletableFuture<Boolean> execute( | ||||
|             final PlotPlayer<?> player, | ||||
|             String[] args, | ||||
|             final PlotPlayer<?> player, String[] args, | ||||
|             RunnableVal3<Command, Runnable, Runnable> confirm, | ||||
|             RunnableVal2<Command, CommandResult> whenDone | ||||
|     ) throws CommandException { | ||||
|         final Plot plot = check(player.getCurrentPlot(), TranslatableCaption.of("errors.not_in_plot")); | ||||
|         checkTrue(plot.hasOwner(), TranslatableCaption.of("info.plot_unowned")); | ||||
|         checkTrue( | ||||
|                 plot.isOwner(player.getUUID()) || player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_TRUST), | ||||
|                 plot.isOwner(player.getUUID()) || Permissions | ||||
|                         .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_TRUST), | ||||
|                 TranslatableCaption.of("permission.no_plot_perms") | ||||
|         ); | ||||
|         checkTrue( | ||||
|                 args.length == 1, | ||||
|                 TranslatableCaption.of("commandconfig.command_syntax"), | ||||
|         checkTrue(args.length == 1, TranslatableCaption.of("commandconfig.command_syntax"), | ||||
|                 Template.of("value", "/plot add <player | *>") | ||||
|         ); | ||||
|         final CompletableFuture<Boolean> future = new CompletableFuture<>(); | ||||
| @@ -95,8 +94,9 @@ public class Add extends Command { | ||||
|                     int size = plot.getTrusted().size() + plot.getMembers().size(); | ||||
|                     while (iterator.hasNext()) { | ||||
|                         UUID uuid = iterator.next(); | ||||
|                         if (uuid == DBFunc.EVERYONE && !(player.hasPermission(Permission.PERMISSION_TRUST_EVERYONE) || player.hasPermission( | ||||
|                                 Permission.PERMISSION_ADMIN_COMMAND_TRUST))) { | ||||
|                         if (uuid == DBFunc.EVERYONE && !( | ||||
|                                 Permissions.hasPermission(player, Permission.PERMISSION_TRUST_EVERYONE) || Permissions | ||||
|                                         .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_TRUST))) { | ||||
|                             player.sendMessage( | ||||
|                                     TranslatableCaption.of("errors.invalid_player"), | ||||
|                                     Template.of("value", PlayerManager.resolveName(uuid).getComponent(player)) | ||||
| @@ -124,7 +124,7 @@ public class Add extends Command { | ||||
|                     } | ||||
|                     checkTrue(!uuids.isEmpty(), null); | ||||
|                     int localAddSize = plot.getMembers().size(); | ||||
|                     int maxAddSize = player.hasPermissionRange(Permission.PERMISSION_ADD, Settings.Limit.MAX_PLOTS); | ||||
|                     int maxAddSize = Permissions.hasPermissionRange(player, Permission.PERMISSION_ADD, Settings.Limit.MAX_PLOTS); | ||||
|                     if (localAddSize >= maxAddSize) { | ||||
|                         player.sendMessage( | ||||
|                                 TranslatableCaption.of("members.plot_max_members_added"), | ||||
|   | ||||
| @@ -26,6 +26,7 @@ import com.plotsquared.core.permissions.Permission; | ||||
| import com.plotsquared.core.player.PlotPlayer; | ||||
| import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.util.MathMan; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.query.PlotQuery; | ||||
| import net.kyori.adventure.text.minimessage.Template; | ||||
|  | ||||
| @@ -193,7 +194,7 @@ public class Alias extends SubCommand { | ||||
|     } | ||||
|  | ||||
|     private boolean isPermitted(PlotPlayer<?> player, Permission permission) { | ||||
|         return player.hasPermission(permission); | ||||
|         return Permissions.hasPermission(player, permission); | ||||
|     } | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -48,6 +48,7 @@ import com.plotsquared.core.queue.QueueCoordinator; | ||||
| import com.plotsquared.core.setup.PlotAreaBuilder; | ||||
| import com.plotsquared.core.util.FileUtils; | ||||
| import com.plotsquared.core.util.MathMan; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.RegionUtil; | ||||
| import com.plotsquared.core.util.SchematicHandler; | ||||
| import com.plotsquared.core.util.SetupUtils; | ||||
| @@ -137,7 +138,7 @@ public class Area extends SubCommand { | ||||
|                     player.sendMessage(RequiredType.CONSOLE.getErrorMessage()); | ||||
|                     return false; | ||||
|                 } | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_AREA_CREATE)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_CREATE)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_AREA_CREATE)) | ||||
| @@ -287,7 +288,7 @@ public class Area extends SubCommand { | ||||
|                 return true; | ||||
|             } | ||||
|             case "c", "setup", "create" -> { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_AREA_CREATE)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_CREATE)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_AREA_CREATE)) | ||||
| @@ -574,7 +575,7 @@ public class Area extends SubCommand { | ||||
|                 return true; | ||||
|             } | ||||
|             case "i", "info" -> { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_AREA_INFO)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_INFO)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_AREA_INFO)) | ||||
| @@ -652,7 +653,7 @@ public class Area extends SubCommand { | ||||
|                 return true; | ||||
|             } | ||||
|             case "l", "list" -> { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_AREA_LIST)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_LIST)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_AREA_LIST)) | ||||
| @@ -735,7 +736,7 @@ public class Area extends SubCommand { | ||||
|                 return true; | ||||
|             } | ||||
|             case "regen", "clear", "reset", "regenerate" -> { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_AREA_REGEN)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_REGEN)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_AREA_REGEN)) | ||||
| @@ -768,7 +769,7 @@ public class Area extends SubCommand { | ||||
|                 return true; | ||||
|             } | ||||
|             case "goto", "v", "teleport", "visit", "tp" -> { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_AREA_TP)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_TP)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_AREA_TP)) | ||||
| @@ -824,19 +825,19 @@ public class Area extends SubCommand { | ||||
|     public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) { | ||||
|         if (args.length == 1) { | ||||
|             final List<String> completions = new LinkedList<>(); | ||||
|             if (player.hasPermission(Permission.PERMISSION_AREA_CREATE)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_AREA_CREATE)) { | ||||
|                 completions.add("create"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_AREA_CREATE)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_AREA_CREATE)) { | ||||
|                 completions.add("single"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_AREA_LIST)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_AREA_LIST)) { | ||||
|                 completions.add("list"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_AREA_INFO)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_AREA_INFO)) { | ||||
|                 completions.add("info"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_AREA_TP)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_AREA_TP)) { | ||||
|                 completions.add("tp"); | ||||
|             } | ||||
|             final List<Command> commands = completions.stream().filter(completion -> completion | ||||
| @@ -851,7 +852,7 @@ public class Area extends SubCommand { | ||||
|                             CommandCategory.ADMINISTRATION | ||||
|                     ) { | ||||
|                     }).collect(Collectors.toCollection(LinkedList::new)); | ||||
|             if (player.hasPermission(Permission.PERMISSION_AREA) && args[0].length() > 0) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_AREA) && args[0].length() > 0) { | ||||
|                 commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList())); | ||||
|             } | ||||
|             return commands; | ||||
|   | ||||
| @@ -38,6 +38,7 @@ import com.plotsquared.core.plot.world.PlotAreaManager; | ||||
| import com.plotsquared.core.services.plots.AutoService; | ||||
| import com.plotsquared.core.util.EconHandler; | ||||
| import com.plotsquared.core.util.EventDispatcher; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.PlotExpression; | ||||
| import com.plotsquared.core.util.task.AutoClaimFinishTask; | ||||
| import com.plotsquared.core.util.task.RunnableVal; | ||||
| @@ -245,7 +246,7 @@ public class Auto extends SubCommand { | ||||
|         sizeX = event.getSizeX(); | ||||
|         sizeZ = event.getSizeZ(); | ||||
|         schematic = event.getSchematic(); | ||||
|         if (!force && mega && !player.hasPermission(Permission.PERMISSION_AUTO_MEGA)) { | ||||
|         if (!force && mega && !Permissions.hasPermission(player, Permission.PERMISSION_AUTO_MEGA)) { | ||||
|             player.sendMessage( | ||||
|                     TranslatableCaption.of("permission.no_permission"), | ||||
|                     Template.of("node", String.valueOf(Permission.PERMISSION_AUTO_MEGA)) | ||||
| @@ -278,9 +279,11 @@ public class Auto extends SubCommand { | ||||
|                 ); | ||||
|                 return true; | ||||
|             } | ||||
|             if (!force && !player.hasPermission( | ||||
|             if (!force && !Permissions.hasPermission( | ||||
|                     player, | ||||
|                     Permission.PERMISSION_CLAIM_SCHEMATIC.format(schematic) | ||||
|             ) && !player.hasPermission("plots.admin.command.schematic")) { | ||||
|             ) && !Permissions | ||||
|                     .hasPermission(player, "plots.admin.command.schematic")) { | ||||
|                 player.sendMessage( | ||||
|                         TranslatableCaption.of("permission.no_permission"), | ||||
|                         Template.of("node", "plots.claim.%s0") | ||||
|   | ||||
| @@ -27,6 +27,7 @@ import com.plotsquared.core.configuration.caption.TranslatableCaption; | ||||
| import com.plotsquared.core.permissions.Permission; | ||||
| import com.plotsquared.core.player.PlotPlayer; | ||||
| import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.task.RunnableVal2; | ||||
| import com.plotsquared.core.util.task.RunnableVal3; | ||||
| import net.kyori.adventure.text.minimessage.Template; | ||||
| @@ -143,7 +144,8 @@ public final class Backup extends Command { | ||||
|                     TranslatableCaption.of("backups.backup_impossible"), | ||||
|                     Template.of("plot", TranslatableCaption.of("generic.generic_merged").getComponent(player)) | ||||
|             ); | ||||
|         } else if (!plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_BACKUP_OTHER)) { | ||||
|         } else if (!plot.isOwner(player.getUUID()) && !Permissions | ||||
|                 .hasPermission(player, Permission.PERMISSION_ADMIN_BACKUP_OTHER)) { | ||||
|             player.sendMessage( | ||||
|                     TranslatableCaption.of("permission.no_permission"), | ||||
|                     Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BACKUP_OTHER)) | ||||
| @@ -196,7 +198,8 @@ public final class Backup extends Command { | ||||
|             ); | ||||
|         } else if (plot.getVolume() > Integer.MAX_VALUE) { | ||||
|             player.sendMessage(TranslatableCaption.of("schematics.schematic_too_large")); | ||||
|         } else if (!plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_BACKUP_OTHER)) { | ||||
|         } else if (!plot.isOwner(player.getUUID()) && !Permissions | ||||
|                 .hasPermission(player, Permission.PERMISSION_ADMIN_BACKUP_OTHER)) { | ||||
|             player.sendMessage( | ||||
|                     TranslatableCaption.of("permission.no_permission"), | ||||
|                     Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BACKUP_OTHER)) | ||||
| @@ -266,7 +269,8 @@ public final class Backup extends Command { | ||||
|             ); | ||||
|         } else if (plot.getVolume() > Integer.MAX_VALUE) { | ||||
|             player.sendMessage(TranslatableCaption.of("schematics.schematic_too_large")); | ||||
|         } else if (!plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_BACKUP_OTHER)) { | ||||
|         } else if (!plot.isOwner(player.getUUID()) && !Permissions | ||||
|                 .hasPermission(player, Permission.PERMISSION_ADMIN_BACKUP_OTHER)) { | ||||
|             player.sendMessage( | ||||
|                     TranslatableCaption.of("permission.no_permission"), | ||||
|                     Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BACKUP_OTHER)) | ||||
|   | ||||
| @@ -29,6 +29,7 @@ import com.plotsquared.core.plot.flag.implementations.HostileCapFlag; | ||||
| import com.plotsquared.core.plot.flag.implementations.MiscCapFlag; | ||||
| import com.plotsquared.core.plot.flag.implementations.MobCapFlag; | ||||
| import com.plotsquared.core.plot.flag.implementations.VehicleCapFlag; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import net.kyori.adventure.text.minimessage.Template; | ||||
|  | ||||
| import static com.plotsquared.core.util.entity.EntityCategories.CAP_ANIMAL; | ||||
| @@ -50,7 +51,8 @@ public class Caps extends SubCommand { | ||||
|             player.sendMessage(TranslatableCaption.of("errors.not_in_plot")); | ||||
|             return false; | ||||
|         } | ||||
|         if (!plot.isAdded(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_CAPS_OTHER)) { | ||||
|         if (!plot.isAdded(player.getUUID()) && !Permissions | ||||
|                 .hasPermission(player, Permission.PERMISSION_ADMIN_CAPS_OTHER)) { | ||||
|             player.sendMessage( | ||||
|                     TranslatableCaption.of("permission.no_permission"), | ||||
|                     Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_CAPS_OTHER)) | ||||
|   | ||||
| @@ -35,6 +35,7 @@ import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.plot.PlotArea; | ||||
| import com.plotsquared.core.util.EconHandler; | ||||
| import com.plotsquared.core.util.EventDispatcher; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.PlotExpression; | ||||
| import com.plotsquared.core.util.task.TaskManager; | ||||
| import net.kyori.adventure.text.minimessage.Template; | ||||
| @@ -126,8 +127,9 @@ public class Claim extends SubCommand { | ||||
|                                 Template.of("reason", "non-existent") | ||||
|                         ); | ||||
|                     } | ||||
|                     if (!player.hasPermission(Permission.PERMISSION_CLAIM_SCHEMATIC | ||||
|                             .format(schematic)) && !player.hasPermission( | ||||
|                     if (!Permissions.hasPermission(player, Permission.PERMISSION_CLAIM_SCHEMATIC | ||||
|                             .format(schematic)) && !Permissions.hasPermission( | ||||
|                             player, | ||||
|                             "plots.admin.command.schematic" | ||||
|                     ) && !force) { | ||||
|                         player.sendMessage( | ||||
| @@ -174,7 +176,7 @@ public class Claim extends SubCommand { | ||||
|                 ); | ||||
|             } | ||||
|         } | ||||
|         if (!player.hasPermission(Permission.PERMISSION_ADMIN_BYPASS_BORDER)) { | ||||
|         if (!Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) { | ||||
|             int border = area.getBorder(); | ||||
|             if (border != Integer.MAX_VALUE && plot.getDistanceFromOrigin() > border && !force) { | ||||
|                 player.sendMessage(TranslatableCaption.of("border.denied")); | ||||
|   | ||||
| @@ -32,6 +32,7 @@ import com.plotsquared.core.plot.flag.implementations.AnalysisFlag; | ||||
| import com.plotsquared.core.plot.flag.implementations.DoneFlag; | ||||
| import com.plotsquared.core.queue.GlobalBlockQueue; | ||||
| import com.plotsquared.core.util.EventDispatcher; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.task.RunnableVal2; | ||||
| import com.plotsquared.core.util.task.RunnableVal3; | ||||
| import com.plotsquared.core.util.task.TaskManager; | ||||
| @@ -88,14 +89,13 @@ public class Clear extends Command { | ||||
|         } | ||||
|         boolean force = eventResult == Result.FORCE; | ||||
|         checkTrue( | ||||
|                 force || plot.isOwner(player.getUUID()) || player.hasPermission("plots.admin.command.clear"), | ||||
|                 force || plot.isOwner(player.getUUID()) || Permissions | ||||
|                         .hasPermission(player, "plots.admin.command.clear"), | ||||
|                 TranslatableCaption.of("permission.no_plot_perms") | ||||
|         ); | ||||
|         checkTrue(plot.getRunning() == 0, TranslatableCaption.of("errors.wait_for_timer")); | ||||
|         checkTrue( | ||||
|                 force || !Settings.Done.RESTRICT_BUILDING || !DoneFlag.isDone(plot) || player.hasPermission("plots.continue"), | ||||
|                 TranslatableCaption.of("done.done_already_done") | ||||
|         ); | ||||
|         checkTrue(force || !Settings.Done.RESTRICT_BUILDING || !DoneFlag.isDone(plot) || Permissions | ||||
|                 .hasPermission(player, "plots.continue"), TranslatableCaption.of("done.done_already_done")); | ||||
|         confirm.run(this, () -> { | ||||
|             if (Settings.Teleport.ON_CLEAR) { | ||||
|                 plot.getPlayersInPlot().forEach(playerInPlot -> plot.teleportPlayer(playerInPlot, TeleportCause.COMMAND_CLEAR, | ||||
|   | ||||
| @@ -32,6 +32,7 @@ import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.plot.PlotArea; | ||||
| import com.plotsquared.core.plot.PlotCluster; | ||||
| import com.plotsquared.core.plot.PlotId; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.TabCompletions; | ||||
| import com.plotsquared.core.util.query.PlotQuery; | ||||
| import net.kyori.adventure.text.minimessage.Template; | ||||
| @@ -72,7 +73,7 @@ public class Cluster extends SubCommand { | ||||
|         switch (sub) { | ||||
|             case "l": | ||||
|             case "list": { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_CLUSTER_LIST)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_LIST)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_LIST)) | ||||
| @@ -125,7 +126,7 @@ public class Cluster extends SubCommand { | ||||
|             } | ||||
|             case "c": | ||||
|             case "create": { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_CLUSTER_CREATE)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_CREATE)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_CREATE)) | ||||
| @@ -196,7 +197,8 @@ public class Cluster extends SubCommand { | ||||
|                 } | ||||
|                 Set<Plot> plots = area.getPlotSelectionOwned(pos1, pos2); | ||||
|                 if (!plots.isEmpty()) { | ||||
|                     if (!player.hasPermission(Permission.PERMISSION_CLUSTER_CREATE_OTHER)) { | ||||
|                     if (!Permissions | ||||
|                             .hasPermission(player, Permission.PERMISSION_CLUSTER_CREATE_OTHER)) { | ||||
|                         UUID uuid = player.getUUID(); | ||||
|                         for (Plot plot : plots) { | ||||
|                             if (!plot.isOwner(uuid)) { | ||||
| @@ -217,10 +219,10 @@ public class Cluster extends SubCommand { | ||||
|                 } else { | ||||
|                     current = player.getPlayerClusterCount(player.getLocation().getWorldName()); | ||||
|                 } | ||||
|                 int allowed = player.hasPermissionRange( | ||||
|                         Permission.PERMISSION_CLUSTER_SIZE, | ||||
|                         Settings.Limit.MAX_PLOTS | ||||
|                 ); | ||||
|                 int allowed = Permissions | ||||
|                         .hasPermissionRange(player, Permission.PERMISSION_CLUSTER_SIZE, | ||||
|                                 Settings.Limit.MAX_PLOTS | ||||
|                         ); | ||||
|                 if (current + cluster.getArea() > allowed) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
| @@ -250,7 +252,7 @@ public class Cluster extends SubCommand { | ||||
|             case "disband": | ||||
|             case "del": | ||||
|             case "delete": { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_CLUSTER_DELETE)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_DELETE)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_DELETE)) | ||||
| @@ -287,7 +289,8 @@ public class Cluster extends SubCommand { | ||||
|                     } | ||||
|                 } | ||||
|                 if (!cluster.owner.equals(player.getUUID())) { | ||||
|                     if (!player.hasPermission(Permission.PERMISSION_CLUSTER_DELETE_OTHER)) { | ||||
|                     if (!Permissions | ||||
|                             .hasPermission(player, Permission.PERMISSION_CLUSTER_DELETE_OTHER)) { | ||||
|                         player.sendMessage( | ||||
|                                 TranslatableCaption.of("permission.no_permission"), | ||||
|                                 Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_DELETE_OTHER)) | ||||
| @@ -304,7 +307,7 @@ public class Cluster extends SubCommand { | ||||
|             } | ||||
|             case "res": | ||||
|             case "resize": { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_CLUSTER_RESIZE)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_RESIZE)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_RESIZE)) | ||||
| @@ -344,7 +347,8 @@ public class Cluster extends SubCommand { | ||||
|                     return false; | ||||
|                 } | ||||
|                 if (!cluster.hasHelperRights(player.getUUID())) { | ||||
|                     if (!player.hasPermission(Permission.PERMISSION_CLUSTER_RESIZE_OTHER)) { | ||||
|                     if (!Permissions | ||||
|                             .hasPermission(player, Permission.PERMISSION_CLUSTER_RESIZE_OTHER)) { | ||||
|                         player.sendMessage( | ||||
|                                 TranslatableCaption.of("permission.no_permission"), | ||||
|                                 Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_RESIZE_OTHER)) | ||||
| @@ -369,7 +373,8 @@ public class Cluster extends SubCommand { | ||||
|                 removed.removeAll(newPlots); | ||||
|                 // Check expand / shrink | ||||
|                 if (!removed.isEmpty()) { | ||||
|                     if (!player.hasPermission(Permission.PERMISSION_CLUSTER_RESIZE_SHRINK)) { | ||||
|                     if (!Permissions | ||||
|                             .hasPermission(player, Permission.PERMISSION_CLUSTER_RESIZE_SHRINK)) { | ||||
|                         player.sendMessage( | ||||
|                                 TranslatableCaption.of("permission.no_permission"), | ||||
|                                 Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_RESIZE_SHRINK)) | ||||
| @@ -379,7 +384,8 @@ public class Cluster extends SubCommand { | ||||
|                 } | ||||
|                 newPlots.removeAll(existing); | ||||
|                 if (!newPlots.isEmpty()) { | ||||
|                     if (!player.hasPermission(Permission.PERMISSION_CLUSTER_RESIZE_EXPAND)) { | ||||
|                     if (!Permissions | ||||
|                             .hasPermission(player, Permission.PERMISSION_CLUSTER_RESIZE_EXPAND)) { | ||||
|                         player.sendMessage( | ||||
|                                 TranslatableCaption.of("permission.no_permission"), | ||||
|                                 Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_RESIZE_EXPAND)) | ||||
| @@ -395,8 +401,7 @@ public class Cluster extends SubCommand { | ||||
|                     current = player.getPlayerClusterCount(player.getLocation().getWorldName()); | ||||
|                 } | ||||
|                 current -= cluster.getArea() + (1 + pos2.getX() - pos1.getX()) * (1 + pos2.getY() - pos1.getY()); | ||||
|                 int allowed = player.hasPermissionRange( | ||||
|                         Permission.PERMISSION_CLUSTER, | ||||
|                 int allowed = Permissions.hasPermissionRange(player, Permission.PERMISSION_CLUSTER, | ||||
|                         Settings.Limit.MAX_PLOTS | ||||
|                 ); | ||||
|                 if (current + cluster.getArea() > allowed) { | ||||
| @@ -414,7 +419,7 @@ public class Cluster extends SubCommand { | ||||
|             case "add": | ||||
|             case "inv": | ||||
|             case "invite": { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_CLUSTER_INVITE)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_INVITE)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_INVITE)) | ||||
| @@ -439,7 +444,8 @@ public class Cluster extends SubCommand { | ||||
|                     return false; | ||||
|                 } | ||||
|                 if (!cluster.hasHelperRights(player.getUUID())) { | ||||
|                     if (!player.hasPermission(Permission.PERMISSION_CLUSTER_INVITE_OTHER)) { | ||||
|                     if (!Permissions | ||||
|                             .hasPermission(player, Permission.PERMISSION_CLUSTER_INVITE_OTHER)) { | ||||
|                         player.sendMessage( | ||||
|                                 TranslatableCaption.of("permission.no_permission"), | ||||
|                                 Template.of("node", Permission.PERMISSION_CLUSTER_INVITE_OTHER.toString()) | ||||
| @@ -479,7 +485,7 @@ public class Cluster extends SubCommand { | ||||
|             case "k": | ||||
|             case "remove": | ||||
|             case "kick": { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_CLUSTER_KICK)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_KICK)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Template.of("node", Permission.PERMISSION_CLUSTER_KICK.toString()) | ||||
| @@ -503,7 +509,8 @@ public class Cluster extends SubCommand { | ||||
|                     return false; | ||||
|                 } | ||||
|                 if (!cluster.hasHelperRights(player.getUUID())) { | ||||
|                     if (!player.hasPermission(Permission.PERMISSION_CLUSTER_KICK_OTHER)) { | ||||
|                     if (!Permissions | ||||
|                             .hasPermission(player, Permission.PERMISSION_CLUSTER_KICK_OTHER)) { | ||||
|                         player.sendMessage( | ||||
|                                 TranslatableCaption.of("permission.no_permission"), | ||||
|                                 Template.of("node", Permission.PERMISSION_CLUSTER_KICK_OTHER.toString()) | ||||
| @@ -554,7 +561,7 @@ public class Cluster extends SubCommand { | ||||
|             } | ||||
|             case "quit": | ||||
|             case "leave": { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_CLUSTER_LEAVE)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_LEAVE)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Template.of("node", Permission.PERMISSION_CLUSTER_LEAVE.toString()) | ||||
| @@ -612,7 +619,7 @@ public class Cluster extends SubCommand { | ||||
|                 return true; | ||||
|             } | ||||
|             case "members": { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_CLUSTER_HELPERS)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_HELPERS)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Template.of("node", Permission.PERMISSION_CLUSTER_HELPERS.toString()) | ||||
| @@ -667,7 +674,7 @@ public class Cluster extends SubCommand { | ||||
|             case "spawn": | ||||
|             case "home": | ||||
|             case "tp": { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_CLUSTER_TP)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_TP)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Template.of("node", Permission.PERMISSION_CLUSTER_TP.toString()) | ||||
| @@ -696,7 +703,7 @@ public class Cluster extends SubCommand { | ||||
|                 } | ||||
|                 UUID uuid = player.getUUID(); | ||||
|                 if (!cluster.isAdded(uuid)) { | ||||
|                     if (!player.hasPermission(Permission.PERMISSION_CLUSTER_TP_OTHER)) { | ||||
|                     if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_TP_OTHER)) { | ||||
|                         player.sendMessage( | ||||
|                                 TranslatableCaption.of("permission.no_permission"), | ||||
|                                 Template.of("node", Permission.PERMISSION_CLUSTER_TP_OTHER.toString()) | ||||
| @@ -712,7 +719,7 @@ public class Cluster extends SubCommand { | ||||
|             case "info": | ||||
|             case "show": | ||||
|             case "information": { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_CLUSTER_INFO)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_INFO)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Template.of("node", Permission.PERMISSION_CLUSTER_TP.toString()) | ||||
| @@ -785,7 +792,7 @@ public class Cluster extends SubCommand { | ||||
|             case "sh": | ||||
|             case "setspawn": | ||||
|             case "sethome": { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_CLUSTER_SETHOME)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_SETHOME)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Template.of("node", Permission.PERMISSION_CLUSTER_SETHOME.toString()) | ||||
| @@ -809,7 +816,8 @@ public class Cluster extends SubCommand { | ||||
|                     return false; | ||||
|                 } | ||||
|                 if (!cluster.hasHelperRights(player.getUUID())) { | ||||
|                     if (!player.hasPermission(Permission.PERMISSION_CLUSTER_SETHOME_OTHER)) { | ||||
|                     if (!Permissions | ||||
|                             .hasPermission(player, Permission.PERMISSION_CLUSTER_SETHOME_OTHER)) { | ||||
|                         player.sendMessage( | ||||
|                                 TranslatableCaption.of("permission.no_permission"), | ||||
|                                 Template.of("node", Permission.PERMISSION_CLUSTER_SETHOME_OTHER.toString()) | ||||
| @@ -861,37 +869,37 @@ public class Cluster extends SubCommand { | ||||
|     public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) { | ||||
|         if (args.length == 1) { | ||||
|             final List<String> completions = new LinkedList<>(); | ||||
|             if (player.hasPermission(Permission.PERMISSION_CLUSTER_LIST)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_LIST)) { | ||||
|                 completions.add("list"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_CLUSTER_CREATE)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_CREATE)) { | ||||
|                 completions.add("create"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_CLUSTER_DELETE)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_DELETE)) { | ||||
|                 completions.add("delete"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_CLUSTER_RESIZE)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_RESIZE)) { | ||||
|                 completions.add("resize"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_CLUSTER_INVITE)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_INVITE)) { | ||||
|                 completions.add("invite"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_CLUSTER_KICK)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_KICK)) { | ||||
|                 completions.add("kick"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_CLUSTER_KICK)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_KICK)) { | ||||
|                 completions.add("leave"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_CLUSTER_HELPERS)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_HELPERS)) { | ||||
|                 completions.add("members"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_CLUSTER_INFO)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_INFO)) { | ||||
|                 completions.add("info"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_CLUSTER_TP)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_TP)) { | ||||
|                 completions.add("tp"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_CLUSTER_SETHOME)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_SETHOME)) { | ||||
|                 completions.add("sethome"); | ||||
|             } | ||||
|             final List<Command> commands = completions.stream().filter(completion -> completion | ||||
| @@ -906,7 +914,7 @@ public class Cluster extends SubCommand { | ||||
|                             CommandCategory.ADMINISTRATION | ||||
|                     ) { | ||||
|                     }).collect(Collectors.toCollection(LinkedList::new)); | ||||
|             if (player.hasPermission(Permission.PERMISSION_CLUSTER) && args[0].length() > 0) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER) && args[0].length() > 0) { | ||||
|                 commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList())); | ||||
|             } | ||||
|             return commands; | ||||
|   | ||||
| @@ -25,6 +25,7 @@ import com.plotsquared.core.configuration.caption.TranslatableCaption; | ||||
| import com.plotsquared.core.permissions.PermissionHolder; | ||||
| import com.plotsquared.core.player.PlotPlayer; | ||||
| import com.plotsquared.core.util.MathMan; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.StringComparison; | ||||
| import com.plotsquared.core.util.StringMan; | ||||
| import com.plotsquared.core.util.task.RunnableVal2; | ||||
| @@ -465,7 +466,7 @@ public abstract class Command { | ||||
|             if (message) { | ||||
|                 player.sendMessage(this.required.getErrorMessage()); | ||||
|             } | ||||
|         } else if (!player.hasPermission(getPermission())) { | ||||
|         } else if (!Permissions.hasPermission(player, getPermission())) { | ||||
|             if (message) { | ||||
|                 player.sendMessage( | ||||
|                         TranslatableCaption.of("permission.no_permission"), | ||||
|   | ||||
| @@ -29,6 +29,7 @@ import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.plot.flag.PlotFlag; | ||||
| import com.plotsquared.core.plot.flag.implementations.DoneFlag; | ||||
| import com.plotsquared.core.util.EventDispatcher; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import net.kyori.adventure.text.minimessage.Template; | ||||
| import org.checkerframework.checker.nullness.qual.NonNull; | ||||
|  | ||||
| @@ -52,7 +53,8 @@ public class Continue extends SubCommand { | ||||
|             player.sendMessage(TranslatableCaption.of("errors.not_in_plot")); | ||||
|             return false; | ||||
|         } | ||||
|         if (!plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_CONTINUE)) { | ||||
|         if (!plot.isOwner(player.getUUID()) && !Permissions | ||||
|                 .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_CONTINUE)) { | ||||
|             player.sendMessage( | ||||
|                     TranslatableCaption.of("permission.no_permission"), | ||||
|                     Template.of("node", TranslatableCaption.of("permission.no_plot_perms").getComponent(player)) | ||||
|   | ||||
| @@ -23,6 +23,7 @@ import com.plotsquared.core.location.Location; | ||||
| import com.plotsquared.core.permissions.Permission; | ||||
| import com.plotsquared.core.player.PlotPlayer; | ||||
| import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import net.kyori.adventure.text.minimessage.Template; | ||||
|  | ||||
| @CommandDeclaration(command = "copy", | ||||
| @@ -41,7 +42,8 @@ public class Copy extends SubCommand { | ||||
|             player.sendMessage(TranslatableCaption.of("errors.not_in_plot")); | ||||
|             return false; | ||||
|         } | ||||
|         if (!plot1.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN.toString())) { | ||||
|         if (!plot1.isOwner(player.getUUID()) && !Permissions | ||||
|                 .hasPermission(player, Permission.PERMISSION_ADMIN.toString())) { | ||||
|             player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); | ||||
|             return false; | ||||
|         } | ||||
|   | ||||
| @@ -28,6 +28,7 @@ import com.plotsquared.core.generator.HybridUtils; | ||||
| import com.plotsquared.core.player.PlotPlayer; | ||||
| import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.plot.PlotArea; | ||||
| import com.plotsquared.core.plot.expiration.ExpireManager; | ||||
| import com.plotsquared.core.plot.expiration.PlotAnalysis; | ||||
| import com.plotsquared.core.plot.flag.GlobalFlagContainer; | ||||
| import com.plotsquared.core.plot.flag.PlotFlag; | ||||
| @@ -41,6 +42,7 @@ import org.checkerframework.checker.nullness.qual.NonNull; | ||||
|  | ||||
| import java.util.Arrays; | ||||
| import java.util.Collection; | ||||
| import java.util.HashSet; | ||||
| import java.util.LinkedHashSet; | ||||
| import java.util.List; | ||||
| import java.util.Locale; | ||||
|   | ||||
| @@ -30,6 +30,7 @@ import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.plot.PlotArea; | ||||
| import com.plotsquared.core.util.EconHandler; | ||||
| import com.plotsquared.core.util.EventDispatcher; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.PlotExpression; | ||||
| import com.plotsquared.core.util.task.TaskManager; | ||||
| import net.kyori.adventure.text.minimessage.Template; | ||||
| @@ -82,7 +83,8 @@ public class Delete extends SubCommand { | ||||
|             return true; | ||||
|         } | ||||
|         boolean force = eventResult == Result.FORCE; | ||||
|         if (!force && !plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_DELETE)) { | ||||
|         if (!force && !plot.isOwner(player.getUUID()) && !Permissions | ||||
|                 .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_DELETE)) { | ||||
|             player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); | ||||
|             return false; | ||||
|         } | ||||
|   | ||||
| @@ -30,6 +30,7 @@ import com.plotsquared.core.player.PlotPlayer; | ||||
| import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.plot.world.PlotAreaManager; | ||||
| import com.plotsquared.core.util.EventDispatcher; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.PlayerManager; | ||||
| import com.plotsquared.core.util.TabCompletions; | ||||
| import com.plotsquared.core.util.WorldUtil; | ||||
| @@ -78,12 +79,13 @@ public class Deny extends SubCommand { | ||||
|             player.sendMessage(TranslatableCaption.of("info.plot_unowned")); | ||||
|             return false; | ||||
|         } | ||||
|         if (!plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_DENY)) { | ||||
|         if (!plot.isOwner(player.getUUID()) && !Permissions | ||||
|                 .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_DENY)) { | ||||
|             player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); | ||||
|             return true; | ||||
|         } | ||||
|  | ||||
|         int maxDenySize = player.hasPermissionRange(Permission.PERMISSION_DENY, Settings.Limit.MAX_PLOTS); | ||||
|         int maxDenySize = Permissions.hasPermissionRange(player, Permission.PERMISSION_DENY, Settings.Limit.MAX_PLOTS); | ||||
|         int size = plot.getDenied().size(); | ||||
|         if (size >= maxDenySize) { | ||||
|             player.sendMessage( | ||||
| @@ -104,7 +106,8 @@ public class Deny extends SubCommand { | ||||
|             } else { | ||||
|                 for (UUID uuid : uuids) { | ||||
|                     if (uuid == DBFunc.EVERYONE && !( | ||||
|                             player.hasPermission(Permission.PERMISSION_DENY_EVERYONE) || player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_DENY))) { | ||||
|                             Permissions.hasPermission(player, Permission.PERMISSION_DENY_EVERYONE) || Permissions | ||||
|                                     .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_DENY))) { | ||||
|                         player.sendMessage( | ||||
|                                 TranslatableCaption.of("errors.invalid_player"), | ||||
|                                 Template.of("value", args[0]) | ||||
|   | ||||
| @@ -21,6 +21,7 @@ package com.plotsquared.core.command; | ||||
| import com.google.inject.Inject; | ||||
| import com.plotsquared.core.permissions.Permission; | ||||
| import com.plotsquared.core.player.PlotPlayer; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.TabCompletions; | ||||
| import org.checkerframework.checker.nullness.qual.NonNull; | ||||
|  | ||||
| @@ -53,7 +54,7 @@ public class Dislike extends SubCommand { | ||||
|     public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) { | ||||
|         if (args.length == 1) { | ||||
|             final List<String> completions = new LinkedList<>(); | ||||
|             if (player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_PURGE_RATINGS)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_PURGE_RATINGS)) { | ||||
|                 completions.add("purge"); | ||||
|             } | ||||
|             final List<Command> commands = completions.stream().filter(completion -> completion | ||||
| @@ -61,7 +62,7 @@ public class Dislike extends SubCommand { | ||||
|                             .startsWith(args[0].toLowerCase())) | ||||
|                     .map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.INFO) { | ||||
|                     }).collect(Collectors.toCollection(LinkedList::new)); | ||||
|             if (player.hasPermission(Permission.PERMISSION_RATE) && args[0].length() > 0) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_RATE) && args[0].length() > 0) { | ||||
|                 commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList())); | ||||
|             } | ||||
|             return commands; | ||||
|   | ||||
| @@ -34,6 +34,7 @@ import com.plotsquared.core.plot.expiration.PlotAnalysis; | ||||
| import com.plotsquared.core.plot.flag.PlotFlag; | ||||
| import com.plotsquared.core.plot.flag.implementations.DoneFlag; | ||||
| import com.plotsquared.core.util.EventDispatcher; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.task.RunnableVal; | ||||
| import net.kyori.adventure.text.minimessage.Template; | ||||
| import org.checkerframework.checker.nullness.qual.NonNull; | ||||
| @@ -74,7 +75,8 @@ public class Done extends SubCommand { | ||||
|             return true; | ||||
|         } | ||||
|         boolean force = event.getEventResult() == Result.FORCE; | ||||
|         if (!force && !plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_DONE)) { | ||||
|         if (!force && !plot.isOwner(player.getUUID()) && !Permissions | ||||
|                 .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_DONE)) { | ||||
|             player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); | ||||
|             return false; | ||||
|         } | ||||
|   | ||||
| @@ -27,6 +27,7 @@ import com.plotsquared.core.player.PlotPlayer; | ||||
| import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.plot.flag.implementations.DoneFlag; | ||||
| import com.plotsquared.core.plot.world.PlotAreaManager; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.PlotUploader; | ||||
| import com.plotsquared.core.util.SchematicHandler; | ||||
| import com.plotsquared.core.util.StringMan; | ||||
| @@ -86,11 +87,13 @@ public class Download extends SubCommand { | ||||
|             player.sendMessage(TranslatableCaption.of("info.plot_unowned")); | ||||
|             return false; | ||||
|         } | ||||
|         if ((Settings.Done.REQUIRED_FOR_DOWNLOAD && !DoneFlag.isDone(plot)) && !player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_DOWNLOAD)) { | ||||
|         if ((Settings.Done.REQUIRED_FOR_DOWNLOAD && !DoneFlag.isDone(plot)) && !Permissions | ||||
|                 .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_DOWNLOAD)) { | ||||
|             player.sendMessage(TranslatableCaption.of("done.done_not_done")); | ||||
|             return false; | ||||
|         } | ||||
|         if (!plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN.toString())) { | ||||
|         if (!plot.isOwner(player.getUUID()) && !Permissions | ||||
|                 .hasPermission(player, Permission.PERMISSION_ADMIN.toString())) { | ||||
|             player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); | ||||
|             return false; | ||||
|         } | ||||
| @@ -108,7 +111,7 @@ public class Download extends SubCommand { | ||||
|             upload(player, plot); | ||||
|         } else if (args.length == 1 && StringMan | ||||
|                 .isEqualIgnoreCaseToAny(args[0], "mcr", "world", "mca")) { | ||||
|             if (!player.hasPermission(Permission.PERMISSION_DOWNLOAD_WORLD)) { | ||||
|             if (!Permissions.hasPermission(player, Permission.PERMISSION_DOWNLOAD_WORLD)) { | ||||
|                 player.sendMessage( | ||||
|                         TranslatableCaption.of("permission.no_permission"), | ||||
|                         Template.of("node", Permission.PERMISSION_DOWNLOAD_WORLD.toString()) | ||||
| @@ -144,10 +147,10 @@ public class Download extends SubCommand { | ||||
|     public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) { | ||||
|         if (args.length == 1) { | ||||
|             final List<String> completions = new LinkedList<>(); | ||||
|             if (player.hasPermission(Permission.PERMISSION_DOWNLOAD)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_DOWNLOAD)) { | ||||
|                 completions.add("schem"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_DOWNLOAD_WORLD)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_DOWNLOAD_WORLD)) { | ||||
|                 completions.add("world"); | ||||
|             } | ||||
|             final List<Command> commands = completions.stream().filter(completion -> completion | ||||
| @@ -162,7 +165,7 @@ public class Download extends SubCommand { | ||||
|                             CommandCategory.ADMINISTRATION | ||||
|                     ) { | ||||
|                     }).collect(Collectors.toCollection(LinkedList::new)); | ||||
|             if (player.hasPermission(Permission.PERMISSION_DOWNLOAD) && args[0].length() > 0) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_DOWNLOAD) && args[0].length() > 0) { | ||||
|                 commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList())); | ||||
|             } | ||||
|             return commands; | ||||
|   | ||||
| @@ -40,6 +40,7 @@ import com.plotsquared.core.plot.flag.types.IntegerFlag; | ||||
| import com.plotsquared.core.plot.flag.types.ListFlag; | ||||
| import com.plotsquared.core.util.EventDispatcher; | ||||
| import com.plotsquared.core.util.MathMan; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.StringComparison; | ||||
| import com.plotsquared.core.util.StringMan; | ||||
| import com.plotsquared.core.util.helpmenu.HelpMenu; | ||||
| @@ -127,7 +128,7 @@ public final class FlagCommand extends Command { | ||||
|                             key.toLowerCase(), | ||||
|                             entry.toString().toLowerCase() | ||||
|                     ); | ||||
|                     final boolean result = player.hasPermission(permission); | ||||
|                     final boolean result = Permissions.hasPermission(player, permission); | ||||
|                     if (!result) { | ||||
|                         player.sendMessage(TranslatableCaption.of("permission.no_permission"), Template.of("node", permission)); | ||||
|                         return false; | ||||
| @@ -149,9 +150,9 @@ public final class FlagCommand extends Command { | ||||
|         boolean result; | ||||
|         String basePerm = Permission.PERMISSION_SET_FLAG_KEY.format(key.toLowerCase()); | ||||
|         if (flag.isValuedPermission()) { | ||||
|             result = player.hasKeyedPermission(basePerm, value); | ||||
|             result = Permissions.hasKeyedPermission(player, basePerm, value); | ||||
|         } else { | ||||
|             result = player.hasPermission(basePerm); | ||||
|             result = Permissions.hasPermission(player, basePerm); | ||||
|             perm = basePerm; | ||||
|         } | ||||
|         if (!result) { | ||||
| @@ -176,7 +177,8 @@ public final class FlagCommand extends Command { | ||||
|             player.sendMessage(TranslatableCaption.of("working.plot_not_claimed")); | ||||
|             return false; | ||||
|         } | ||||
|         if (!plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_SET_FLAG_OTHER)) { | ||||
|         if (!plot.isOwner(player.getUUID()) && !Permissions | ||||
|                 .hasPermission(player, Permission.PERMISSION_SET_FLAG_OTHER)) { | ||||
|             player.sendMessage( | ||||
|                     TranslatableCaption.of("permission.no_permission"), | ||||
|                     Template.of("node", String.valueOf(Permission.PERMISSION_SET_FLAG_OTHER)) | ||||
| @@ -471,7 +473,7 @@ public final class FlagCommand extends Command { | ||||
|         } | ||||
|         boolean force = event.getEventResult() == Result.FORCE; | ||||
|         flag = event.getFlag(); | ||||
|         if (!force && !player.hasPermission(Permission.PERMISSION_SET_FLAG_KEY.format(args[0].toLowerCase()))) { | ||||
|         if (!force && !Permissions.hasPermission(player, Permission.PERMISSION_SET_FLAG_KEY.format(args[0].toLowerCase()))) { | ||||
|             if (args.length != 2) { | ||||
|                 player.sendMessage( | ||||
|                         TranslatableCaption.of("permission.no_permission"), | ||||
|   | ||||
| @@ -26,6 +26,7 @@ import com.plotsquared.core.permissions.Permission; | ||||
| import com.plotsquared.core.player.MetaDataAccess; | ||||
| import com.plotsquared.core.player.PlayerMetaDataKeys; | ||||
| import com.plotsquared.core.player.PlotPlayer; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.PlayerManager; | ||||
| import com.plotsquared.core.util.TabCompletions; | ||||
| import com.plotsquared.core.util.task.RunnableVal; | ||||
| @@ -68,7 +69,7 @@ public class Grant extends Command { | ||||
|         final String arg0 = args[0].toLowerCase(); | ||||
|         switch (arg0) { | ||||
|             case "add", "check" -> { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_GRANT.format(arg0))) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_GRANT.format(arg0))) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Template.of("node", Permission.PERMISSION_GRANT.format(arg0)) | ||||
| @@ -149,10 +150,10 @@ public class Grant extends Command { | ||||
|     public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) { | ||||
|         if (args.length == 1) { | ||||
|             final List<String> completions = new LinkedList<>(); | ||||
|             if (player.hasPermission(Permission.PERMISSION_GRANT_ADD)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_GRANT_ADD)) { | ||||
|                 completions.add("add"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_GRANT_CHECK)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_GRANT_CHECK)) { | ||||
|                 completions.add("check"); | ||||
|             } | ||||
|             final List<Command> commands = completions.stream().filter(completion -> completion | ||||
| @@ -167,7 +168,7 @@ public class Grant extends Command { | ||||
|                             CommandCategory.ADMINISTRATION | ||||
|                     ) { | ||||
|                     }).collect(Collectors.toCollection(LinkedList::new)); | ||||
|             if (player.hasPermission(Permission.PERMISSION_GRANT_SINGLE) && args[0].length() > 0) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_GRANT_SINGLE) && args[0].length() > 0) { | ||||
|                 commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList())); | ||||
|             } | ||||
|             return commands; | ||||
|   | ||||
| @@ -29,6 +29,7 @@ import com.plotsquared.core.plot.PlotArea; | ||||
| import com.plotsquared.core.plot.PlotId; | ||||
| import com.plotsquared.core.plot.world.PlotAreaManager; | ||||
| import com.plotsquared.core.util.MathMan; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.TabCompletions; | ||||
| import com.plotsquared.core.util.query.PlotQuery; | ||||
| import com.plotsquared.core.util.query.SortingStrategy; | ||||
| @@ -103,7 +104,8 @@ public class HomeCommand extends Command { | ||||
|         // /plot home <[area;]x;y> | ||||
|         // /plot home <area> <x;y> | ||||
|         // /plot home <area> <page> | ||||
|         if (!player.hasPermission(Permission.PERMISSION_VISIT_OWNED) && !player.hasPermission(Permission.PERMISSION_HOME)) { | ||||
|         if (!Permissions.hasPermission(player, Permission.PERMISSION_VISIT_OWNED) && !Permissions | ||||
|                 .hasPermission(player, Permission.PERMISSION_HOME)) { | ||||
|             player.sendMessage( | ||||
|                     TranslatableCaption.of("permission.no_permission"), | ||||
|                     Template.of("node", Permission.PERMISSION_VISIT_OWNED.toString()) | ||||
|   | ||||
| @@ -30,6 +30,7 @@ import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.plot.comment.CommentInbox; | ||||
| import com.plotsquared.core.plot.comment.CommentManager; | ||||
| import com.plotsquared.core.plot.comment.PlotComment; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.StringMan; | ||||
| import com.plotsquared.core.util.TabCompletions; | ||||
| import com.plotsquared.core.util.task.RunnableVal; | ||||
| @@ -284,13 +285,13 @@ public class Inbox extends SubCommand { | ||||
|     public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) { | ||||
|         if (args.length == 1) { | ||||
|             final List<String> completions = new LinkedList<>(); | ||||
|             if (player.hasPermission(Permission.PERMISSION_INBOX_READ_OWNER)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_INBOX_READ_OWNER)) { | ||||
|                 completions.add("owner"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_INBOX_READ_PUBLIC)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_INBOX_READ_PUBLIC)) { | ||||
|                 completions.add("public"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_INBOX_READ_REPORT)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_INBOX_READ_REPORT)) { | ||||
|                 completions.add("report"); | ||||
|             } | ||||
|             final List<Command> commands = completions.stream().filter(completion -> completion | ||||
| @@ -298,7 +299,7 @@ public class Inbox extends SubCommand { | ||||
|                             .startsWith(args[0].toLowerCase())) | ||||
|                     .map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.CHAT) { | ||||
|                     }).collect(Collectors.toCollection(LinkedList::new)); | ||||
|             if (player.hasPermission(Permission.PERMISSION_INBOX) && args[0].length() > 0) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_INBOX) && args[0].length() > 0) { | ||||
|                 commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList())); | ||||
|             } | ||||
|             return commands; | ||||
|   | ||||
| @@ -27,6 +27,7 @@ import com.plotsquared.core.permissions.Permission; | ||||
| import com.plotsquared.core.player.PlotPlayer; | ||||
| import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.plot.flag.implementations.HideInfoFlag; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.TabCompletions; | ||||
| import net.kyori.adventure.text.minimessage.Template; | ||||
|  | ||||
| @@ -143,7 +144,7 @@ public class Info extends SubCommand { | ||||
|     @Override | ||||
|     public Collection<Command> tab(PlotPlayer<?> player, String[] args, boolean space) { | ||||
|         final List<String> completions = new LinkedList<>(); | ||||
|         if (player.hasPermission(Permission.PERMISSION_AREA_INFO_FORCE)) { | ||||
|         if (Permissions.hasPermission(player, Permission.PERMISSION_AREA_INFO_FORCE)) { | ||||
|             completions.add("-f"); | ||||
|         } | ||||
|  | ||||
| @@ -153,7 +154,7 @@ public class Info extends SubCommand { | ||||
|                 .map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.INFO) { | ||||
|                 }).collect(Collectors.toCollection(LinkedList::new)); | ||||
|  | ||||
|         if (player.hasPermission(Permission.PERMISSION_AREA_INFO_FORCE) && args[0].length() > 0) { | ||||
|         if (Permissions.hasPermission(player, Permission.PERMISSION_AREA_INFO_FORCE) && args[0].length() > 0) { | ||||
|             commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList())); | ||||
|         } | ||||
|  | ||||
|   | ||||
| @@ -27,6 +27,7 @@ import com.plotsquared.core.permissions.Permission; | ||||
| import com.plotsquared.core.player.PlotPlayer; | ||||
| import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.plot.world.PlotAreaManager; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.PlayerManager; | ||||
| import com.plotsquared.core.util.TabCompletions; | ||||
| import com.plotsquared.core.util.WorldUtil; | ||||
| @@ -69,7 +70,8 @@ public class Kick extends SubCommand { | ||||
|             player.sendMessage(TranslatableCaption.of("errors.not_in_plot")); | ||||
|             return false; | ||||
|         } | ||||
|         if ((!plot.hasOwner() || !plot.isOwner(player.getUUID())) && !player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_KICK)) { | ||||
|         if ((!plot.hasOwner() || !plot.isOwner(player.getUUID())) && !Permissions | ||||
|                 .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_KICK)) { | ||||
|             player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); | ||||
|             return false; | ||||
|         } | ||||
| @@ -87,7 +89,8 @@ public class Kick extends SubCommand { | ||||
|                 for (UUID uuid : uuids) { | ||||
|                     if (uuid == DBFunc.EVERYONE) { | ||||
|                         for (PlotPlayer<?> pp : plot.getPlayersInPlot()) { | ||||
|                             if (pp == player || pp.hasPermission(Permission.PERMISSION_ADMIN_ENTRY_DENIED)) { | ||||
|                             if (pp == player || Permissions | ||||
|                                     .hasPermission(pp, Permission.PERMISSION_ADMIN_ENTRY_DENIED)) { | ||||
|                                 continue; | ||||
|                             } | ||||
|                             players.add(pp); | ||||
| @@ -115,7 +118,7 @@ public class Kick extends SubCommand { | ||||
|                         ); | ||||
|                         return; | ||||
|                     } | ||||
|                     if (player2.hasPermission(Permission.PERMISSION_ADMIN_ENTRY_DENIED)) { | ||||
|                     if (Permissions.hasPermission(player2, Permission.PERMISSION_ADMIN_ENTRY_DENIED)) { | ||||
|                         player.sendMessage( | ||||
|                                 TranslatableCaption.of("cluster.cannot_kick_player"), | ||||
|                                 Template.of("name", player2.getName()) | ||||
|   | ||||
| @@ -30,6 +30,7 @@ import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.plot.Rating; | ||||
| import com.plotsquared.core.plot.flag.implementations.DoneFlag; | ||||
| import com.plotsquared.core.util.EventDispatcher; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.TabCompletions; | ||||
| import com.plotsquared.core.util.query.PlotQuery; | ||||
| import com.plotsquared.core.util.task.TaskManager; | ||||
| @@ -120,7 +121,8 @@ public class Like extends SubCommand { | ||||
|                         player.sendMessage(TranslatableCaption.of("errors.not_in_plot")); | ||||
|                         return false; | ||||
|                     } | ||||
|                     if (!player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_PURGE_RATINGS, true)) { | ||||
|                     if (!Permissions | ||||
|                             .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_PURGE_RATINGS, true)) { | ||||
|                         return false; | ||||
|                     } | ||||
|                     plot.clearRatings(); | ||||
| @@ -202,7 +204,7 @@ public class Like extends SubCommand { | ||||
|     public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) { | ||||
|         if (args.length == 1) { | ||||
|             final List<String> completions = new LinkedList<>(); | ||||
|             if (player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_PURGE_RATINGS)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_PURGE_RATINGS)) { | ||||
|                 completions.add("purge"); | ||||
|             } | ||||
|             final List<Command> commands = completions.stream().filter(completion -> completion | ||||
| @@ -210,7 +212,7 @@ public class Like extends SubCommand { | ||||
|                             .startsWith(args[0].toLowerCase())) | ||||
|                     .map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.INFO) { | ||||
|                     }).collect(Collectors.toCollection(LinkedList::new)); | ||||
|             if (player.hasPermission(Permission.PERMISSION_RATE) && args[0].length() > 0) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_RATE) && args[0].length() > 0) { | ||||
|                 commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList())); | ||||
|             } | ||||
|             return commands; | ||||
|   | ||||
| @@ -36,6 +36,7 @@ import com.plotsquared.core.plot.flag.implementations.ServerPlotFlag; | ||||
| import com.plotsquared.core.plot.world.PlotAreaManager; | ||||
| import com.plotsquared.core.util.EconHandler; | ||||
| import com.plotsquared.core.util.MathMan; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.PlayerManager; | ||||
| import com.plotsquared.core.util.StringComparison; | ||||
| import com.plotsquared.core.util.StringMan; | ||||
| @@ -81,40 +82,40 @@ public class ListCmd extends SubCommand { | ||||
|  | ||||
|     private String[] getArgumentList(PlotPlayer<?> player) { | ||||
|         List<String> args = new ArrayList<>(); | ||||
|         if (this.econHandler != null && player.hasPermission(Permission.PERMISSION_LIST_FOR_SALE)) { | ||||
|         if (this.econHandler != null && Permissions.hasPermission(player, Permission.PERMISSION_LIST_FOR_SALE)) { | ||||
|             args.add("forsale"); | ||||
|         } | ||||
|         if (player.hasPermission(Permission.PERMISSION_LIST_MINE)) { | ||||
|         if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_MINE)) { | ||||
|             args.add("mine"); | ||||
|         } | ||||
|         if (player.hasPermission(Permission.PERMISSION_LIST_SHARED)) { | ||||
|         if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_SHARED)) { | ||||
|             args.add("shared"); | ||||
|         } | ||||
|         if (player.hasPermission(Permission.PERMISSION_LIST_WORLD)) { | ||||
|         if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_WORLD)) { | ||||
|             args.add("world"); | ||||
|         } | ||||
|         if (player.hasPermission(Permission.PERMISSION_LIST_TOP)) { | ||||
|         if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_TOP)) { | ||||
|             args.add("top"); | ||||
|         } | ||||
|         if (player.hasPermission(Permission.PERMISSION_LIST_ALL)) { | ||||
|         if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_ALL)) { | ||||
|             args.add("all"); | ||||
|         } | ||||
|         if (player.hasPermission(Permission.PERMISSION_LIST_UNOWNED)) { | ||||
|         if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_UNOWNED)) { | ||||
|             args.add("unowned"); | ||||
|         } | ||||
|         if (player.hasPermission(Permission.PERMISSION_LIST_PLAYER)) { | ||||
|         if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_PLAYER)) { | ||||
|             args.add("<player>"); | ||||
|         } | ||||
|         if (player.hasPermission(Permission.PERMISSION_LIST_WORLD)) { | ||||
|         if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_WORLD)) { | ||||
|             args.add("<world>"); | ||||
|         } | ||||
|         if (player.hasPermission(Permission.PERMISSION_LIST_DONE)) { | ||||
|         if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_DONE)) { | ||||
|             args.add("done"); | ||||
|         } | ||||
|         if (player.hasPermission(Permission.PERMISSION_LIST_EXPIRED)) { | ||||
|         if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_EXPIRED)) { | ||||
|             args.add("expired"); | ||||
|         } | ||||
|         if (player.hasPermission(Permission.PERMISSION_LIST_FUZZY)) { | ||||
|         if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_FUZZY)) { | ||||
|             args.add("fuzzy <search...>"); | ||||
|         } | ||||
|         return args.toArray(new String[args.size()]); | ||||
| @@ -186,7 +187,7 @@ public class ListCmd extends SubCommand { | ||||
|  | ||||
|         switch (arg) { | ||||
|             case "mine" -> { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_LIST_MINE)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_MINE)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Templates.of("node", "plots.list.mine") | ||||
| @@ -201,7 +202,7 @@ public class ListCmd extends SubCommand { | ||||
|                         .withSortingStrategy(SortingStrategy.SORT_BY_TEMP)); | ||||
|             } | ||||
|             case "shared" -> { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_LIST_SHARED)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_SHARED)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Templates.of("node", "plots.list.shared") | ||||
| @@ -214,14 +215,14 @@ public class ListCmd extends SubCommand { | ||||
|                         .thatPasses(plot -> !plot.isOwnerAbs(player.getUUID()))); | ||||
|             } | ||||
|             case "world" -> { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_LIST_WORLD)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_WORLD)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Templates.of("node", "plots.list.world") | ||||
|                     ); | ||||
|                     return false; | ||||
|                 } | ||||
|                 if (!player.hasPermission("plots.list.world." + world)) { | ||||
|                 if (!Permissions.hasPermission(player, "plots.list.world." + world)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Templates.of("node", "plots.list.world." + world) | ||||
| @@ -231,7 +232,7 @@ public class ListCmd extends SubCommand { | ||||
|                 plotConsumer.accept(PlotQuery.newQuery().inWorld(world)); | ||||
|             } | ||||
|             case "expired" -> { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_LIST_EXPIRED)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_EXPIRED)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Templates.of("node", "plots.list.expired") | ||||
| @@ -245,14 +246,14 @@ public class ListCmd extends SubCommand { | ||||
|                 } | ||||
|             } | ||||
|             case "area" -> { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_LIST_AREA)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_AREA)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Templates.of("node", "plots.list.area") | ||||
|                     ); | ||||
|                     return false; | ||||
|                 } | ||||
|                 if (!player.hasPermission("plots.list.world." + world)) { | ||||
|                 if (!Permissions.hasPermission(player, "plots.list.world." + world)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Templates.of("node", "plots.list.world." + world) | ||||
| @@ -266,7 +267,7 @@ public class ListCmd extends SubCommand { | ||||
|                 } | ||||
|             } | ||||
|             case "all" -> { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_LIST_ALL)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_ALL)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Templates.of("node", "plots.list.all") | ||||
| @@ -276,7 +277,7 @@ public class ListCmd extends SubCommand { | ||||
|                 plotConsumer.accept(PlotQuery.newQuery().allPlots()); | ||||
|             } | ||||
|             case "done" -> { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_LIST_DONE)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_DONE)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Templates.of("node", "plots.list.done") | ||||
| @@ -291,7 +292,7 @@ public class ListCmd extends SubCommand { | ||||
|                         .withSortingStrategy(SortingStrategy.SORT_BY_DONE)); | ||||
|             } | ||||
|             case "top" -> { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_LIST_TOP)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_TOP)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Templates.of("node", "plots.list.top") | ||||
| @@ -302,7 +303,7 @@ public class ListCmd extends SubCommand { | ||||
|                 plotConsumer.accept(PlotQuery.newQuery().allPlots().withSortingStrategy(SortingStrategy.SORT_BY_RATING)); | ||||
|             } | ||||
|             case "forsale" -> { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_LIST_FOR_SALE)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_FOR_SALE)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Templates.of("node", "plots.list.forsale") | ||||
| @@ -315,7 +316,7 @@ public class ListCmd extends SubCommand { | ||||
|                 plotConsumer.accept(PlotQuery.newQuery().allPlots().thatPasses(plot -> plot.getFlag(PriceFlag.class) > 0)); | ||||
|             } | ||||
|             case "unowned" -> { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_LIST_UNOWNED)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_UNOWNED)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Templates.of("node", "plots.list.unowned") | ||||
| @@ -325,7 +326,7 @@ public class ListCmd extends SubCommand { | ||||
|                 plotConsumer.accept(PlotQuery.newQuery().allPlots().thatPasses(plot -> plot.getOwner() == null)); | ||||
|             } | ||||
|             case "fuzzy" -> { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_LIST_FUZZY)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_FUZZY)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Templates.of("node", "plots.list.fuzzy") | ||||
| @@ -350,14 +351,14 @@ public class ListCmd extends SubCommand { | ||||
|             } | ||||
|             default -> { | ||||
|                 if (this.plotAreaManager.hasPlotArea(args[0])) { | ||||
|                     if (!player.hasPermission(Permission.PERMISSION_LIST_WORLD)) { | ||||
|                     if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_WORLD)) { | ||||
|                         player.sendMessage( | ||||
|                                 TranslatableCaption.of("permission.no_permission"), | ||||
|                                 Templates.of("node", "plots.list.world") | ||||
|                         ); | ||||
|                         return false; | ||||
|                     } | ||||
|                     if (!player.hasPermission("plots.list.world." + args[0])) { | ||||
|                     if (!Permissions.hasPermission(player, "plots.list.world." + args[0])) { | ||||
|                         player.sendMessage( | ||||
|                                 TranslatableCaption.of("permission.no_permission"), | ||||
|                                 Templates.of("node", "plots.list.world." + args[0]) | ||||
| @@ -381,7 +382,7 @@ public class ListCmd extends SubCommand { | ||||
|                     if (uuid == null) { | ||||
|                         player.sendMessage(TranslatableCaption.of("errors.invalid_player"), Templates.of("value", args[0])); | ||||
|                     } else { | ||||
|                         if (!player.hasPermission(Permission.PERMISSION_LIST_PLAYER)) { | ||||
|                         if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_PLAYER)) { | ||||
|                             player.sendMessage( | ||||
|                                     TranslatableCaption.of("permission.no_permission"), | ||||
|                                     Templates.of("node", "plots.list.player") | ||||
| @@ -514,31 +515,31 @@ public class ListCmd extends SubCommand { | ||||
|     @Override | ||||
|     public Collection<Command> tab(PlotPlayer<?> player, String[] args, boolean space) { | ||||
|         final List<String> completions = new LinkedList<>(); | ||||
|         if (this.econHandler.isSupported() && player.hasPermission(Permission.PERMISSION_LIST_FOR_SALE)) { | ||||
|         if (this.econHandler.isSupported() && Permissions.hasPermission(player, Permission.PERMISSION_LIST_FOR_SALE)) { | ||||
|             completions.add("forsale"); | ||||
|         } | ||||
|         if (player.hasPermission(Permission.PERMISSION_LIST_MINE)) { | ||||
|         if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_MINE)) { | ||||
|             completions.add("mine"); | ||||
|         } | ||||
|         if (player.hasPermission(Permission.PERMISSION_LIST_SHARED)) { | ||||
|         if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_SHARED)) { | ||||
|             completions.add("shared"); | ||||
|         } | ||||
|         if (player.hasPermission(Permission.PERMISSION_LIST_WORLD)) { | ||||
|         if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_WORLD)) { | ||||
|             completions.addAll(PlotSquared.platform().worldManager().getWorlds()); | ||||
|         } | ||||
|         if (player.hasPermission(Permission.PERMISSION_LIST_TOP)) { | ||||
|         if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_TOP)) { | ||||
|             completions.add("top"); | ||||
|         } | ||||
|         if (player.hasPermission(Permission.PERMISSION_LIST_ALL)) { | ||||
|         if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_ALL)) { | ||||
|             completions.add("all"); | ||||
|         } | ||||
|         if (player.hasPermission(Permission.PERMISSION_LIST_UNOWNED)) { | ||||
|         if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_UNOWNED)) { | ||||
|             completions.add("unowned"); | ||||
|         } | ||||
|         if (player.hasPermission(Permission.PERMISSION_LIST_DONE)) { | ||||
|         if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_DONE)) { | ||||
|             completions.add("done"); | ||||
|         } | ||||
|         if (player.hasPermission(Permission.PERMISSION_LIST_EXPIRED)) { | ||||
|         if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_EXPIRED)) { | ||||
|             completions.add("expired"); | ||||
|         } | ||||
|  | ||||
| @@ -548,7 +549,7 @@ public class ListCmd extends SubCommand { | ||||
|                 .map(completion -> new Command(null, true, completion, "", RequiredType.NONE, CommandCategory.TELEPORT) { | ||||
|                 }).collect(Collectors.toCollection(LinkedList::new)); | ||||
|  | ||||
|         if (player.hasPermission(Permission.PERMISSION_LIST_PLAYER) && args[0].length() > 0) { | ||||
|         if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_PLAYER) && args[0].length() > 0) { | ||||
|             commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList())); | ||||
|         } | ||||
|  | ||||
|   | ||||
| @@ -31,6 +31,7 @@ import com.plotsquared.core.plot.PlotArea; | ||||
| import com.plotsquared.core.plot.PlotId; | ||||
| import com.plotsquared.core.plot.schematic.Schematic; | ||||
| import com.plotsquared.core.plot.world.PlotAreaManager; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.SchematicHandler; | ||||
| import com.plotsquared.core.util.TimeUtil; | ||||
| import com.plotsquared.core.util.task.RunnableVal; | ||||
| @@ -79,7 +80,8 @@ public class Load extends SubCommand { | ||||
|             player.sendMessage(TranslatableCaption.of("info.plot_unowned")); | ||||
|             return false; | ||||
|         } | ||||
|         if (!plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_LOAD)) { | ||||
|         if (!plot.isOwner(player.getUUID()) && !Permissions | ||||
|                 .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_LOAD)) { | ||||
|             player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); | ||||
|             return false; | ||||
|         } | ||||
|   | ||||
| @@ -32,6 +32,7 @@ import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.plot.PlotArea; | ||||
| import com.plotsquared.core.plot.world.SinglePlotArea; | ||||
| import com.plotsquared.core.util.EconHandler; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.PlotExpression; | ||||
| import com.plotsquared.core.util.task.RunnableVal2; | ||||
| import com.plotsquared.core.util.task.RunnableVal3; | ||||
| @@ -243,8 +244,8 @@ public class MainCommand extends Command { | ||||
|             PlotArea area = player.getApplicablePlotArea(); | ||||
|             Plot newPlot = Plot.fromString(area, args[0]); | ||||
|             if (newPlot != null && (player instanceof ConsolePlayer || newPlot.getArea() | ||||
|                     .equals(area) || player.hasPermission(Permission.PERMISSION_ADMIN) | ||||
|                     || player.hasPermission(Permission.PERMISSION_ADMIN_AREA_SUDO)) | ||||
|                     .equals(area) || Permissions.hasPermission(player, Permission.PERMISSION_ADMIN) | ||||
|                     || Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_AREA_SUDO)) | ||||
|                     && !newPlot.isDenied(player.getUUID())) { | ||||
|                 final Location newLoc; | ||||
|                 if (newPlot.getArea() instanceof SinglePlotArea) { | ||||
|   | ||||
| @@ -32,6 +32,7 @@ import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.plot.PlotArea; | ||||
| import com.plotsquared.core.util.EconHandler; | ||||
| import com.plotsquared.core.util.EventDispatcher; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.PlotExpression; | ||||
| import com.plotsquared.core.util.StringMan; | ||||
| import net.kyori.adventure.text.minimessage.Template; | ||||
| @@ -123,7 +124,7 @@ public class Merge extends SubCommand { | ||||
|             return false; | ||||
|         } | ||||
|         final int size = plot.getConnectedPlots().size(); | ||||
|         int max = player.hasPermissionRange("plots.merge", Settings.Limit.MAX_PLOTS); | ||||
|         int max = Permissions.hasPermissionRange(player, "plots.merge", Settings.Limit.MAX_PLOTS); | ||||
|         PlotMergeEvent event = | ||||
|                 this.eventDispatcher.callMerge(plot, direction, max, player); | ||||
|         if (event.getEventResult() == Result.DENY) { | ||||
| @@ -151,7 +152,7 @@ public class Merge extends SubCommand { | ||||
|         UUID uuid = player.getUUID(); | ||||
|  | ||||
|         if (!force && !plot.isOwner(uuid)) { | ||||
|             if (!player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_MERGE)) { | ||||
|             if (!Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_MERGE)) { | ||||
|                 player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); | ||||
|                 return false; | ||||
|             } else { | ||||
| @@ -163,7 +164,8 @@ public class Merge extends SubCommand { | ||||
|             if (args.length == 2) { | ||||
|                 terrain = "true".equalsIgnoreCase(args[1]); | ||||
|             } | ||||
|             if (!force && !terrain && !player.hasPermission(Permission.PERMISSION_MERGE_KEEP_ROAD)) { | ||||
|             if (!force && !terrain && !Permissions | ||||
|                     .hasPermission(player, Permission.PERMISSION_MERGE_KEEP_ROAD)) { | ||||
|                 player.sendMessage( | ||||
|                         TranslatableCaption.of("permission.no_permission"), | ||||
|                         Template.of("node", String.valueOf(Permission.PERMISSION_MERGE_KEEP_ROAD)) | ||||
| @@ -200,7 +202,8 @@ public class Merge extends SubCommand { | ||||
|         } else { | ||||
|             terrain = true; | ||||
|         } | ||||
|         if (!force && !terrain && !player.hasPermission(Permission.PERMISSION_MERGE_KEEP_ROAD)) { | ||||
|         if (!force && !terrain && !Permissions | ||||
|                 .hasPermission(player, Permission.PERMISSION_MERGE_KEEP_ROAD)) { | ||||
|             player.sendMessage( | ||||
|                     TranslatableCaption.of("permission.no_permission"), | ||||
|                     Template.of("node", String.valueOf(Permission.PERMISSION_MERGE_KEEP_ROAD)) | ||||
| @@ -225,7 +228,7 @@ public class Merge extends SubCommand { | ||||
|             player.sendMessage(TranslatableCaption.of("merge.no_available_automerge")); | ||||
|             return false; | ||||
|         } | ||||
|         if (!force && !player.hasPermission(Permission.PERMISSION_MERGE_OTHER)) { | ||||
|         if (!force && !Permissions.hasPermission(player, Permission.PERMISSION_MERGE_OTHER)) { | ||||
|             player.sendMessage( | ||||
|                     TranslatableCaption.of("permission.no_permission"), | ||||
|                     Template.of("node", String.valueOf(Permission.PERMISSION_MERGE_OTHER)) | ||||
| @@ -280,14 +283,8 @@ public class Merge extends SubCommand { | ||||
|             } | ||||
|         } | ||||
|         if (force || !isOnline) { | ||||
|             if (force || player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_MERGE_OTHER_OFFLINE)) { | ||||
|                 if (plot.getPlotModificationManager().autoMerge( | ||||
|                         direction, | ||||
|                         maxSize - size, | ||||
|                         uuids.iterator().next(), | ||||
|                         player, | ||||
|                         terrain | ||||
|                 )) { | ||||
|             if (force || Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_MERGE_OTHER_OFFLINE)) { | ||||
|                 if (plot.getPlotModificationManager().autoMerge(direction, maxSize - size, uuids.iterator().next(), player, terrain)) { | ||||
|                     if (this.econHandler.isEnabled(plotArea) && price > 0d) { | ||||
|                         if (!force && this.econHandler.getMoney(player) < price) { | ||||
|                             player.sendMessage( | ||||
|   | ||||
| @@ -26,6 +26,7 @@ import com.plotsquared.core.player.PlotPlayer; | ||||
| import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.plot.PlotArea; | ||||
| import com.plotsquared.core.plot.world.PlotAreaManager; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.task.RunnableVal2; | ||||
| import com.plotsquared.core.util.task.RunnableVal3; | ||||
| import net.kyori.adventure.text.minimessage.Template; | ||||
| @@ -59,7 +60,8 @@ public class Move extends SubCommand { | ||||
|             player.sendMessage(TranslatableCaption.of("errors.not_in_plot")); | ||||
|             return CompletableFuture.completedFuture(false); | ||||
|         } | ||||
|         if (!plot1.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN)) { | ||||
|         if (!plot1.isOwner(player.getUUID()) && !Permissions | ||||
|                 .hasPermission(player, Permission.PERMISSION_ADMIN)) { | ||||
|             player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); | ||||
|             return CompletableFuture.completedFuture(false); | ||||
|         } | ||||
| @@ -86,7 +88,8 @@ public class Move extends SubCommand { | ||||
|             player.sendMessage(TranslatableCaption.of("invalid.origin_cant_be_target")); | ||||
|             return CompletableFuture.completedFuture(false); | ||||
|         } | ||||
|         if (!plot1.getArea().isCompatible(plot2.getArea()) && (!override || !player.hasPermission(Permission.PERMISSION_ADMIN))) { | ||||
|         if (!plot1.getArea().isCompatible(plot2.getArea()) && (!override || !Permissions | ||||
|                 .hasPermission(player, Permission.PERMISSION_ADMIN))) { | ||||
|             player.sendMessage(TranslatableCaption.of("errors.plotworld_incompatible")); | ||||
|             return CompletableFuture.completedFuture(false); | ||||
|         } | ||||
|   | ||||
| @@ -33,6 +33,7 @@ import com.plotsquared.core.plot.flag.PlotFlag; | ||||
| import com.plotsquared.core.plot.flag.implementations.MusicFlag; | ||||
| import com.plotsquared.core.util.EventDispatcher; | ||||
| import com.plotsquared.core.util.InventoryUtil; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.sk89q.worldedit.world.item.ItemType; | ||||
| import com.sk89q.worldedit.world.item.ItemTypes; | ||||
| import net.kyori.adventure.text.minimessage.Template; | ||||
| @@ -78,7 +79,8 @@ public class Music extends SubCommand { | ||||
|             player.sendMessage(TranslatableCaption.of("info.plot_unowned")); | ||||
|             return false; | ||||
|         } | ||||
|         if (!plot.isAdded(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_MUSIC_OTHER)) { | ||||
|         if (!plot.isAdded(player.getUUID()) && !Permissions | ||||
|                 .hasPermission(player, Permission.PERMISSION_ADMIN_MUSIC_OTHER)) { | ||||
|             player.sendMessage( | ||||
|                     TranslatableCaption.of("permission.no_permission"), | ||||
|                     Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_MUSIC_OTHER)) | ||||
|   | ||||
| @@ -31,6 +31,7 @@ import com.plotsquared.core.player.PlayerMetaDataKeys; | ||||
| import com.plotsquared.core.player.PlotPlayer; | ||||
| import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.util.EventDispatcher; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.PlayerManager; | ||||
| import com.plotsquared.core.util.TabCompletions; | ||||
| import com.plotsquared.core.util.task.TaskManager; | ||||
| @@ -98,10 +99,10 @@ public class Owner extends SetCommand { | ||||
|             uuid = event.getNewOwner(); | ||||
|             boolean force = event.getEventResult() == Result.FORCE; | ||||
|             if (uuid == null) { | ||||
|                 if (!force && !player.hasPermission( | ||||
|                         Permission.PERMISSION_ADMIN_COMMAND_SET_OWNER, | ||||
|                         true | ||||
|                 )) { | ||||
|                 if (!force && !Permissions | ||||
|                         .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_SET_OWNER, | ||||
|                                 true | ||||
|                         )) { | ||||
|                     return; | ||||
|                 } | ||||
|                 PlotUnlinkEvent unlinkEvent = this.eventDispatcher.callUnlink( | ||||
| @@ -138,7 +139,8 @@ public class Owner extends SetCommand { | ||||
|                 ); | ||||
|                 return; | ||||
|             } | ||||
|             if (!force && !player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_SET_OWNER)) { | ||||
|             if (!force && !Permissions | ||||
|                     .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_SET_OWNER)) { | ||||
|                 if (other == null) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("errors.invalid_player_offline"), | ||||
|   | ||||
| @@ -34,6 +34,7 @@ import com.plotsquared.core.plot.flag.implementations.DoneFlag; | ||||
| import com.plotsquared.core.util.EventDispatcher; | ||||
| import com.plotsquared.core.util.InventoryUtil; | ||||
| import com.plotsquared.core.util.MathMan; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.TabCompletions; | ||||
| import com.plotsquared.core.util.query.PlotQuery; | ||||
| import com.plotsquared.core.util.task.TaskManager; | ||||
| @@ -113,7 +114,8 @@ public class Rate extends SubCommand { | ||||
|                         player.sendMessage(TranslatableCaption.of("errors.not_in_plot")); | ||||
|                         return false; | ||||
|                     } | ||||
|                     if (!player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_PURGE_RATINGS, true)) { | ||||
|                     if (!Permissions | ||||
|                             .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_PURGE_RATINGS, true)) { | ||||
|                         return false; | ||||
|                     } | ||||
|                     plot.clearRatings(); | ||||
| @@ -271,10 +273,10 @@ public class Rate extends SubCommand { | ||||
|     public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) { | ||||
|         if (args.length == 1) { | ||||
|             final List<String> completions = new LinkedList<>(); | ||||
|             if (player.hasPermission(Permission.PERMISSION_RATE)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_RATE)) { | ||||
|                 completions.add("1 - 10"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_PURGE_RATINGS)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_PURGE_RATINGS)) { | ||||
|                 completions.add("purge"); | ||||
|             } | ||||
|             final List<Command> commands = completions.stream().filter(completion -> completion | ||||
| @@ -282,7 +284,7 @@ public class Rate extends SubCommand { | ||||
|                             .startsWith(args[0].toLowerCase())) | ||||
|                     .map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.INFO) { | ||||
|                     }).collect(Collectors.toCollection(LinkedList::new)); | ||||
|             if (player.hasPermission(Permission.PERMISSION_RATE) && args[0].length() > 0) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_RATE) && args[0].length() > 0) { | ||||
|                 commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList())); | ||||
|             } | ||||
|             return commands; | ||||
|   | ||||
| @@ -26,6 +26,7 @@ import com.plotsquared.core.permissions.Permission; | ||||
| import com.plotsquared.core.player.PlotPlayer; | ||||
| import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.util.EventDispatcher; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.PlayerManager; | ||||
| import com.plotsquared.core.util.TabCompletions; | ||||
| import net.kyori.adventure.text.minimessage.Template; | ||||
| @@ -64,7 +65,8 @@ public class Remove extends SubCommand { | ||||
|             player.sendMessage(TranslatableCaption.of("info.plot_unowned")); | ||||
|             return false; | ||||
|         } | ||||
|         if (!plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_REMOVE)) { | ||||
|         if (!plot.isOwner(player.getUUID()) && !Permissions | ||||
|                 .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_REMOVE)) { | ||||
|             player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); | ||||
|             return true; | ||||
|         } | ||||
|   | ||||
| @@ -28,6 +28,7 @@ import com.plotsquared.core.player.PlotPlayer; | ||||
| import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.plot.PlotId; | ||||
| import com.plotsquared.core.plot.world.PlotAreaManager; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.SchematicHandler; | ||||
| import com.plotsquared.core.util.task.RunnableVal; | ||||
| import com.plotsquared.core.util.task.TaskManager; | ||||
| @@ -81,7 +82,8 @@ public class Save extends SubCommand { | ||||
|             player.sendMessage(TranslatableCaption.of("schematics.schematic_too_large")); | ||||
|             return false; | ||||
|         } | ||||
|         if (!plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_SAVE)) { | ||||
|         if (!plot.isOwner(player.getUUID()) && !Permissions | ||||
|                 .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_SAVE)) { | ||||
|             player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); | ||||
|             return false; | ||||
|         } | ||||
|   | ||||
| @@ -30,6 +30,7 @@ import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.plot.PlotArea; | ||||
| import com.plotsquared.core.plot.schematic.Schematic; | ||||
| import com.plotsquared.core.plot.world.PlotAreaManager; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.SchematicHandler; | ||||
| import com.plotsquared.core.util.StringMan; | ||||
| import com.plotsquared.core.util.TabCompletions; | ||||
| @@ -79,7 +80,7 @@ public class SchematicCmd extends SubCommand { | ||||
|         String arg = args[0].toLowerCase(); | ||||
|         switch (arg) { | ||||
|             case "paste" -> { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_SCHEMATIC_PASTE)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_SCHEMATIC_PASTE)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_SCHEMATIC_PASTE)) | ||||
| @@ -103,7 +104,8 @@ public class SchematicCmd extends SubCommand { | ||||
|                     player.sendMessage(TranslatableCaption.of("info.plot_unowned")); | ||||
|                     return false; | ||||
|                 } | ||||
|                 if (!plot.isOwner(player.getUUID()) && !player.hasPermission("plots.admin.command.schematic.paste")) { | ||||
|                 if (!plot.isOwner(player.getUUID()) && !Permissions | ||||
|                         .hasPermission(player, "plots.admin.command.schematic.paste")) { | ||||
|                     player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); | ||||
|                     return false; | ||||
|                 } | ||||
| @@ -216,7 +218,7 @@ public class SchematicCmd extends SubCommand { | ||||
|                 } | ||||
|             } | ||||
|             case "export", "save" -> { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_SCHEMATIC_SAVE)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_SCHEMATIC_SAVE)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_SCHEMATIC_SAVE)) | ||||
| @@ -241,7 +243,8 @@ public class SchematicCmd extends SubCommand { | ||||
|                     player.sendMessage(TranslatableCaption.of("schematics.schematic_too_large")); | ||||
|                     return false; | ||||
|                 } | ||||
|                 if (!plot.isOwner(player.getUUID()) && !player.hasPermission("plots.admin.command.schematic.save")) { | ||||
|                 if (!plot.isOwner(player.getUUID()) && !Permissions | ||||
|                         .hasPermission(player, "plots.admin.command.schematic.save")) { | ||||
|                     player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); | ||||
|                     return false; | ||||
|                 } | ||||
| @@ -258,7 +261,7 @@ public class SchematicCmd extends SubCommand { | ||||
|                 } | ||||
|             } | ||||
|             case "list" -> { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_SCHEMATIC_LIST)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_SCHEMATIC_LIST)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_SCHEMATIC_LIST)) | ||||
| @@ -283,13 +286,13 @@ public class SchematicCmd extends SubCommand { | ||||
|     public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) { | ||||
|         if (args.length == 1) { | ||||
|             final List<String> completions = new LinkedList<>(); | ||||
|             if (player.hasPermission(Permission.PERMISSION_SCHEMATIC_SAVE)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_SCHEMATIC_SAVE)) { | ||||
|                 completions.add("save"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_SCHEMATIC_LIST)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_SCHEMATIC_LIST)) { | ||||
|                 completions.add("list"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_SCHEMATIC_PASTE)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_SCHEMATIC_PASTE)) { | ||||
|                 completions.add("paste"); | ||||
|             } | ||||
|             final List<Command> commands = completions.stream().filter(completion -> completion | ||||
| @@ -304,7 +307,7 @@ public class SchematicCmd extends SubCommand { | ||||
|                             CommandCategory.ADMINISTRATION | ||||
|                     ) { | ||||
|                     }).collect(Collectors.toCollection(LinkedList::new)); | ||||
|             if (player.hasPermission(Permission.PERMISSION_SCHEMATIC) && args[0].length() > 0) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_SCHEMATIC) && args[0].length() > 0) { | ||||
|                 commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList())); | ||||
|             } | ||||
|             return commands; | ||||
|   | ||||
| @@ -32,6 +32,7 @@ import com.plotsquared.core.plot.PlotArea; | ||||
| import com.plotsquared.core.plot.PlotManager; | ||||
| import com.plotsquared.core.queue.QueueCoordinator; | ||||
| import com.plotsquared.core.util.PatternUtil; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.StringMan; | ||||
| import com.plotsquared.core.util.TabCompletions; | ||||
| import com.plotsquared.core.util.WorldUtil; | ||||
| @@ -95,7 +96,7 @@ public class Set extends SubCommand { | ||||
|                             BlockType::getName).toList()); | ||||
|                 } | ||||
|  | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_ADMIN_ALLOW_UNSAFE) && | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_ALLOW_UNSAFE) && | ||||
|                         !forbiddenTypes.isEmpty()) { | ||||
|                     for (String forbiddenType : forbiddenTypes) { | ||||
|                         forbiddenType = forbiddenType.toLowerCase(Locale.ENGLISH); | ||||
| @@ -131,7 +132,7 @@ public class Set extends SubCommand { | ||||
|  | ||||
|                 for (String component : components) { | ||||
|                     if (component.equalsIgnoreCase(args[0])) { | ||||
|                         if (!player.hasPermission(Permission.PERMISSION_SET_COMPONENT.format(component))) { | ||||
|                         if (!Permissions.hasPermission(player, Permission.PERMISSION_SET_COMPONENT.format(component))) { | ||||
|                             player.sendMessage( | ||||
|                                     TranslatableCaption.of("permission.no_permission"), | ||||
|                                     Template.of("node", Permission.PERMISSION_SET_COMPONENT.format(component)) | ||||
| @@ -210,7 +211,7 @@ public class Set extends SubCommand { | ||||
|         } | ||||
|         Command cmd = MainCommand.getInstance().getCommand("set" + args[0]); | ||||
|         if (cmd != null) { | ||||
|             if (!player.hasPermission(cmd.getPermission(), true)) { | ||||
|             if (!Permissions.hasPermission(player, cmd.getPermission(), true)) { | ||||
|                 return false; | ||||
|             } | ||||
|             cmd.execute(player, Arrays.copyOfRange(args, 1, args.length), null, null); | ||||
| @@ -240,37 +241,37 @@ public class Set extends SubCommand { | ||||
|         if (args.length == 1) { | ||||
|             final List<String> completions = new LinkedList<>(); | ||||
|  | ||||
|             if (player.hasPermission(Permission.PERMISSION_SET_BIOME)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_SET_BIOME)) { | ||||
|                 completions.add("biome"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_SET_ALIAS)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_SET_ALIAS)) { | ||||
|                 completions.add("alias"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_SET_HOME)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_SET_HOME)) { | ||||
|                 completions.add("home"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_SET_MAIN)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_SET_MAIN)) { | ||||
|                 completions.add("main"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_SET_FLOOR)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_SET_FLOOR)) { | ||||
|                 completions.add("floor"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_SET_AIR)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_SET_AIR)) { | ||||
|                 completions.add("air"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_SET_ALL)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_SET_ALL)) { | ||||
|                 completions.add("all"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_SET_BORDER)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_SET_BORDER)) { | ||||
|                 completions.add("border"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_SET_WALL)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_SET_WALL)) { | ||||
|                 completions.add("wall"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_SET_OUTLINE)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_SET_OUTLINE)) { | ||||
|                 completions.add("outline"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_SET_MIDDLE)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_SET_MIDDLE)) { | ||||
|                 completions.add("middle"); | ||||
|             } | ||||
|             final List<Command> commands = completions.stream().filter(completion -> completion | ||||
| @@ -279,7 +280,7 @@ public class Set extends SubCommand { | ||||
|                     .map(completion -> new Command(null, true, completion, "", RequiredType.NONE, CommandCategory.APPEARANCE) { | ||||
|                     }).collect(Collectors.toCollection(LinkedList::new)); | ||||
|  | ||||
|             if (player.hasPermission(Permission.PERMISSION_SET) && args[0].length() > 0) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_SET) && args[0].length() > 0) { | ||||
|                 commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList())); | ||||
|             } | ||||
|             return commands; | ||||
| @@ -295,7 +296,7 @@ public class Set extends SubCommand { | ||||
|  | ||||
|             final Command cmd = MainCommand.getInstance().getCommand("set" + args[0]); | ||||
|             if (cmd != null) { | ||||
|                 if (!player.hasPermission(cmd.getPermission(), true)) { | ||||
|                 if (!Permissions.hasPermission(player, cmd.getPermission(), true)) { | ||||
|                     return new ArrayList<>(); | ||||
|                 } | ||||
|                 return cmd.tab(player, newArgs, space); | ||||
|   | ||||
| @@ -23,6 +23,7 @@ import com.plotsquared.core.location.Location; | ||||
| import com.plotsquared.core.permissions.Permission; | ||||
| import com.plotsquared.core.player.PlotPlayer; | ||||
| import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.StringMan; | ||||
| import net.kyori.adventure.text.minimessage.Template; | ||||
|  | ||||
| @@ -37,7 +38,7 @@ public abstract class SetCommand extends SubCommand { | ||||
|             return false; | ||||
|         } | ||||
|         if (!plot.hasOwner()) { | ||||
|             if (!player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND.format(getFullId()))) { | ||||
|             if (!Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND.format(getFullId()))) { | ||||
|                 player.sendMessage( | ||||
|                         TranslatableCaption.of("permission.no_permission"), | ||||
|                         Template.of("node", Permission.PERMISSION_ADMIN_COMMAND.format(getFullId())) | ||||
| @@ -47,7 +48,7 @@ public abstract class SetCommand extends SubCommand { | ||||
|             } | ||||
|         } | ||||
|         if (!plot.isOwner(player.getUUID())) { | ||||
|             if (!player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND.format(getFullId()))) { | ||||
|             if (!Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND.format(getFullId()))) { | ||||
|                 player.sendMessage( | ||||
|                         TranslatableCaption.of("permission.no_permission"), | ||||
|                         Template.of("node", Permission.PERMISSION_ADMIN_COMMAND.format(getFullId())) | ||||
|   | ||||
| @@ -23,6 +23,7 @@ import com.plotsquared.core.location.Location; | ||||
| import com.plotsquared.core.permissions.Permission; | ||||
| import com.plotsquared.core.player.PlotPlayer; | ||||
| import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.task.RunnableVal2; | ||||
| import com.plotsquared.core.util.task.RunnableVal3; | ||||
| import net.kyori.adventure.text.minimessage.Template; | ||||
| @@ -48,7 +49,8 @@ public class Swap extends SubCommand { | ||||
|             player.sendMessage(TranslatableCaption.of("errors.not_in_plot")); | ||||
|             return CompletableFuture.completedFuture(false); | ||||
|         } | ||||
|         if (!plot1.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN)) { | ||||
|         if (!plot1.isOwner(player.getUUID()) && !Permissions | ||||
|                 .hasPermission(player, Permission.PERMISSION_ADMIN)) { | ||||
|             player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); | ||||
|             return CompletableFuture.completedFuture(false); | ||||
|         } | ||||
|   | ||||
| @@ -39,6 +39,7 @@ import com.plotsquared.core.setup.PlotAreaBuilder; | ||||
| import com.plotsquared.core.setup.SettingsNodesWrapper; | ||||
| import com.plotsquared.core.util.FileBytes; | ||||
| import com.plotsquared.core.util.FileUtils; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.SetupUtils; | ||||
| import com.plotsquared.core.util.TabCompletions; | ||||
| import com.plotsquared.core.util.WorldUtil; | ||||
| @@ -278,10 +279,10 @@ public class Template extends SubCommand { | ||||
|     public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) { | ||||
|         if (args.length == 1) { | ||||
|             final List<String> completions = new LinkedList<>(); | ||||
|             if (player.hasPermission(Permission.PERMISSION_TEMPLATE_EXPORT)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_TEMPLATE_EXPORT)) { | ||||
|                 completions.add("export"); | ||||
|             } | ||||
|             if (player.hasPermission(Permission.PERMISSION_TEMPLATE_IMPORT)) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_TEMPLATE_IMPORT)) { | ||||
|                 completions.add("import"); | ||||
|             } | ||||
|             final List<Command> commands = completions.stream().filter(completion -> completion | ||||
| @@ -296,7 +297,7 @@ public class Template extends SubCommand { | ||||
|                             CommandCategory.ADMINISTRATION | ||||
|                     ) { | ||||
|                     }).collect(Collectors.toCollection(LinkedList::new)); | ||||
|             if (player.hasPermission(Permission.PERMISSION_TEMPLATE) && args[0].length() > 0) { | ||||
|             if (Permissions.hasPermission(player, Permission.PERMISSION_TEMPLATE) && args[0].length() > 0) { | ||||
|                 commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList())); | ||||
|             } | ||||
|             return commands; | ||||
|   | ||||
| @@ -27,6 +27,7 @@ import com.plotsquared.core.permissions.Permission; | ||||
| import com.plotsquared.core.player.PlotPlayer; | ||||
| import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.util.EventDispatcher; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.PlayerManager; | ||||
| import com.plotsquared.core.util.TabCompletions; | ||||
| import com.plotsquared.core.util.task.RunnableVal2; | ||||
| @@ -68,7 +69,8 @@ public class Trust extends Command { | ||||
|         } | ||||
|         checkTrue(currentPlot.hasOwner(), TranslatableCaption.of("info.plot_unowned")); | ||||
|         checkTrue( | ||||
|                 currentPlot.isOwner(player.getUUID()) || player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_TRUST), | ||||
|                 currentPlot.isOwner(player.getUUID()) || Permissions | ||||
|                         .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_TRUST), | ||||
|                 TranslatableCaption.of("permission.no_plot_perms") | ||||
|         ); | ||||
|  | ||||
| @@ -99,7 +101,8 @@ public class Trust extends Command { | ||||
|                 while (iterator.hasNext()) { | ||||
|                     UUID uuid = iterator.next(); | ||||
|                     if (uuid == DBFunc.EVERYONE && !( | ||||
|                             player.hasPermission(Permission.PERMISSION_TRUST_EVERYONE) || player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_TRUST))) { | ||||
|                             Permissions.hasPermission(player, Permission.PERMISSION_TRUST_EVERYONE) || Permissions | ||||
|                                     .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_TRUST))) { | ||||
|                         player.sendMessage( | ||||
|                                 TranslatableCaption.of("errors.invalid_player"), | ||||
|                                 Template.of("value", PlayerManager.resolveName(uuid).getComponent(player)) | ||||
| @@ -127,7 +130,7 @@ public class Trust extends Command { | ||||
|                 } | ||||
|                 checkTrue(!uuids.isEmpty(), null); | ||||
|                 int localTrustSize = currentPlot.getTrusted().size(); | ||||
|                 int maxTrustSize = player.hasPermissionRange(Permission.PERMISSION_TRUST, Settings.Limit.MAX_PLOTS); | ||||
|                 int maxTrustSize = Permissions.hasPermissionRange(player, Permission.PERMISSION_TRUST, Settings.Limit.MAX_PLOTS); | ||||
|                 if (localTrustSize >= maxTrustSize) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("members.plot_max_members_trusted"), | ||||
|   | ||||
| @@ -27,6 +27,7 @@ import com.plotsquared.core.permissions.Permission; | ||||
| import com.plotsquared.core.player.PlotPlayer; | ||||
| import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.util.EventDispatcher; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.StringMan; | ||||
| import com.plotsquared.core.util.task.TaskManager; | ||||
| import net.kyori.adventure.text.minimessage.Template; | ||||
| @@ -90,7 +91,8 @@ public class Unlink extends SubCommand { | ||||
|             return true; | ||||
|         } | ||||
|         boolean force = event.getEventResult() == Result.FORCE; | ||||
|         if (!force && !plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_UNLINK)) { | ||||
|         if (!force && !plot.isOwner(player.getUUID()) && !Permissions | ||||
|                 .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_UNLINK)) { | ||||
|             player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); | ||||
|             return true; | ||||
|         } | ||||
|   | ||||
| @@ -31,6 +31,7 @@ import com.plotsquared.core.plot.PlotArea; | ||||
| import com.plotsquared.core.plot.flag.implementations.UntrustedVisitFlag; | ||||
| import com.plotsquared.core.plot.world.PlotAreaManager; | ||||
| import com.plotsquared.core.util.MathMan; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.PlayerManager; | ||||
| import com.plotsquared.core.util.TabCompletions; | ||||
| import com.plotsquared.core.util.query.PlotQuery; | ||||
| @@ -107,7 +108,7 @@ public class Visit extends Command { | ||||
|  | ||||
|         final Plot plot = plots.get(page - 1); | ||||
|         if (!plot.hasOwner()) { | ||||
|             if (!player.hasPermission(Permission.PERMISSION_VISIT_UNOWNED)) { | ||||
|             if (!Permissions.hasPermission(player, Permission.PERMISSION_VISIT_UNOWNED)) { | ||||
|                 player.sendMessage( | ||||
|                         TranslatableCaption.of("permission.no_permission"), | ||||
|                         Templates.of("node", "plots.visit.unowned") | ||||
| @@ -115,7 +116,8 @@ public class Visit extends Command { | ||||
|                 return; | ||||
|             } | ||||
|         } else if (plot.isOwner(player.getUUID())) { | ||||
|             if (!player.hasPermission(Permission.PERMISSION_VISIT_OWNED) && !player.hasPermission(Permission.PERMISSION_HOME)) { | ||||
|             if (!Permissions.hasPermission(player, Permission.PERMISSION_VISIT_OWNED) && !Permissions | ||||
|                     .hasPermission(player, Permission.PERMISSION_HOME)) { | ||||
|                 player.sendMessage( | ||||
|                         TranslatableCaption.of("permission.no_permission"), | ||||
|                         Templates.of("node", "plots.visit.owned") | ||||
| @@ -123,7 +125,7 @@ public class Visit extends Command { | ||||
|                 return; | ||||
|             } | ||||
|         } else if (plot.isAdded(player.getUUID())) { | ||||
|             if (!player.hasPermission(Permission.PERMISSION_SHARED)) { | ||||
|             if (!Permissions.hasPermission(player, Permission.PERMISSION_SHARED)) { | ||||
|                 player.sendMessage( | ||||
|                         TranslatableCaption.of("permission.no_permission"), | ||||
|                         Templates.of("node", "plots.visit.shared") | ||||
| @@ -133,8 +135,8 @@ public class Visit extends Command { | ||||
|         } else { | ||||
|             // allow visit, if UntrustedVisit flag is set, or if the player has either the plot.visit.other or | ||||
|             // plot.admin.visit.untrusted permission | ||||
|             if (!plot.getFlag(UntrustedVisitFlag.class) && !player.hasPermission(Permission.PERMISSION_VISIT_OTHER) | ||||
|                     && !player.hasPermission(Permission.PERMISSION_ADMIN_VISIT_UNTRUSTED)) { | ||||
|             if (!plot.getFlag(UntrustedVisitFlag.class) && !Permissions.hasPermission(player, Permission.PERMISSION_VISIT_OTHER) | ||||
|                 && !Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_VISIT_UNTRUSTED)) { | ||||
|                 player.sendMessage( | ||||
|                         TranslatableCaption.of("permission.no_permission"), | ||||
|                         Templates.of("node", "plots.visit.other") | ||||
| @@ -142,7 +144,7 @@ public class Visit extends Command { | ||||
|                 return; | ||||
|             } | ||||
|             if (plot.isDenied(player.getUUID())) { | ||||
|                 if (!player.hasPermission(Permission.PERMISSION_VISIT_DENIED)) { | ||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_VISIT_DENIED)) { | ||||
|                     player.sendMessage( | ||||
|                             TranslatableCaption.of("permission.no_permission"), | ||||
|                             Template.of("node", String.valueOf(Permission.PERMISSION_VISIT_DENIED)) | ||||
|   | ||||
| @@ -35,6 +35,7 @@ import com.plotsquared.core.queue.QueueCoordinator; | ||||
| import com.plotsquared.core.util.EconHandler; | ||||
| import com.plotsquared.core.util.InventoryUtil; | ||||
| import com.plotsquared.core.util.PatternUtil; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.sk89q.worldedit.function.pattern.Pattern; | ||||
| import com.sk89q.worldedit.world.item.ItemTypes; | ||||
| import net.kyori.adventure.text.minimessage.MiniMessage; | ||||
| @@ -50,6 +51,7 @@ import java.nio.file.Files; | ||||
| import java.nio.file.Path; | ||||
| import java.nio.file.Paths; | ||||
| import java.util.ArrayList; | ||||
| import java.util.Arrays; | ||||
| import java.util.Collections; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| @@ -151,7 +153,8 @@ public class ComponentPresetManager { | ||||
|         } else if (!plot.hasOwner()) { | ||||
|             player.sendMessage(TranslatableCaption.of("info.plot_unowned")); | ||||
|             return null; | ||||
|         } else if (!plot.isOwner(player.getUUID()) && !plot.getTrusted().contains(player.getUUID()) && !player.hasPermission( | ||||
|         } else if (!plot.isOwner(player.getUUID()) && !plot.getTrusted().contains(player.getUUID()) && !Permissions.hasPermission( | ||||
|                 player, | ||||
|                 Permission.PERMISSION_ADMIN_COMPONENTS_OTHER | ||||
|         )) { | ||||
|             player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); | ||||
| @@ -163,7 +166,8 @@ public class ComponentPresetManager { | ||||
|  | ||||
|         final List<ComponentPreset> allowedPresets = new ArrayList<>(this.presets.size()); | ||||
|         for (final ComponentPreset componentPreset : this.presets) { | ||||
|             if (!componentPreset.getPermission().isEmpty() && !player.hasPermission( | ||||
|             if (!componentPreset.getPermission().isEmpty() && !Permissions.hasPermission( | ||||
|                     player, | ||||
|                     componentPreset.getPermission() | ||||
|             )) { | ||||
|                 continue; | ||||
|   | ||||
| @@ -114,7 +114,7 @@ public class PlayerAutoPlotEvent extends PlotEvent implements CancellablePlotEve | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @deprecated for removal. Use {@link PlayerAutoPlotEvent#setSizeX(int)} | ||||
|      * @deprecated for removal. Use {@link PlayerAutoPlotEvent#setSizeX(int)} )} | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.1.0") | ||||
|     public void setSize_x(int sizeX) { | ||||
| @@ -130,7 +130,7 @@ public class PlayerAutoPlotEvent extends PlotEvent implements CancellablePlotEve | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @deprecated for removal. Use {@link PlayerAutoPlotEvent#setSizeZ(int)} | ||||
|      * @deprecated for removal. Use {@link PlayerAutoPlotEvent#setSizeZ(int)} )} | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.1.0") | ||||
|     public void setSize_z(int sizeZ) { | ||||
|   | ||||
| @@ -56,6 +56,7 @@ import com.plotsquared.core.plot.flag.implementations.TitlesFlag; | ||||
| import com.plotsquared.core.plot.flag.implementations.WeatherFlag; | ||||
| import com.plotsquared.core.plot.flag.types.TimedFlag; | ||||
| import com.plotsquared.core.util.EventDispatcher; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.PlayerManager; | ||||
| import com.plotsquared.core.util.task.TaskManager; | ||||
| import com.plotsquared.core.util.task.TaskTime; | ||||
| @@ -148,7 +149,8 @@ public class PlotListener { | ||||
|     } | ||||
|  | ||||
|     public boolean plotEntry(final PlotPlayer<?> player, final Plot plot) { | ||||
|         if (plot.isDenied(player.getUUID()) && !player.hasPermission("plots.admin.entry.denied")) { | ||||
|         if (plot.isDenied(player.getUUID()) && !Permissions | ||||
|                 .hasPermission(player, "plots.admin.entry.denied")) { | ||||
|             player.sendMessage( | ||||
|                     TranslatableCaption.of("deny.no_enter"), | ||||
|                     Template.of("plot", plot.toString()) | ||||
| @@ -186,7 +188,7 @@ public class PlotListener { | ||||
|             } | ||||
|  | ||||
|             if (plot.getFlag(NotifyEnterFlag.class)) { | ||||
|                 if (!player.hasPermission("plots.flag.notify-enter.bypass")) { | ||||
|                 if (!Permissions.hasPermission(player, "plots.flag.notify-enter.bypass")) { | ||||
|                     for (UUID uuid : plot.getOwners()) { | ||||
|                         final PlotPlayer<?> owner = PlotSquared.platform().playerManager().getPlayerIfExists(uuid); | ||||
|                         if (owner != null && !owner.getUUID().equals(player.getUUID()) && owner.canSee(player)) { | ||||
| @@ -198,7 +200,7 @@ public class PlotListener { | ||||
|             } | ||||
|  | ||||
|             final FlyFlag.FlyStatus flyStatus = plot.getFlag(FlyFlag.class); | ||||
|             if (!player.hasPermission(Permission.PERMISSION_ADMIN_FLIGHT)) { | ||||
|             if (!Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_FLIGHT)) { | ||||
|                 if (flyStatus != FlyFlag.FlyStatus.DEFAULT) { | ||||
|                     boolean flight = player.getFlight(); | ||||
|                     GameMode gamemode = player.getGameMode(); | ||||
| @@ -214,7 +216,7 @@ public class PlotListener { | ||||
|             final GameMode gameMode = plot.getFlag(GamemodeFlag.class); | ||||
|             if (!gameMode.equals(GamemodeFlag.DEFAULT)) { | ||||
|                 if (player.getGameMode() != gameMode) { | ||||
|                     if (!player.hasPermission("plots.gamemode.bypass")) { | ||||
|                     if (!Permissions.hasPermission(player, "plots.gamemode.bypass")) { | ||||
|                         player.setGameMode(gameMode); | ||||
|                     } else { | ||||
|                         player.sendMessage( | ||||
| @@ -229,7 +231,7 @@ public class PlotListener { | ||||
|             final GameMode guestGameMode = plot.getFlag(GuestGamemodeFlag.class); | ||||
|             if (!guestGameMode.equals(GamemodeFlag.DEFAULT)) { | ||||
|                 if (player.getGameMode() != guestGameMode && !plot.isAdded(player.getUUID())) { | ||||
|                     if (!player.hasPermission("plots.gamemode.bypass")) { | ||||
|                     if (!Permissions.hasPermission(player, "plots.gamemode.bypass")) { | ||||
|                         player.setGameMode(guestGameMode); | ||||
|                     } else { | ||||
|                         player.sendMessage( | ||||
| @@ -390,7 +392,8 @@ public class PlotListener { | ||||
|                 } | ||||
|                 try (final MetaDataAccess<Boolean> kickAccess = | ||||
|                              player.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_KICK)) { | ||||
|                     if (plot.getFlag(DenyExitFlag.class) && !player.hasPermission(Permission.PERMISSION_ADMIN_EXIT_DENIED) && | ||||
|                     if (plot.getFlag(DenyExitFlag.class) && !Permissions | ||||
|                             .hasPermission(player, Permission.PERMISSION_ADMIN_EXIT_DENIED) && | ||||
|                             !kickAccess.get().orElse(false)) { | ||||
|                         if (previous != null) { | ||||
|                             lastPlot.set(previous); | ||||
| @@ -401,7 +404,7 @@ public class PlotListener { | ||||
|                 if (!plot.getFlag(GamemodeFlag.class).equals(GamemodeFlag.DEFAULT) || !plot | ||||
|                         .getFlag(GuestGamemodeFlag.class).equals(GamemodeFlag.DEFAULT)) { | ||||
|                     if (player.getGameMode() != pw.getGameMode()) { | ||||
|                         if (!player.hasPermission("plots.gamemode.bypass")) { | ||||
|                         if (!Permissions.hasPermission(player, "plots.gamemode.bypass")) { | ||||
|                             player.setGameMode(pw.getGameMode()); | ||||
|                         } else { | ||||
|                             player.sendMessage( | ||||
| @@ -423,7 +426,7 @@ public class PlotListener { | ||||
|                 } | ||||
|  | ||||
|                 if (plot.getFlag(NotifyLeaveFlag.class)) { | ||||
|                     if (!player.hasPermission("plots.flag.notify-leave.bypass")) { | ||||
|                     if (!Permissions.hasPermission(player, "plots.flag.notify-leave.bypass")) { | ||||
|                         for (UUID uuid : plot.getOwners()) { | ||||
|                             final PlotPlayer<?> owner = PlotSquared.platform().playerManager().getPlayerIfExists(uuid); | ||||
|                             if ((owner != null) && !owner.getUUID().equals(player.getUUID()) && owner.canSee(player)) { | ||||
|   | ||||
| @@ -25,6 +25,7 @@ import com.plotsquared.core.configuration.caption.TranslatableCaption; | ||||
| import com.plotsquared.core.player.PlotPlayer; | ||||
| import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.plot.world.PlotAreaManager; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.WEManager; | ||||
| import com.plotsquared.core.util.WorldUtil; | ||||
| import com.sk89q.worldedit.EditSession; | ||||
| @@ -91,7 +92,7 @@ public class WESubscriber { | ||||
|             } else { | ||||
|                 mask = WEManager.getMask(plotPlayer); | ||||
|                 if (mask.isEmpty()) { | ||||
|                     if (plotPlayer.hasPermission("plots.worldedit.bypass")) { | ||||
|                     if (Permissions.hasPermission(plotPlayer, "plots.worldedit.bypass")) { | ||||
|                         plotPlayer.sendMessage( | ||||
|                                 TranslatableCaption.of("worldedit.worldedit_bypass"), | ||||
|                                 Template.of("command", "/plot toggle worldedit") | ||||
|   | ||||
| @@ -38,16 +38,6 @@ public interface PermissionHolder { | ||||
|         return hasPermission(null, permission); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Check if the owner of the profile has a given (global) permission | ||||
|      * | ||||
|      * @param permission Permission | ||||
|      * @return {@code true} if the owner has the given permission, else {@code false} | ||||
|      */ | ||||
|     default boolean hasPermission(final @NonNull Permission permission) { | ||||
|         return hasPermission(permission.toString()); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Check if the owner of the profile has a given (global) keyed permission. Checks both {@code permission.key} | ||||
|      * and {@code permission.*} | ||||
| @@ -64,23 +54,6 @@ public interface PermissionHolder { | ||||
|         return hasKeyedPermission(null, permission, key); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Check the highest permission a PlotPlayer has within a specified range.<br> | ||||
|      * - Excessively high values will lag<br> | ||||
|      * - The default range that is checked is {@link Settings.Limit#MAX_PLOTS}<br> | ||||
|      * | ||||
|      * @param stub  The permission stub to check e.g. for `plots.plot.#` the stub is `plots.plot` | ||||
|      * @param range The range to check | ||||
|      * @return The highest permission they have within that range | ||||
|      */ | ||||
|     @NonNegative | ||||
|     default int hasPermissionRange( | ||||
|             final @NonNull Permission stub, | ||||
|             @NonNegative final int range | ||||
|     ) { | ||||
|         return hasPermissionRange(stub.toString(), range); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Check the highest permission a PlotPlayer has within a specified range.<br> | ||||
|      * - Excessively high values will lag<br> | ||||
| @@ -119,26 +92,6 @@ public interface PermissionHolder { | ||||
|         return 0; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Checks if the owner of the profile has a permission, and optionally send the no permission message if applicable. | ||||
|      * | ||||
|      * @param permission Permission | ||||
|      * @param notify     If to notify the permission holder | ||||
|      * @return {@code true} if the owner has the given permission, else {@code false} | ||||
|      */ | ||||
|     default boolean hasPermission(@NonNull Permission permission, boolean notify) { | ||||
|         return hasPermission(permission.toString(), notify); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Checks if the owner of the profile has a permission, and optionally send the no permission message if applicable. | ||||
|      * | ||||
|      * @param permission Permission | ||||
|      * @param notify     If to notify the permission holder | ||||
|      * @return {@code true} if the owner has the given permission, else {@code false} | ||||
|      */ | ||||
|     boolean hasPermission(@NonNull String permission, boolean notify); | ||||
|  | ||||
|     /** | ||||
|      * Check if the owner of the profile has a given permission | ||||
|      * | ||||
|   | ||||
| @@ -48,6 +48,7 @@ import com.plotsquared.core.plot.world.SinglePlotArea; | ||||
| import com.plotsquared.core.plot.world.SinglePlotAreaManager; | ||||
| import com.plotsquared.core.synchronization.LockRepository; | ||||
| import com.plotsquared.core.util.EventDispatcher; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.query.PlotQuery; | ||||
| import com.plotsquared.core.util.task.RunnableVal; | ||||
| import com.plotsquared.core.util.task.TaskManager; | ||||
| @@ -199,20 +200,6 @@ public abstract class PlotPlayer<P> implements CommandCaller, OfflinePlotPlayer, | ||||
|         return this.permissionProfile.hasKeyedPermission(world, permission, key); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public final boolean hasPermission(@NonNull String permission, boolean notify) { | ||||
|         if (!hasPermission(permission)) { | ||||
|             if (notify) { | ||||
|                 sendMessage( | ||||
|                         TranslatableCaption.of("permission.no_permission_event"), | ||||
|                         Template.of("node", permission) | ||||
|                 ); | ||||
|             } | ||||
|             return false; | ||||
|         } | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     public abstract Actor toActor(); | ||||
|  | ||||
|     public abstract P getPlatformPlayer(); | ||||
| @@ -303,7 +290,7 @@ public abstract class PlotPlayer<P> implements CommandCaller, OfflinePlotPlayer, | ||||
|      * @return number of allowed plots within the scope (globally, or in the player's current world as defined in the settings.yml) | ||||
|      */ | ||||
|     public int getAllowedPlots() { | ||||
|         return hasPermissionRange("plots.plot", Settings.Limit.MAX_PLOTS); | ||||
|         return Permissions.hasPermissionRange(this, "plots.plot", Settings.Limit.MAX_PLOTS); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -54,6 +54,7 @@ import com.plotsquared.core.plot.world.SinglePlotArea; | ||||
| import com.plotsquared.core.queue.QueueCoordinator; | ||||
| import com.plotsquared.core.util.EventDispatcher; | ||||
| import com.plotsquared.core.util.MathMan; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.PlayerManager; | ||||
| import com.plotsquared.core.util.RegionManager; | ||||
| import com.plotsquared.core.util.RegionUtil; | ||||
| @@ -2206,7 +2207,7 @@ public class Plot { | ||||
|     public boolean canClaim(@NonNull PlotPlayer<?> player) { | ||||
|         PlotCluster cluster = this.getCluster(); | ||||
|         if (cluster != null) { | ||||
|             if (!cluster.isAdded(player.getUUID()) && !player.hasPermission("plots.admin.command.claim")) { | ||||
|             if (!cluster.isAdded(player.getUUID()) && !Permissions.hasPermission(player, "plots.admin.command.claim")) { | ||||
|                 return false; | ||||
|             } | ||||
|         } | ||||
| @@ -2597,7 +2598,7 @@ public class Plot { | ||||
|             Template plotTemplate = Template.of("plot", this.toString()); | ||||
|             Template messageTemplate = Template.of("message", message); | ||||
|             for (final PlotPlayer<?> player : players) { | ||||
|                 if (isOwner(player.getUUID()) || player.hasPermission(Permission.PERMISSION_ADMIN_DEBUG_OTHER)) { | ||||
|                 if (isOwner(player.getUUID()) || Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_DEBUG_OTHER)) { | ||||
|                     player.sendMessage(caption, plotTemplate, messageTemplate); | ||||
|                 } | ||||
|             } | ||||
| @@ -2634,7 +2635,8 @@ public class Plot { | ||||
|             return; | ||||
|         } | ||||
|         final Consumer<Location> locationConsumer = location -> { | ||||
|             if (Settings.Teleport.DELAY == 0 || player.hasPermission("plots.teleport.delay.bypass")) { | ||||
|             if (Settings.Teleport.DELAY == 0 || Permissions | ||||
|                     .hasPermission(player, "plots.teleport.delay.bypass")) { | ||||
|                 player.sendMessage(TranslatableCaption.of("teleport.teleported_to_plot")); | ||||
|                 player.teleport(location, cause); | ||||
|                 resultConsumer.accept(true); | ||||
|   | ||||
| @@ -49,6 +49,7 @@ import com.plotsquared.core.plot.flag.implementations.DoneFlag; | ||||
| import com.plotsquared.core.queue.GlobalBlockQueue; | ||||
| import com.plotsquared.core.queue.QueueCoordinator; | ||||
| import com.plotsquared.core.util.MathMan; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.PlotExpression; | ||||
| import com.plotsquared.core.util.RegionUtil; | ||||
| import com.plotsquared.core.util.StringMan; | ||||
| @@ -645,7 +646,7 @@ public abstract class PlotArea { | ||||
|      * @since 6.9.1 | ||||
|      */ | ||||
|     public boolean notifyIfOutsideBuildArea(PlotPlayer<?> player, int y) { | ||||
|         if (!buildRangeContainsY(y) && !player.hasPermission(Permission.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) { | ||||
|         if (!buildRangeContainsY(y) && !Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) { | ||||
|             player.sendMessage( | ||||
|                     TranslatableCaption.of("height.height_limit"), | ||||
|                     Template.of("minHeight", String.valueOf(minBuildHeight)), | ||||
|   | ||||
| @@ -24,6 +24,7 @@ import org.checkerframework.checker.nullness.qual.NonNull; | ||||
| import org.checkerframework.checker.nullness.qual.Nullable; | ||||
|  | ||||
| import java.util.Collection; | ||||
| import java.util.Objects; | ||||
|  | ||||
| /** | ||||
|  * A world that contains plots | ||||
|   | ||||
| @@ -21,6 +21,7 @@ package com.plotsquared.core.plot.comment; | ||||
| import com.plotsquared.core.database.DBFunc; | ||||
| import com.plotsquared.core.player.PlotPlayer; | ||||
| import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.util.Permissions; | ||||
| import com.plotsquared.core.util.task.RunnableVal; | ||||
|  | ||||
| import java.util.List; | ||||
| @@ -36,8 +37,9 @@ public abstract class CommentInbox { | ||||
|      * @return the inbox, otherwise {@code false} false | ||||
|      */ | ||||
|     public boolean canRead(Plot plot, PlotPlayer<?> player) { | ||||
|         if (player.hasPermission("plots.inbox.read." + this, true)) { | ||||
|             return plot.isOwner(player.getUUID()) || player.hasPermission("plots.inbox.read." + this + ".other", true); | ||||
|         if (Permissions.hasPermission(player, "plots.inbox.read." + this, true)) { | ||||
|             return plot.isOwner(player.getUUID()) || Permissions | ||||
|                     .hasPermission(player, "plots.inbox.read." + this + ".other", true); | ||||
|         } | ||||
|         return false; | ||||
|     } | ||||
| @@ -49,10 +51,11 @@ public abstract class CommentInbox { | ||||
|      */ | ||||
|     public boolean canWrite(Plot plot, PlotPlayer<?> player) { | ||||
|         if (plot == null) { | ||||
|             return player.hasPermission("plots.inbox.write." + this, true); | ||||
|             return Permissions.hasPermission(player, "plots.inbox.write." + this, true); | ||||
|         } | ||||
|         return player.hasPermission("plots.inbox.write." + this, true) && ( | ||||
|                 plot.isOwner(player.getUUID()) || player.hasPermission("plots.inbox.write." + this + ".other", true)); | ||||
|         return Permissions.hasPermission(player, "plots.inbox.write." + this, true) && ( | ||||
|                 plot.isOwner(player.getUUID()) || Permissions | ||||
|                         .hasPermission(player, "plots.inbox.write." + this + ".other", true)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @@ -62,8 +65,9 @@ public abstract class CommentInbox { | ||||
|      */ | ||||
|     @SuppressWarnings({"BooleanMethodIsAlwaysInverted"}) | ||||
|     public boolean canModify(Plot plot, PlotPlayer<?> player) { | ||||
|         if (player.hasPermission("plots.inbox.modify." + this, true)) { | ||||
|             return plot.isOwner(player.getUUID()) || player.hasPermission("plots.inbox.modify." + this + ".other", true); | ||||
|         if (Permissions.hasPermission(player, "plots.inbox.modify." + this, true)) { | ||||
|             return plot.isOwner(player.getUUID()) || Permissions | ||||
|                     .hasPermission(player, "plots.inbox.modify." + this + ".other", true); | ||||
|         } | ||||
|         return false; | ||||
|     } | ||||
|   | ||||
| @@ -24,6 +24,7 @@ import org.checkerframework.checker.nullness.qual.NonNull; | ||||
|  | ||||
| import java.util.Collection; | ||||
| import java.util.Collections; | ||||
| import java.util.Objects; | ||||
|  | ||||
| /** | ||||
|  * A plot flag is any property that can be assigned | ||||
|   | ||||
| @@ -332,7 +332,8 @@ public class EventDispatcher { | ||||
|     ) { | ||||
|         PlotArea area = location.getPlotArea(); | ||||
|         assert area != null; | ||||
|         if (!area.buildRangeContainsY(location.getY()) && !player.hasPermission(Permission.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) { | ||||
|         if (!area.buildRangeContainsY(location.getY()) && !Permissions | ||||
|                 .hasPermission(player, Permission.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) { | ||||
|             player.sendMessage( | ||||
|                     TranslatableCaption.of("height.height_limit"), | ||||
|                     Template.of("minHeight", String.valueOf(area.getMinBuildHeight())), | ||||
| @@ -359,12 +360,12 @@ public class EventDispatcher { | ||||
|                             return true; | ||||
|                         } | ||||
|                     } | ||||
|                     return player.hasPermission( | ||||
|                     return Permissions.hasPermission(player, | ||||
|                             Permission.PERMISSION_ADMIN_INTERACT_ROAD.toString(), notifyPerms | ||||
|                     ); | ||||
|                 } | ||||
|                 if (!plot.hasOwner()) { | ||||
|                     return player.hasPermission( | ||||
|                     return Permissions.hasPermission(player, | ||||
|                             Permission.PERMISSION_ADMIN_INTERACT_UNOWNED.toString(), notifyPerms | ||||
|                     ); | ||||
|                 } | ||||
| @@ -375,7 +376,7 @@ public class EventDispatcher { | ||||
|                         return true; | ||||
|                     } | ||||
|                 } | ||||
|                 if (player.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_OTHER.toString(), false)) { | ||||
|                 if (Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_INTERACT_OTHER.toString(), false)) { | ||||
|                     return true; | ||||
|                 } | ||||
|                 if (notifyPerms) { | ||||
| @@ -394,12 +395,12 @@ public class EventDispatcher { | ||||
|                             return true; | ||||
|                         } | ||||
|                     } | ||||
|                     return player.hasPermission( | ||||
|                     return Permissions.hasPermission(player, | ||||
|                             Permission.PERMISSION_ADMIN_INTERACT_ROAD.toString(), false | ||||
|                     ); | ||||
|                 } | ||||
|                 if (!plot.hasOwner()) { | ||||
|                     return player.hasPermission( | ||||
|                     return Permissions.hasPermission(player, | ||||
|                             Permission.PERMISSION_ADMIN_INTERACT_UNOWNED.toString(), false | ||||
|                     ); | ||||
|                 } | ||||
| @@ -413,19 +414,19 @@ public class EventDispatcher { | ||||
|                         return true; | ||||
|                     } | ||||
|                 } | ||||
|                 return player.hasPermission( | ||||
|                         Permission.PERMISSION_ADMIN_INTERACT_OTHER.toString(), | ||||
|                         false | ||||
|                 ); | ||||
|                 return Permissions | ||||
|                         .hasPermission(player, Permission.PERMISSION_ADMIN_INTERACT_OTHER.toString(), | ||||
|                                 false | ||||
|                         ); | ||||
|             } | ||||
|             case SPAWN_MOB: { | ||||
|                 if (plot == null) { | ||||
|                     return player.hasPermission( | ||||
|                     return Permissions.hasPermission(player, | ||||
|                             Permission.PERMISSION_ADMIN_INTERACT_ROAD.toString(), notifyPerms | ||||
|                     ); | ||||
|                 } | ||||
|                 if (!plot.hasOwner()) { | ||||
|                     return player.hasPermission( | ||||
|                     return Permissions.hasPermission(player, | ||||
|                             Permission.PERMISSION_ADMIN_INTERACT_UNOWNED.toString(), notifyPerms | ||||
|                     ); | ||||
|                 } | ||||
| @@ -439,10 +440,10 @@ public class EventDispatcher { | ||||
|                         return true; | ||||
|                     } | ||||
|                 } | ||||
|                 if (player.hasPermission( | ||||
|                         Permission.PERMISSION_ADMIN_INTERACT_OTHER.toString(), | ||||
|                         false | ||||
|                 )) { | ||||
|                 if (Permissions | ||||
|                         .hasPermission(player, Permission.PERMISSION_ADMIN_INTERACT_OTHER.toString(), | ||||
|                                 false | ||||
|                         )) { | ||||
|                     return true; | ||||
|                 } | ||||
|                 if (notifyPerms) { | ||||
| @@ -456,12 +457,12 @@ public class EventDispatcher { | ||||
|             } | ||||
|             case PLACE_MISC: { | ||||
|                 if (plot == null) { | ||||
|                     return player.hasPermission( | ||||
|                     return Permissions.hasPermission(player, | ||||
|                             Permission.PERMISSION_ADMIN_INTERACT_ROAD.toString(), notifyPerms | ||||
|                     ); | ||||
|                 } | ||||
|                 if (!plot.hasOwner()) { | ||||
|                     return player.hasPermission( | ||||
|                     return Permissions.hasPermission(player, | ||||
|                             Permission.PERMISSION_ADMIN_INTERACT_UNOWNED.toString(), notifyPerms | ||||
|                     ); | ||||
|                 } | ||||
| @@ -475,10 +476,10 @@ public class EventDispatcher { | ||||
|                         return true; | ||||
|                     } | ||||
|                 } | ||||
|                 if (player.hasPermission( | ||||
|                         Permission.PERMISSION_ADMIN_INTERACT_OTHER.toString(), | ||||
|                         false | ||||
|                 )) { | ||||
|                 if (Permissions | ||||
|                         .hasPermission(player, Permission.PERMISSION_ADMIN_INTERACT_OTHER.toString(), | ||||
|                                 false | ||||
|                         )) { | ||||
|                     return true; | ||||
|                 } | ||||
|                 if (notifyPerms) { | ||||
| @@ -492,12 +493,12 @@ public class EventDispatcher { | ||||
|             } | ||||
|             case PLACE_VEHICLE: | ||||
|                 if (plot == null) { | ||||
|                     return player.hasPermission( | ||||
|                     return Permissions.hasPermission(player, | ||||
|                             Permission.PERMISSION_ADMIN_INTERACT_ROAD.toString(), notifyPerms | ||||
|                     ); | ||||
|                 } | ||||
|                 if (!plot.hasOwner()) { | ||||
|                     return player.hasPermission( | ||||
|                     return Permissions.hasPermission(player, | ||||
|                             Permission.PERMISSION_ADMIN_INTERACT_UNOWNED.toString(), notifyPerms | ||||
|                     ); | ||||
|                 } | ||||
|   | ||||
| @@ -32,14 +32,14 @@ import org.checkerframework.checker.nullness.qual.NonNull; | ||||
|  * - Checking the PlotPlayer class directly will not take the above into account<br> | ||||
|  * | ||||
|  * @deprecated all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed | ||||
|  *         classes | ||||
|  * classes | ||||
|  */ | ||||
| @Deprecated(forRemoval = true, since = "6.9.3") | ||||
| public class Permissions { | ||||
|  | ||||
|     /** | ||||
|      * @deprecated all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed | ||||
|      *         classes. Use {@link PlotPlayer#hasPermission(String, boolean)} | ||||
|      * classes | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.9.3") | ||||
|     public static boolean hasPermission(PlotPlayer<?> player, Permission permission, boolean notify) { | ||||
| @@ -53,7 +53,7 @@ public class Permissions { | ||||
|      * @param permission Permission | ||||
|      * @return {@code true} if the owner has the given permission, else {@code false} | ||||
|      * @deprecated all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed | ||||
|      *         classes. Use {@link PermissionHolder#hasPermission(Permission)} | ||||
|      * classes | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.9.3") | ||||
|     public static boolean hasPermission(final @NonNull PermissionHolder caller, final @NonNull Permission permission) { | ||||
| @@ -68,7 +68,7 @@ public class Permissions { | ||||
|      * @param permission Permission | ||||
|      * @return {@code true} if the owner has the given permission, else {@code false} | ||||
|      * @deprecated all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed | ||||
|      *         classes. Use {@link PermissionHolder#hasPermission(String)} | ||||
|      * classes | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.9.3") | ||||
|     public static boolean hasPermission(final @NonNull PermissionHolder caller, final @NonNull String permission) { | ||||
| @@ -85,7 +85,7 @@ public class Permissions { | ||||
|      * @return {@code true} if the owner has the given permission, else {@code false} | ||||
|      * @since 6.0.10 | ||||
|      * @deprecated all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed | ||||
|      *         classes. Use {@link PermissionHolder#hasKeyedPermission(String, String)} | ||||
|      * classes | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.9.3") | ||||
|     public static boolean hasKeyedPermission( | ||||
| @@ -103,7 +103,7 @@ public class Permissions { | ||||
|      * @param notify     if to notify the permission holder | ||||
|      * @return if permission is had | ||||
|      * @deprecated all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed | ||||
|      *         classes. Use {@link PlotPlayer#hasPermission(String, boolean)} | ||||
|      * classes | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.9.3") | ||||
|     public static boolean hasPermission(PlotPlayer<?> player, String permission, boolean notify) { | ||||
| @@ -121,7 +121,7 @@ public class Permissions { | ||||
|  | ||||
|     /** | ||||
|      * @deprecated all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed | ||||
|      *         classes. Use {@link PlotPlayer#hasPermissionRange(Permission, int)} | ||||
|      * classes | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.9.3") | ||||
|     public static int hasPermissionRange(PlotPlayer<?> player, Permission Permission, int range) { | ||||
| @@ -138,7 +138,7 @@ public class Permissions { | ||||
|      * @param range  The range to check | ||||
|      * @return The highest permission they have within that range | ||||
|      * @deprecated all logic that may once have been in the class lives elsewhere. We also want to do away with statically-accessed | ||||
|      *         classes. Use {@link PlotPlayer#hasPermissionRange(String, int)} | ||||
|      * classes | ||||
|      */ | ||||
|     @Deprecated(forRemoval = true, since = "6.9.3") | ||||
|     public static int hasPermissionRange(PlotPlayer<?> player, String stub, int range) { | ||||
|   | ||||
| @@ -19,6 +19,7 @@ | ||||
| package com.plotsquared.core.util; | ||||
|  | ||||
| import com.plotsquared.core.location.Location; | ||||
| import com.plotsquared.core.plot.Plot; | ||||
| import com.sk89q.worldedit.math.BlockVector2; | ||||
| import com.sk89q.worldedit.math.BlockVector3; | ||||
| import com.sk89q.worldedit.regions.CuboidRegion; | ||||
|   | ||||
| @@ -31,6 +31,7 @@ import com.plotsquared.core.plot.Plot; | ||||
| import com.plotsquared.core.plot.PlotArea; | ||||
| import com.plotsquared.core.uuid.UUIDMapping; | ||||
| import org.checkerframework.checker.nullness.qual.NonNull; | ||||
| import org.checkerframework.checker.nullness.qual.Nullable; | ||||
|  | ||||
| import java.util.ArrayList; | ||||
| import java.util.Arrays; | ||||
|   | ||||
| @@ -55,3 +55,4 @@ public class AbstractDelegateOutputStream extends OutputStream { | ||||
|     } | ||||
|  | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -21,6 +21,7 @@ package com.plotsquared.core.util.query; | ||||
| import com.plotsquared.core.plot.Plot; | ||||
| import org.checkerframework.checker.nullness.qual.NonNull; | ||||
|  | ||||
| import java.util.Objects; | ||||
| import java.util.UUID; | ||||
|  | ||||
| class OwnersIncludeFilter implements PlotFilter { | ||||
|   | ||||
| @@ -83,3 +83,4 @@ public interface PlotSquaredTask extends Runnable { | ||||
|     } | ||||
|  | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -276,3 +276,4 @@ public class AbstractDBTest implements AbstractDB { | ||||
|     } | ||||
|  | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -64,12 +64,12 @@ subprojects { | ||||
|     } | ||||
|  | ||||
|     dependencies { | ||||
|         implementation(platform("com.intellectualsites.bom:bom-1.18.x:1.22")) | ||||
|         implementation(platform("com.intellectualsites.bom:bom-1.18.x:1.21")) | ||||
|     } | ||||
|  | ||||
|     dependencies { | ||||
|         // Tests | ||||
|         testImplementation("org.junit.jupiter:junit-jupiter:5.9.2") | ||||
|         testImplementation("org.junit.jupiter:junit-jupiter:5.9.1") | ||||
|     } | ||||
|  | ||||
|     plugins.withId("java") { | ||||
| @@ -90,9 +90,6 @@ subprojects { | ||||
|         java { | ||||
|             licenseHeaderFile(rootProject.file("HEADER.txt")) | ||||
|             target("**/*.java") | ||||
|             endWithNewline() | ||||
|             trimTrailingWhitespace() | ||||
|             removeUnusedImports() | ||||
|         } | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -21,7 +21,7 @@ http4j = "1.3" | ||||
| # Gradle plugins | ||||
| shadow = "7.1.2" | ||||
| grgit = "4.1.1" | ||||
| spotless = "6.13.0" | ||||
| spotless = "6.12.1" | ||||
| nexus = "1.1.0" | ||||
|  | ||||
| [libraries] | ||||
|   | ||||
| @@ -1,4 +0,0 @@ | ||||
| Javadocs generated for | ||||
| <a rel="noopener nofollow noreferrer" href="https://github.com/IntellectualSites/PlotSquared/" target="_blank"> PlotSquared</a> | | ||||
| <a rel="noopener nofollow noreferrer" href="https://intellectualsites.github.io/plotsquared-documentation/"> Documentation </a> | | ||||
| Visit us on our <a rel="noopener nofollow noreferrer" href="https://discord.gg/intellectualsites"> Discord server</a> :) | ||||
		Reference in New Issue
	
	Block a user