mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-10-31 09:33:43 +01:00 
			
		
		
		
	Compare commits
	
		
			66 Commits
		
	
	
		
			6.2.0
			...
			refactor/v
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 12463dbb1c | ||
| ![renovate[bot]](/assets/img/avatar_default.png)  | 6a5859ee0f | ||
|   | 59e0b4b67a | ||
|   | 5fc153d896 | ||
|   | a003836dbc | ||
|   | 42bf413528 | ||
|   | 827f46566c | ||
|   | 6f4d2f6d5a | ||
|   | 6073b96317 | ||
| ![renovate[bot]](/assets/img/avatar_default.png)  | 74a490f9f0 | ||
|   | 3a752db698 | ||
|   | 7cdde5a822 | ||
|   | 8b6e7b2f2b | ||
|   | 06f0b42a97 | ||
|   | 9a85080bf6 | ||
|   | d14d2caa2d | ||
|   | bcfe7c58dd | ||
|   | 289f0f3bfd | ||
|   | 6fc4005c72 | ||
|   | 8f7c2e4c02 | ||
|   | b43d08f4aa | ||
| ![renovate[bot]](/assets/img/avatar_default.png)  | 2c55c6a92e | ||
|   | 31f48cc7d1 | ||
|   | 4b77f1ab28 | ||
|   | 7cc38b5fa8 | ||
|   | 0c76d08b10 | ||
|   | 9c474570c8 | ||
|   | 7e1d56c849 | ||
|   | 07d0f124b4 | ||
|   | 8d6c621763 | ||
| ![renovate[bot]](/assets/img/avatar_default.png)  | cef7098014 | ||
| ![renovate[bot]](/assets/img/avatar_default.png)  | e1efa7266e | ||
| ![renovate[bot]](/assets/img/avatar_default.png)  | f363941719 | ||
|   | 25095f4546 | ||
|   | fd0c2050d8 | ||
|   | 07fdc94dd8 | ||
|   | b501a81e21 | ||
|   | eb334b3aac | ||
|   | a77a51b6f2 | ||
|   | 7d981bc610 | ||
|   | 3eb485e900 | ||
|   | 9f4af889f7 | ||
| ![renovate[bot]](/assets/img/avatar_default.png)  | 2559c889e2 | ||
| ![renovate[bot]](/assets/img/avatar_default.png)  | 2cf268b99c | ||
| ![renovate[bot]](/assets/img/avatar_default.png)  | e6fad8309c | ||
|   | 7551450cf9 | ||
|   | e042566bb7 | ||
|   | 1f26808c7b | ||
|   | a7026047d0 | ||
|   | af2613202d | ||
| ![renovate[bot]](/assets/img/avatar_default.png)  | 3da1e9255a | ||
| ![renovate[bot]](/assets/img/avatar_default.png)  | 9394906a79 | ||
| ![renovate[bot]](/assets/img/avatar_default.png)  | d881cb6084 | ||
| ![renovate[bot]](/assets/img/avatar_default.png)  | b9d43897af | ||
| ![renovate[bot]](/assets/img/avatar_default.png)  | 76b58485a9 | ||
|   | 7002df0bc7 | ||
|   | 958aac3cb1 | ||
|   | a93402e27b | ||
|   | 92f41f43c5 | ||
|   | 392ee9fa07 | ||
|   | 8859871e89 | ||
|   | 93d99630a9 | ||
|   | 47ae79e123 | ||
| ![renovate[bot]](/assets/img/avatar_default.png)  | f9ad00c2c8 | ||
| ![renovate[bot]](/assets/img/avatar_default.png)  | 566af259db | ||
|   | d9a6431078 | 
							
								
								
									
										2
									
								
								.github/stale.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/stale.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,4 +1,4 @@ | |||||||
| daysUntilStale: 60 | daysUntilStale: 30 | ||||||
| daysUntilClose: 7 | daysUntilClose: 7 | ||||||
| only: issues | only: issues | ||||||
| exemptLabels: | exemptLabels: | ||||||
|   | |||||||
							
								
								
									
										54
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										54
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,41 +1,41 @@ | |||||||
| name: "build" | name: build | ||||||
|  |  | ||||||
| on: [ "pull_request", "push" ] | on: [ pull_request, push ] | ||||||
|  |  | ||||||
| jobs: | jobs: | ||||||
|   build: |   build: | ||||||
|     runs-on: "ubuntu-20.04" |     runs-on: ubuntu-latest | ||||||
|     steps: |     steps: | ||||||
|       - name: "Checkout Repository" |       - name: Checkout Repository | ||||||
|         uses: "actions/checkout@v2.4.0" |         uses: actions/checkout@v2.4.0 | ||||||
|       - name: "Validate Gradle Wrapper" |       - name: Validate Gradle Wrapper" | ||||||
|         uses: "gradle/wrapper-validation-action@v1.0.4" |         uses: gradle/wrapper-validation-action@v1.0.4 | ||||||
|       - name: "Setup Java" |       - name: Setup Java | ||||||
|         uses: "actions/setup-java@v2.4.0" |         uses: actions/setup-java@v2.5.0 | ||||||
|         with: |         with: | ||||||
|           distribution: "temurin" |           distribution: temurin | ||||||
|           java-version: "17" |           java-version: 17 | ||||||
|       - name: "Clean Build" |       - name: Clean Build | ||||||
|         run: "./gradlew clean build" |         run: ./gradlew clean build | ||||||
|       - name: "Determine release status" |       - name: Determine release status | ||||||
|         if: "${{ runner.os == 'Linux' }}" |         if: ${{ runner.os == 'Linux' }} | ||||||
|         run: | |         run: | | ||||||
|           if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then |           if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then | ||||||
|             echo "STATUS=snapshot" >> $GITHUB_ENV |             echo "STATUS=snapshot" >> $GITHUB_ENV | ||||||
|           else |           else | ||||||
|             echo "STATUS=release" >> $GITHUB_ENV |             echo "STATUS=release" >> $GITHUB_ENV | ||||||
|           fi |           fi | ||||||
|       - name: "Publish Release" |       - name: Publish Release | ||||||
|         if: "${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6'}}" |         if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6'}} | ||||||
|         run: "./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository" |         run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository | ||||||
|         env: |         env: | ||||||
|           ORG_GRADLE_PROJECT_sonatypeUsername: "${{ secrets.SONATYPE_USERNAME }}" |           ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} | ||||||
|           ORG_GRADLE_PROJECT_sonatypePassword: "${{ secrets.SONATYPE_PASSWORD }}" |           ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} | ||||||
|           ORG_GRADLE_PROJECT_signingKey: "${{ secrets.SIGNING_KEY }}" |           ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }} | ||||||
|           ORG_GRADLE_PROJECT_signingPassword: "${{ secrets.SIGNING_PASSWORD }}" |           ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }} | ||||||
|       - name: "Publish Snapshot" |       - name: Publish Snapshot | ||||||
|         if: "${{ runner.os == 'Linux' && env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6' }}" |         if: ${{ runner.os == 'Linux' && env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6' }} | ||||||
|         run: "./gradlew publishToSonatype" |         run: ./gradlew publishToSonatype | ||||||
|         env: |         env: | ||||||
|           ORG_GRADLE_PROJECT_sonatypeUsername: "${{ secrets.SONATYPE_USERNAME }}" |           ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} | ||||||
|           ORG_GRADLE_PROJECT_sonatypePassword: "${{ secrets.SONATYPE_PASSWORD }}" |           ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} | ||||||
|   | |||||||
							
								
								
									
										20
									
								
								.github/workflows/rebase.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								.github/workflows/rebase.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | |||||||
|  | name: Rebase Pull Request | ||||||
|  | on: | ||||||
|  |   issue_comment: | ||||||
|  |     types: [created] | ||||||
|  |  | ||||||
|  | jobs: | ||||||
|  |   rebase: | ||||||
|  |     name: Rebase | ||||||
|  |     if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') && github.event.comment.author_association == 'MEMBER' | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     steps: | ||||||
|  |       - name: Checkout Repository | ||||||
|  |         uses: actions/checkout@v2.4.0 | ||||||
|  |         with: | ||||||
|  |           token: ${{ secrets.REBASE_TOKEN }} | ||||||
|  |           fetch-depth: 0 | ||||||
|  |       - name: Automatic Rebase | ||||||
|  |         uses: cirrus-actions/rebase@1.5 | ||||||
|  |         env: | ||||||
|  |           GITHUB_TOKEN: ${{ secrets.REBASE_TOKEN }} | ||||||
							
								
								
									
										10
									
								
								.github/workflows/release-drafter.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								.github/workflows/release-drafter.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,14 +1,18 @@ | |||||||
| name: "draft release" | name: draft release | ||||||
|  |  | ||||||
| on: | on: | ||||||
|   push: |   push: | ||||||
|     branches: |     branches: | ||||||
|       - v6 |       - v6 | ||||||
|  |   pull_request: | ||||||
|  |     types: [ opened, reopened, synchronize ] | ||||||
|  |   pull_request_target: | ||||||
|  |     types: [ opened, reopened, synchronize ] | ||||||
|  |  | ||||||
| jobs: | jobs: | ||||||
|   update_release_draft: |   update_release_draft: | ||||||
|     runs-on: "ubuntu-latest" |     runs-on: ubuntu-latest | ||||||
|     steps: |     steps: | ||||||
|       - uses: "release-drafter/release-drafter@v5.15.0" |       - uses: release-drafter/release-drafter@v5.17.6 | ||||||
|         env: |         env: | ||||||
|           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||
|   | |||||||
							
								
								
									
										4
									
								
								.lift.toml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								.lift.toml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | |||||||
|  | jdkVersion = "17" | ||||||
|  | build = "gradle clean build -x test" | ||||||
|  | tools = ["findsecbugs", "ErrorProne", "Semgrep", "Detekt", "Infer"] | ||||||
|  | ignoreRules = ["CatchAndPrintStackTrace", "ReferenceEquality", "FallThrough", "FutureReturnValueIgnored", "MixedMutabilityReturnType", "EmptyCatch", "MissingCasesInEnumSwitch", "OperatorPrecedence", "StaticAssignmentInConstructor", "ReferenceEquality", "EqualsHashCode", "EqualsGetClass", "TypeParameterUnusedInFormals", "StringSplitter", "InlineMeSuggester", "NULL_DEREFERENCE"] | ||||||
							
								
								
									
										13
									
								
								.whitesource
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								.whitesource
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | |||||||
|  | { | ||||||
|  |   "scanSettings": { | ||||||
|  |     "baseBranches": ["v6"] | ||||||
|  |   }, | ||||||
|  |   "checkRunSettings": { | ||||||
|  |     "vulnerableCheckRunConclusionLevel": "success", | ||||||
|  |     "displayMode": "diff" | ||||||
|  |   }, | ||||||
|  |   "issueSettings": { | ||||||
|  |     "minSeverityLevel": "LOW" | ||||||
|  |   }, | ||||||
|  |   "enableRenovate": "true" | ||||||
|  | } | ||||||
| @@ -40,7 +40,6 @@ dependencies { | |||||||
|     compileOnly(libs.placeholderapi) |     compileOnly(libs.placeholderapi) | ||||||
|     compileOnly(libs.luckperms) |     compileOnly(libs.luckperms) | ||||||
|     compileOnly(libs.essentialsx) |     compileOnly(libs.essentialsx) | ||||||
|     compileOnly(libs.hyperverse) { isTransitive = false } |  | ||||||
|     compileOnly(libs.mvdwapi) { isTransitive = false } |     compileOnly(libs.mvdwapi) { isTransitive = false } | ||||||
|  |  | ||||||
|     // Other libraries |     // Other libraries | ||||||
| @@ -75,7 +74,8 @@ tasks.named<ShadowJar>("shadowJar") { | |||||||
|     relocate("org.khelekore.prtree", "com.plotsquared.prtree") |     relocate("org.khelekore.prtree", "com.plotsquared.prtree") | ||||||
|     relocate("com.google.inject", "com.plotsquared.google") |     relocate("com.google.inject", "com.plotsquared.google") | ||||||
|     relocate("org.aopalliance", "com.plotsquared.core.aopalliance") |     relocate("org.aopalliance", "com.plotsquared.core.aopalliance") | ||||||
|     relocate("com.intellectualsites.services", "com.plotsquared.core.services") |     relocate("cloud.commandframework.services", "com.plotsquared.core.services") | ||||||
|  |     relocate("io.leangen.geantyref", "com.plotsquared.core.geantyref") | ||||||
|     relocate("com.intellectualsites.arkitektonika", "com.plotsquared.core.arkitektonika") |     relocate("com.intellectualsites.arkitektonika", "com.plotsquared.core.arkitektonika") | ||||||
|     relocate("com.intellectualsites.http", "com.plotsquared.core.http") |     relocate("com.intellectualsites.http", "com.plotsquared.core.http") | ||||||
|     relocate("com.intellectualsites.paster", "com.plotsquared.core.paster") |     relocate("com.intellectualsites.paster", "com.plotsquared.core.paster") | ||||||
| @@ -83,6 +83,7 @@ tasks.named<ShadowJar>("shadowJar") { | |||||||
|     relocate("org.jetbrains", "com.plotsquared.core.annotations") |     relocate("org.jetbrains", "com.plotsquared.core.annotations") | ||||||
|     relocate("org.intellij.lang", "com.plotsquared.core.intellij.annotations") |     relocate("org.intellij.lang", "com.plotsquared.core.intellij.annotations") | ||||||
|     relocate("javax.annotation", "com.plotsquared.core.annotation") |     relocate("javax.annotation", "com.plotsquared.core.annotation") | ||||||
|  |     relocate("com.google.code.findbugs", "com.plotsquared.core.findbugs") | ||||||
|     relocate("javax.inject", "com.plotsquared.core.annotation.inject") |     relocate("javax.inject", "com.plotsquared.core.annotation.inject") | ||||||
|  |  | ||||||
|     // Get rid of all the libs which are 100% unused. |     // Get rid of all the libs which are 100% unused. | ||||||
| @@ -98,7 +99,6 @@ tasks { | |||||||
|         opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-core/7.2.7/") |         opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-core/7.2.7/") | ||||||
|         opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-bukkit/7.2.7/") |         opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-bukkit/7.2.7/") | ||||||
|         opt.links("https://jd.adventure.kyori.net/api/4.9.3/") |         opt.links("https://jd.adventure.kyori.net/api/4.9.3/") | ||||||
|         opt.links("https://notmyfault.github.io/MiniMessage-Javadocs/") // Temporary hosting for 4.2.0-SNAPSHOT, exchange when we jump to 4.10.0 |  | ||||||
|         opt.links("https://google.github.io/guice/api-docs/5.0.1/javadoc/") |         opt.links("https://google.github.io/guice/api-docs/5.0.1/javadoc/") | ||||||
|         opt.links("https://checkerframework.org/api/") |         opt.links("https://checkerframework.org/api/") | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -147,6 +147,8 @@ import java.io.File; | |||||||
| import java.lang.reflect.Method; | import java.lang.reflect.Method; | ||||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||||
| import java.util.Arrays; | import java.util.Arrays; | ||||||
|  | import java.util.Collections; | ||||||
|  | import java.util.Comparator; | ||||||
| import java.util.HashMap; | import java.util.HashMap; | ||||||
| import java.util.HashSet; | import java.util.HashSet; | ||||||
| import java.util.Iterator; | import java.util.Iterator; | ||||||
| @@ -216,6 +218,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl | |||||||
|     private PlatformWorldManager<World> worldManager; |     private PlatformWorldManager<World> worldManager; | ||||||
|     private Locale serverLocale; |     private Locale serverLocale; | ||||||
|  |  | ||||||
|  |     @SuppressWarnings("StringSplitter") | ||||||
|     @Override |     @Override | ||||||
|     public int @NonNull [] serverVersion() { |     public int @NonNull [] serverVersion() { | ||||||
|         if (this.version == null) { |         if (this.version == null) { | ||||||
| @@ -266,7 +269,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl | |||||||
|                     faweHook = true; |                     faweHook = true; | ||||||
|                 } catch (Exception ignored) { |                 } catch (Exception ignored) { | ||||||
|                     LOGGER.error("Incompatible version of FAWE to enable hook, please upgrade: https://ci.athion" + |                     LOGGER.error("Incompatible version of FAWE to enable hook, please upgrade: https://ci.athion" + | ||||||
|                             ".net/job/FastAsyncWorldEdit-1.17/"); |                             ".net/job/FastAsyncWorldEdit/"); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| @@ -321,8 +324,6 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl | |||||||
|         // Comments |         // Comments | ||||||
|         CommentManager.registerDefaultInboxes(); |         CommentManager.registerDefaultInboxes(); | ||||||
|  |  | ||||||
|         plotSquared.startExpiryTasks(); |  | ||||||
|  |  | ||||||
|         // Do stuff that was previously done in PlotSquared |         // Do stuff that was previously done in PlotSquared | ||||||
|         // Kill entities |         // Kill entities | ||||||
|         if (Settings.Enabled_Components.KILL_ROAD_MOBS || Settings.Enabled_Components.KILL_ROAD_VEHICLES) { |         if (Settings.Enabled_Components.KILL_ROAD_MOBS || Settings.Enabled_Components.KILL_ROAD_VEHICLES) { | ||||||
| @@ -419,6 +420,8 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl | |||||||
|             }, TaskTime.ticks(1L)); |             }, TaskTime.ticks(1L)); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  |         plotSquared.startExpiryTasks(); | ||||||
|  |  | ||||||
|         // Once the server has loaded force updating all generators known to P2 |         // Once the server has loaded force updating all generators known to P2 | ||||||
|         TaskManager.runTaskLater(() -> PlotSquared.platform().setupUtils().updateGenerators(true), TaskTime.ticks(1L)); |         TaskManager.runTaskLater(() -> PlotSquared.platform().setupUtils().updateGenerators(true), TaskTime.ticks(1L)); | ||||||
|  |  | ||||||
| @@ -968,7 +971,6 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl | |||||||
|                                                 } |                                                 } | ||||||
|                                                 iterator.remove(); |                                                 iterator.remove(); | ||||||
|                                                 entity.remove(); |                                                 entity.remove(); | ||||||
|                                                 continue; |  | ||||||
|                                             } |                                             } | ||||||
|                                         } |                                         } | ||||||
|                                     } else { |                                     } else { | ||||||
| @@ -980,7 +982,6 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl | |||||||
|                                             } |                                             } | ||||||
|                                             iterator.remove(); |                                             iterator.remove(); | ||||||
|                                             entity.remove(); |                                             entity.remove(); | ||||||
|                                             continue; |  | ||||||
|                                         } |                                         } | ||||||
|                                     } |                                     } | ||||||
|                                 } |                                 } | ||||||
| @@ -1141,8 +1142,10 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl | |||||||
|     @Override |     @Override | ||||||
|     public @NonNull String pluginsFormatted() { |     public @NonNull String pluginsFormatted() { | ||||||
|         StringBuilder msg = new StringBuilder(); |         StringBuilder msg = new StringBuilder(); | ||||||
|         Plugin[] plugins = Bukkit.getServer().getPluginManager().getPlugins(); |         List<Plugin> plugins = new ArrayList<>(); | ||||||
|         msg.append("Plugins (").append(plugins.length).append("): \n"); |         Collections.addAll(plugins, Bukkit.getServer().getPluginManager().getPlugins()); | ||||||
|  |         plugins.sort(Comparator.comparing(Plugin::getName)); | ||||||
|  |         msg.append("Plugins (").append(plugins.size()).append("): \n"); | ||||||
|         for (Plugin p : plugins) { |         for (Plugin p : plugins) { | ||||||
|             msg.append(" - ").append(p.getName()).append(":").append("\n") |             msg.append(" - ").append(p.getName()).append(":").append("\n") | ||||||
|                     .append("  • Version: ").append(p.getDescription().getVersion()).append("\n") |                     .append("  • Version: ").append(p.getDescription().getVersion()).append("\n") | ||||||
| @@ -1156,6 +1159,21 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl | |||||||
|         return msg.toString(); |         return msg.toString(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     @SuppressWarnings("ConstantConditions") | ||||||
|  |     public @NonNull String worldEditImplementations() { | ||||||
|  |         StringBuilder msg = new StringBuilder(); | ||||||
|  |         if (Bukkit.getPluginManager().getPlugin("FastAsyncWorldEdit") != null) { | ||||||
|  |             msg.append("FastAsyncWorldEdit: ").append(Bukkit.getPluginManager().getPlugin("FastAsyncWorldEdit").getDescription().getVersion()); | ||||||
|  |         } else if (Bukkit.getPluginManager().getPlugin("AsyncWorldEdit") != null) { | ||||||
|  |             msg.append("AsyncWorldEdit: ").append(Bukkit.getPluginManager().getPlugin("AsyncWorldEdit").getDescription().getVersion()).append("\n"); | ||||||
|  |             msg.append("WorldEdit: ").append(Bukkit.getPluginManager().getPlugin("WorldEdit").getDescription().getVersion()); | ||||||
|  |         } else { | ||||||
|  |             msg.append("WorldEdit: ").append(Bukkit.getPluginManager().getPlugin("WorldEdit").getDescription().getVersion()); | ||||||
|  |         } | ||||||
|  |         return msg.toString(); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public com.plotsquared.core.location.@NonNull World<?> getPlatformWorld(final @NonNull String worldName) { |     public com.plotsquared.core.location.@NonNull World<?> getPlatformWorld(final @NonNull String worldName) { | ||||||
|         return BukkitWorld.of(worldName); |         return BukkitWorld.of(worldName); | ||||||
| @@ -1204,7 +1222,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl | |||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     @NonNull |     @NonNull | ||||||
|     @SuppressWarnings("ALL") |     @SuppressWarnings("unchecked") | ||||||
|     public PlayerManager<? extends PlotPlayer<Player>, ? extends Player> playerManager() { |     public PlayerManager<? extends PlotPlayer<Player>, ? extends Player> playerManager() { | ||||||
|         return (PlayerManager<BukkitPlayer, Player>) injector().getInstance(PlayerManager.class); |         return (PlayerManager<BukkitPlayer, Player>) injector().getInstance(PlayerManager.class); | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -461,6 +461,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper { | |||||||
|         this.tamed.tamed = tamed.isTamed(); |         this.tamed.tamed = tamed.isTamed(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @SuppressWarnings("deprecation") // Paper deprecation | ||||||
|     @Override |     @Override | ||||||
|     public Entity spawn(World world, int xOffset, int zOffset) { |     public Entity spawn(World world, int xOffset, int zOffset) { | ||||||
|         Location location = new Location(world, this.getX() + xOffset, this.getY(), this.z + zOffset); |         Location location = new Location(world, this.getX() + xOffset, this.getY(), this.z + zOffset); | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -29,7 +29,6 @@ import com.google.inject.AbstractModule; | |||||||
| import com.google.inject.Provides; | import com.google.inject.Provides; | ||||||
| import com.google.inject.Singleton; | import com.google.inject.Singleton; | ||||||
| import com.plotsquared.bukkit.managers.BukkitWorldManager; | import com.plotsquared.bukkit.managers.BukkitWorldManager; | ||||||
| import com.plotsquared.bukkit.managers.HyperverseWorldManager; |  | ||||||
| import com.plotsquared.bukkit.managers.MultiverseWorldManager; | import com.plotsquared.bukkit.managers.MultiverseWorldManager; | ||||||
| import com.plotsquared.core.util.PlatformWorldManager; | import com.plotsquared.core.util.PlatformWorldManager; | ||||||
| import org.bukkit.Bukkit; | import org.bukkit.Bukkit; | ||||||
| @@ -37,12 +36,11 @@ import org.bukkit.World; | |||||||
|  |  | ||||||
| public class WorldManagerModule extends AbstractModule { | public class WorldManagerModule extends AbstractModule { | ||||||
|  |  | ||||||
|  |     @SuppressWarnings("removal") // Internal use only | ||||||
|     @Provides |     @Provides | ||||||
|     @Singleton |     @Singleton | ||||||
|     PlatformWorldManager<World> provideWorldManager() { |     PlatformWorldManager<World> provideWorldManager() { | ||||||
|         if (Bukkit.getPluginManager().getPlugin("Hyperverse") != null) { |         if (Bukkit.getPluginManager().getPlugin("Multiverse-Core") != null) { | ||||||
|             return new HyperverseWorldManager(); |  | ||||||
|         } else if (Bukkit.getPluginManager().getPlugin("Multiverse-Core") != null) { |  | ||||||
|             return new MultiverseWorldManager(); |             return new MultiverseWorldManager(); | ||||||
|         } else { |         } else { | ||||||
|             return new BukkitWorldManager(); |             return new BukkitWorldManager(); | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -283,15 +283,15 @@ public class BlockEventListener implements Listener { | |||||||
|                 event.setCancelled(true); |                 event.setCancelled(true); | ||||||
|                 pp.sendMessage( |                 pp.sendMessage( | ||||||
|                         TranslatableCaption.of("height.height_limit"), |                         TranslatableCaption.of("height.height_limit"), | ||||||
|                         Template.template("minHeight", String.valueOf(area.getMinBuildHeight())), |                         Template.of("minHeight", String.valueOf(area.getMinBuildHeight())), | ||||||
|                         Template.template("maxHeight", String.valueOf(area.getMaxBuildHeight())) |                         Template.of("maxHeight", String.valueOf(area.getMaxBuildHeight())) | ||||||
|                 ); |                 ); | ||||||
|             } |             } | ||||||
|             if (!plot.hasOwner()) { |             if (!plot.hasOwner()) { | ||||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) { |                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) { | ||||||
|                     pp.sendMessage( |                     pp.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission_event"), |                             TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                             Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) |                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) | ||||||
|                     ); |                     ); | ||||||
|                     event.setCancelled(true); |                     event.setCancelled(true); | ||||||
|                     return; |                     return; | ||||||
| @@ -308,7 +308,7 @@ public class BlockEventListener implements Listener { | |||||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { |                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||||
|                     pp.sendMessage( |                     pp.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission_event"), |                             TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                             Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER)) |                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER)) | ||||||
|                     ); |                     ); | ||||||
|                     event.setCancelled(true); |                     event.setCancelled(true); | ||||||
|                     plot.debug(player.getName() + " could not place " + event.getBlock().getType() |                     plot.debug(player.getName() + " could not place " + event.getBlock().getType() | ||||||
| @@ -335,7 +335,7 @@ public class BlockEventListener implements Listener { | |||||||
|         } else if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) { |         } else if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) { | ||||||
|             pp.sendMessage( |             pp.sendMessage( | ||||||
|                     TranslatableCaption.of("permission.no_permission_event"), |                     TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                     Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD)) |                     Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD)) | ||||||
|             ); |             ); | ||||||
|             event.setCancelled(true); |             event.setCancelled(true); | ||||||
|         } |         } | ||||||
| @@ -357,7 +357,7 @@ public class BlockEventListener implements Listener { | |||||||
|                         .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL)) { |                         .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL)) { | ||||||
|                     plotPlayer.sendMessage( |                     plotPlayer.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission_event"), |                             TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                             Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL)) |                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL)) | ||||||
|                     ); |                     ); | ||||||
|                     event.setCancelled(true); |                     event.setCancelled(true); | ||||||
|                     return; |                     return; | ||||||
| @@ -368,8 +368,8 @@ public class BlockEventListener implements Listener { | |||||||
|                 event.setCancelled(true); |                 event.setCancelled(true); | ||||||
|                 plotPlayer.sendMessage( |                 plotPlayer.sendMessage( | ||||||
|                         TranslatableCaption.of("height.height_limit"), |                         TranslatableCaption.of("height.height_limit"), | ||||||
|                         Template.template("minHeight", String.valueOf(area.getMinBuildHeight())), |                         Template.of("minHeight", String.valueOf(area.getMinBuildHeight())), | ||||||
|                         Template.template("maxHeight", String.valueOf(area.getMaxBuildHeight())) |                         Template.of("maxHeight", String.valueOf(area.getMaxBuildHeight())) | ||||||
|                 ); |                 ); | ||||||
|             } |             } | ||||||
|             if (!plot.hasOwner()) { |             if (!plot.hasOwner()) { | ||||||
| @@ -394,7 +394,7 @@ public class BlockEventListener implements Listener { | |||||||
|                 } |                 } | ||||||
|                 plotPlayer.sendMessage( |                 plotPlayer.sendMessage( | ||||||
|                         TranslatableCaption.of("permission.no_permission_event"), |                         TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                         Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER)) |                         Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER)) | ||||||
|                 ); |                 ); | ||||||
|                 event.setCancelled(true); |                 event.setCancelled(true); | ||||||
|             } else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { |             } else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { | ||||||
| @@ -420,7 +420,7 @@ public class BlockEventListener implements Listener { | |||||||
|         } |         } | ||||||
|         pp.sendMessage( |         pp.sendMessage( | ||||||
|                 TranslatableCaption.of("permission.no_permission_event"), |                 TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                 Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_ROAD)) |                 Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_ROAD)) | ||||||
|         ); |         ); | ||||||
|         event.setCancelled(true); |         event.setCancelled(true); | ||||||
|     } |     } | ||||||
| @@ -1095,7 +1095,7 @@ public class BlockEventListener implements Listener { | |||||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) { |                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) { | ||||||
|                     pp.sendMessage( |                     pp.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission_event"), |                             TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                             Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD)) |                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD)) | ||||||
|                     ); |                     ); | ||||||
|                     event.setCancelled(true); |                     event.setCancelled(true); | ||||||
|                 } |                 } | ||||||
| @@ -1103,7 +1103,7 @@ public class BlockEventListener implements Listener { | |||||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) { |                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) { | ||||||
|                     pp.sendMessage( |                     pp.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission_event"), |                             TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                             Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) |                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) | ||||||
|                     ); |                     ); | ||||||
|                     event.setCancelled(true); |                     event.setCancelled(true); | ||||||
|                 } |                 } | ||||||
| @@ -1111,7 +1111,7 @@ public class BlockEventListener implements Listener { | |||||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { |                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||||
|                     pp.sendMessage( |                     pp.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission_event"), |                             TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                             Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER)) |                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER)) | ||||||
|                     ); |                     ); | ||||||
|                     event.setCancelled(true); |                     event.setCancelled(true); | ||||||
|                 } |                 } | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -108,41 +108,11 @@ public class ChunkListener implements Listener { | |||||||
|                         this.isTrueForNotSave = false; |                         this.isTrueForNotSave = false; | ||||||
|                     } else { |                     } else { | ||||||
|                         this.mustSave = classChunk.getField("mustNotSave"); |                         this.mustSave = classChunk.getField("mustNotSave"); | ||||||
|                         /* |  | ||||||
|                         this.worldServer = classCraftWorld.getField("world"); |  | ||||||
|                         this.methodGetChunkProvider = getRefClass("{nms}.WorldServer").getMethod("getChunkProvider"); |  | ||||||
|                         this.playerChunkMap = getRefClass("{nms}.ChunkProviderServer").getField("playerChunkMap"); |  | ||||||
|                         RefClass classPlayerChunkMap = getRefClass("{nms}.PlayerChunkMap"); |  | ||||||
|                         if (PaperLib.isPaper() && version == 16) { |  | ||||||
|                             this.updatingChunks = classPlayerChunkMap.getField("updatingChunks"); |  | ||||||
|                             this.methodGetVisibleMap = getRefClass("com.destroystokyo.paper.util.map.QueuedChangesMapLong2Object").getMethod( |  | ||||||
|                                     "getVisibleMap"); |  | ||||||
|                         } else { |  | ||||||
|                             this.visibleChunks = classPlayerChunkMap.getField("visibleChunks"); |  | ||||||
|                         } |  | ||||||
|                         this.methodGetFullChunk = getRefClass("{nms}.PlayerChunk").getMethod("getFullChunk"); |  | ||||||
|                         this.methodGetBukkitChunk = getRefClass("{nms}.Chunk").getMethod("getBukkitChunk"); |  | ||||||
|                         */ |  | ||||||
|                     } |                     } | ||||||
|                 } else if (version == 17) { |                 } else { | ||||||
|                     RefClass classChunk = getRefClass("net.minecraft.world.level.chunk.Chunk"); |                     RefClass classChunk = getRefClass("net.minecraft.world.level.chunk.Chunk"); | ||||||
|                     this.mustSave = classChunk.getField("mustNotSave"); |                     this.mustSave = classChunk.getField("mustNotSave"); | ||||||
|                     /* |  | ||||||
|                     this.worldServer = classCraftWorld.getField("world"); |  | ||||||
|                     this.methodGetChunkProvider = getRefClass("net.minecraft.server.level.WorldServer").getMethod( |  | ||||||
|                             "getChunkProvider"); |  | ||||||
|                     this.playerChunkMap = getRefClass("net.minecraft.server.level.ChunkProviderServer").getField("a"); |  | ||||||
|                     RefClass classPlayerChunkMap = getRefClass("net.minecraft.server.level.PlayerChunkMap"); |  | ||||||
|                     if (PaperLib.isPaper()) { |  | ||||||
|                         this.updatingChunks = classPlayerChunkMap.getField("updatingChunks"); |  | ||||||
|                         this.methodGetVisibleMap = getRefClass("com.destroystokyo.paper.util.map.QueuedChangesMapLong2Object").getMethod( |  | ||||||
|                                 "getVisibleMap"); |  | ||||||
|                     } else { |  | ||||||
|                         this.visibleChunks = classPlayerChunkMap.getField("l"); |  | ||||||
|                     } |  | ||||||
|                     this.methodGetFullChunk = getRefClass("net.minecraft.server.level.PlayerChunk").getMethod("getFullChunk"); |  | ||||||
|                     this.methodGetBukkitChunk = getRefClass("net.minecraft.world.level.chunk.Chunk").getMethod("getBukkitChunk"); |  | ||||||
|                      */ |  | ||||||
|                 } |                 } | ||||||
|             } catch (NoSuchFieldException e) { |             } catch (NoSuchFieldException e) { | ||||||
|                 e.printStackTrace(); |                 e.printStackTrace(); | ||||||
| @@ -182,32 +152,7 @@ public class ChunkListener implements Listener { | |||||||
|                             } |                             } | ||||||
|                             toUnload.add(chunk); |                             toUnload.add(chunk); | ||||||
|                         } |                         } | ||||||
|                     }/* else { |                     } | ||||||
|                         Object worldServer = this.worldServer.of(craftWorld).get(); |  | ||||||
|                         Object chunkProviderServer = methodGetChunkProvider.of(worldServer).call(); |  | ||||||
|                         Object playerChunkMap = this.playerChunkMap.of(chunkProviderServer).get(); |  | ||||||
|                         Long2ObjectLinkedOpenHashMap<?> chunks; |  | ||||||
|                         if (PaperLib.isPaper() && version > 15) { |  | ||||||
|                             Object updatingChunks = this.updatingChunks.of(playerChunkMap).get(); |  | ||||||
|                             chunks = (Long2ObjectLinkedOpenHashMap<?>) this.methodGetVisibleMap.of(updatingChunks).call(); |  | ||||||
|                         } else { |  | ||||||
|                             chunks = (Long2ObjectLinkedOpenHashMap<?>) this.visibleChunks.of(playerChunkMap).get(); |  | ||||||
|                         } |  | ||||||
|                         for (Object playerChunk : chunks.values()) { |  | ||||||
|                             Object nmsChunk = this.methodGetFullChunk.of(playerChunk).call(); |  | ||||||
|                             if (nmsChunk == null) { |  | ||||||
|                                 continue; |  | ||||||
|                             } |  | ||||||
|                             Chunk chunk = (Chunk) this.methodGetBukkitChunk.of(nmsChunk).call(); |  | ||||||
|                             int x = chunk.getX(); |  | ||||||
|                             int z = chunk.getZ(); |  | ||||||
|                             if (!shouldSave(worldName, x, z)) { |  | ||||||
|                                 unloadChunk(worldName, chunk, false); |  | ||||||
|                                 continue; |  | ||||||
|                             } |  | ||||||
|                             toUnload.add(chunk); |  | ||||||
|                         } |  | ||||||
|                     }*/ |  | ||||||
|                 } |                 } | ||||||
|                 if (toUnload.isEmpty()) { |                 if (toUnload.isEmpty()) { | ||||||
|                     return; |                     return; | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -48,6 +48,7 @@ import com.plotsquared.core.util.Permissions; | |||||||
| import com.sk89q.worldedit.bukkit.BukkitAdapter; | import com.sk89q.worldedit.bukkit.BukkitAdapter; | ||||||
| import com.sk89q.worldedit.world.block.BlockType; | import com.sk89q.worldedit.world.block.BlockType; | ||||||
| import org.bukkit.Material; | import org.bukkit.Material; | ||||||
|  | import org.bukkit.Particle; | ||||||
| import org.bukkit.World; | import org.bukkit.World; | ||||||
| import org.bukkit.block.Block; | import org.bukkit.block.Block; | ||||||
| import org.bukkit.entity.Ageable; | import org.bukkit.entity.Ageable; | ||||||
| @@ -323,6 +324,10 @@ public class EntityEventListener implements Listener { | |||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         event.setCancelled(true); |         event.setCancelled(true); | ||||||
|  |         //Spawn Explosion Particles when enabled in settings | ||||||
|  |         if (Settings.General.ALWAYS_SHOW_EXPLOSIONS) { | ||||||
|  |             event.getLocation().getWorld().spawnParticle(Particle.EXPLOSION_HUGE, event.getLocation(), 0); | ||||||
|  |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) |     @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) | ||||||
| @@ -371,14 +376,14 @@ public class EntityEventListener implements Listener { | |||||||
|             if (shooter instanceof Player) { |             if (shooter instanceof Player) { | ||||||
|                 PlotPlayer<?> pp = BukkitUtil.adapt((Player) shooter); |                 PlotPlayer<?> pp = BukkitUtil.adapt((Player) shooter); | ||||||
|                 if (plot == null) { |                 if (plot == null) { | ||||||
|                     if (!Permissions.hasPermission(pp, Permission.PERMISSION_PROJECTILE_UNOWNED)) { |                     if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) { | ||||||
|                         entity.remove(); |                         entity.remove(); | ||||||
|                         event.setCancelled(true); |                         event.setCancelled(true); | ||||||
|                     } |                     } | ||||||
|                     return; |                     return; | ||||||
|                 } |                 } | ||||||
|                 if (plot.isAdded(pp.getUUID()) || Permissions |                 if (plot.isAdded(pp.getUUID()) || Permissions | ||||||
|                         .hasPermission(pp, Permission.PERMISSION_PROJECTILE_OTHER)) { |                         .hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) { | ||||||
|                     return; |                     return; | ||||||
|                 } |                 } | ||||||
|                 entity.remove(); |                 entity.remove(); | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -60,7 +60,7 @@ import java.util.List; | |||||||
|  |  | ||||||
| public class EntitySpawnListener implements Listener { | public class EntitySpawnListener implements Listener { | ||||||
|  |  | ||||||
|     private final static String KEY = "P2"; |     private static final String KEY = "P2"; | ||||||
|     private static boolean ignoreTP = false; |     private static boolean ignoreTP = false; | ||||||
|     private static boolean hasPlotArea = false; |     private static boolean hasPlotArea = false; | ||||||
|     private static String areaName = null; |     private static String areaName = null; | ||||||
| @@ -75,8 +75,7 @@ public class EntitySpawnListener implements Listener { | |||||||
|  |  | ||||||
|     public static void testCreate(final Entity entity) { |     public static void testCreate(final Entity entity) { | ||||||
|         @NonNull World world = entity.getWorld(); |         @NonNull World world = entity.getWorld(); | ||||||
|         if (areaName == world.getName()) { |         if (!world.getName().equals(areaName)) { | ||||||
|         } else { |  | ||||||
|             areaName = world.getName(); |             areaName = world.getName(); | ||||||
|             hasPlotArea = PlotSquared.get().getPlotAreaManager().hasPlotArea(areaName); |             hasPlotArea = PlotSquared.get().getPlotAreaManager().hasPlotArea(areaName); | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -39,11 +39,13 @@ import com.plotsquared.core.command.MainCommand; | |||||||
| import com.plotsquared.core.configuration.Settings; | import com.plotsquared.core.configuration.Settings; | ||||||
| import com.plotsquared.core.configuration.caption.TranslatableCaption; | import com.plotsquared.core.configuration.caption.TranslatableCaption; | ||||||
| import com.plotsquared.core.location.Location; | import com.plotsquared.core.location.Location; | ||||||
|  | import com.plotsquared.core.permissions.Permission; | ||||||
| import com.plotsquared.core.player.PlotPlayer; | import com.plotsquared.core.player.PlotPlayer; | ||||||
| import com.plotsquared.core.plot.Plot; | import com.plotsquared.core.plot.Plot; | ||||||
| import com.plotsquared.core.plot.PlotArea; | import com.plotsquared.core.plot.PlotArea; | ||||||
| import com.plotsquared.core.plot.flag.implementations.DoneFlag; | import com.plotsquared.core.plot.flag.implementations.DoneFlag; | ||||||
| import com.plotsquared.core.plot.world.PlotAreaManager; | import com.plotsquared.core.plot.world.PlotAreaManager; | ||||||
|  | import com.plotsquared.core.util.Permissions; | ||||||
| import net.kyori.adventure.text.minimessage.Template; | import net.kyori.adventure.text.minimessage.Template; | ||||||
| import org.bukkit.Chunk; | import org.bukkit.Chunk; | ||||||
| import org.bukkit.block.Block; | import org.bukkit.block.Block; | ||||||
| @@ -53,7 +55,6 @@ import org.bukkit.entity.EntityType; | |||||||
| import org.bukkit.entity.Player; | import org.bukkit.entity.Player; | ||||||
| import org.bukkit.entity.Projectile; | import org.bukkit.entity.Projectile; | ||||||
| import org.bukkit.entity.Slime; | import org.bukkit.entity.Slime; | ||||||
| import org.bukkit.entity.ThrownPotion; |  | ||||||
| import org.bukkit.event.EventHandler; | import org.bukkit.event.EventHandler; | ||||||
| import org.bukkit.event.EventPriority; | import org.bukkit.event.EventPriority; | ||||||
| import org.bukkit.event.Listener; | import org.bukkit.event.Listener; | ||||||
| @@ -302,7 +303,7 @@ public class PaperListener implements Listener { | |||||||
|             final PlotPlayer<?> plotPlayer = BukkitUtil.adapt(event.getPlayer()); |             final PlotPlayer<?> plotPlayer = BukkitUtil.adapt(event.getPlayer()); | ||||||
|             plotPlayer.sendMessage( |             plotPlayer.sendMessage( | ||||||
|                     TranslatableCaption.of("errors.tile_entity_cap_reached"), |                     TranslatableCaption.of("errors.tile_entity_cap_reached"), | ||||||
|                     Template.template("amount", String.valueOf(Settings.Chunk_Processor.MAX_TILES)) |                     Template.of("amount", String.valueOf(Settings.Chunk_Processor.MAX_TILES)) | ||||||
|             ); |             ); | ||||||
|             event.setCancelled(true); |             event.setCancelled(true); | ||||||
|             event.setBuild(false); |             event.setBuild(false); | ||||||
| @@ -321,9 +322,6 @@ public class PaperListener implements Listener { | |||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|         Projectile entity = event.getProjectile(); |         Projectile entity = event.getProjectile(); | ||||||
|         if (!(entity instanceof ThrownPotion)) { |  | ||||||
|             return; |  | ||||||
|         } |  | ||||||
|         ProjectileSource shooter = entity.getShooter(); |         ProjectileSource shooter = entity.getShooter(); | ||||||
|         if (!(shooter instanceof Player)) { |         if (!(shooter instanceof Player)) { | ||||||
|             return; |             return; | ||||||
| @@ -332,11 +330,36 @@ public class PaperListener implements Listener { | |||||||
|         if (!this.plotAreaManager.hasPlotArea(location.getWorldName())) { |         if (!this.plotAreaManager.hasPlotArea(location.getWorldName())) { | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|         PlotPlayer<?> pp = BukkitUtil.adapt((Player) shooter); |         PlotPlayer<Player> pp = BukkitUtil.adapt((Player) shooter); | ||||||
|         Plot plot = location.getOwnedPlot(); |         Plot plot = location.getOwnedPlot(); | ||||||
|         if (plot != null && !plot.isAdded(pp.getUUID())) { |  | ||||||
|             entity.remove(); |         if (plot == null) { | ||||||
|             event.setCancelled(true); |             if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_ROAD)) { | ||||||
|  |                 pp.sendMessage( | ||||||
|  |                         TranslatableCaption.of("permission.no_permission_event"), | ||||||
|  |                         Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_ROAD)) | ||||||
|  |                 ); | ||||||
|  |                 entity.remove(); | ||||||
|  |                 event.setCancelled(true); | ||||||
|  |             } | ||||||
|  |         } else if (!plot.hasOwner()) { | ||||||
|  |             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)) | ||||||
|  |                 ); | ||||||
|  |                 entity.remove(); | ||||||
|  |                 event.setCancelled(true); | ||||||
|  |             } | ||||||
|  |         } else if (!plot.isAdded(pp.getUUID())) { | ||||||
|  |             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)) | ||||||
|  |                 ); | ||||||
|  |                 entity.remove(); | ||||||
|  |                 event.setCancelled(true); | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -36,7 +36,6 @@ import com.plotsquared.core.plot.world.PlotAreaManager; | |||||||
| import net.kyori.adventure.text.minimessage.Template; | import net.kyori.adventure.text.minimessage.Template; | ||||||
| import org.bukkit.block.Banner; | import org.bukkit.block.Banner; | ||||||
| import org.bukkit.block.Beacon; | import org.bukkit.block.Beacon; | ||||||
| import org.bukkit.block.Bed; |  | ||||||
| import org.bukkit.block.BlockState; | import org.bukkit.block.BlockState; | ||||||
| import org.bukkit.block.CommandBlock; | import org.bukkit.block.CommandBlock; | ||||||
| import org.bukkit.block.Comparator; | import org.bukkit.block.Comparator; | ||||||
| @@ -51,6 +50,7 @@ import org.bukkit.block.Jukebox; | |||||||
| import org.bukkit.block.Sign; | import org.bukkit.block.Sign; | ||||||
| import org.bukkit.block.Skull; | import org.bukkit.block.Skull; | ||||||
| import org.bukkit.block.Structure; | import org.bukkit.block.Structure; | ||||||
|  | import org.bukkit.block.data.type.Bed; | ||||||
| import org.bukkit.event.EventHandler; | import org.bukkit.event.EventHandler; | ||||||
| import org.bukkit.event.block.BlockPlaceEvent; | import org.bukkit.event.block.BlockPlaceEvent; | ||||||
| import org.checkerframework.checker.nullness.qual.NonNull; | import org.checkerframework.checker.nullness.qual.NonNull; | ||||||
| @@ -84,7 +84,7 @@ public class PaperListener113 extends PaperListener { | |||||||
|             final PlotPlayer<?> plotPlayer = BukkitUtil.adapt(event.getPlayer()); |             final PlotPlayer<?> plotPlayer = BukkitUtil.adapt(event.getPlayer()); | ||||||
|             plotPlayer.sendMessage( |             plotPlayer.sendMessage( | ||||||
|                     TranslatableCaption.of("errors.tile_entity_cap_reached"), |                     TranslatableCaption.of("errors.tile_entity_cap_reached"), | ||||||
|                     Template.template("amount", String.valueOf(Settings.Chunk_Processor.MAX_TILES)) |                     Template.of("amount", String.valueOf(Settings.Chunk_Processor.MAX_TILES)) | ||||||
|             ); |             ); | ||||||
|             event.setCancelled(true); |             event.setCancelled(true); | ||||||
|             event.setBuild(false); |             event.setBuild(false); | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -68,11 +68,9 @@ import com.plotsquared.core.plot.flag.implementations.PlayerInteractFlag; | |||||||
| import com.plotsquared.core.plot.flag.implementations.PreventCreativeCopyFlag; | import com.plotsquared.core.plot.flag.implementations.PreventCreativeCopyFlag; | ||||||
| import com.plotsquared.core.plot.flag.implementations.TamedInteractFlag; | import com.plotsquared.core.plot.flag.implementations.TamedInteractFlag; | ||||||
| import com.plotsquared.core.plot.flag.implementations.UntrustedVisitFlag; | import com.plotsquared.core.plot.flag.implementations.UntrustedVisitFlag; | ||||||
| import com.plotsquared.core.plot.flag.implementations.UseFlag; |  | ||||||
| import com.plotsquared.core.plot.flag.implementations.VehicleBreakFlag; | import com.plotsquared.core.plot.flag.implementations.VehicleBreakFlag; | ||||||
| import com.plotsquared.core.plot.flag.implementations.VehicleUseFlag; | import com.plotsquared.core.plot.flag.implementations.VehicleUseFlag; | ||||||
| import com.plotsquared.core.plot.flag.implementations.VillagerInteractFlag; | import com.plotsquared.core.plot.flag.implementations.VillagerInteractFlag; | ||||||
| import com.plotsquared.core.plot.flag.types.BlockTypeWrapper; |  | ||||||
| import com.plotsquared.core.plot.world.PlotAreaManager; | import com.plotsquared.core.plot.world.PlotAreaManager; | ||||||
| import com.plotsquared.core.util.EventDispatcher; | import com.plotsquared.core.util.EventDispatcher; | ||||||
| import com.plotsquared.core.util.MathMan; | import com.plotsquared.core.util.MathMan; | ||||||
| @@ -94,6 +92,7 @@ import org.bukkit.FluidCollisionMode; | |||||||
| import org.bukkit.Material; | import org.bukkit.Material; | ||||||
| import org.bukkit.block.Block; | import org.bukkit.block.Block; | ||||||
| import org.bukkit.block.BlockFace; | import org.bukkit.block.BlockFace; | ||||||
|  | import org.bukkit.block.BlockState; | ||||||
| import org.bukkit.block.data.Waterlogged; | import org.bukkit.block.data.Waterlogged; | ||||||
| import org.bukkit.command.PluginCommand; | import org.bukkit.command.PluginCommand; | ||||||
| import org.bukkit.entity.ArmorStand; | import org.bukkit.entity.ArmorStand; | ||||||
| @@ -127,7 +126,6 @@ import org.bukkit.event.player.PlayerBucketFillEvent; | |||||||
| import org.bukkit.event.player.PlayerChangedWorldEvent; | import org.bukkit.event.player.PlayerChangedWorldEvent; | ||||||
| import org.bukkit.event.player.PlayerCommandPreprocessEvent; | import org.bukkit.event.player.PlayerCommandPreprocessEvent; | ||||||
| import org.bukkit.event.player.PlayerDropItemEvent; | import org.bukkit.event.player.PlayerDropItemEvent; | ||||||
| import org.bukkit.event.player.PlayerEggThrowEvent; |  | ||||||
| import org.bukkit.event.player.PlayerEvent; | import org.bukkit.event.player.PlayerEvent; | ||||||
| import org.bukkit.event.player.PlayerInteractAtEntityEvent; | import org.bukkit.event.player.PlayerInteractAtEntityEvent; | ||||||
| import org.bukkit.event.player.PlayerInteractEntityEvent; | import org.bukkit.event.player.PlayerInteractEntityEvent; | ||||||
| @@ -225,6 +223,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @SuppressWarnings("StringSplitter") | ||||||
|     @EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST) |     @EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST) | ||||||
|     public void playerCommand(PlayerCommandPreprocessEvent event) { |     public void playerCommand(PlayerCommandPreprocessEvent event) { | ||||||
|         String msg = event.getMessage().toLowerCase().replaceAll("/", "").trim(); |         String msg = event.getMessage().toLowerCase().replaceAll("/", "").trim(); | ||||||
| @@ -364,9 +363,9 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                 && PremiumVerification.isPremium() && UpdateUtility.hasUpdate) { |                 && PremiumVerification.isPremium() && UpdateUtility.hasUpdate) { | ||||||
|             Caption boundary = TranslatableCaption.of("update.update_boundary"); |             Caption boundary = TranslatableCaption.of("update.update_boundary"); | ||||||
|             Caption updateNotification = TranslatableCaption.of("update.update_notification"); |             Caption updateNotification = TranslatableCaption.of("update.update_notification"); | ||||||
|             Template internalVersion = Template.template("p2version", UpdateUtility.internalVersion.versionString()); |             Template internalVersion = Template.of("p2version", UpdateUtility.internalVersion.versionString()); | ||||||
|             Template spigotVersion = Template.template("spigotversion", UpdateUtility.spigotVersion); |             Template spigotVersion = Template.of("spigotversion", UpdateUtility.spigotVersion); | ||||||
|             Template downloadUrl = Template.template("downloadurl", "https://www.spigotmc.org/resources/77506/updates"); |             Template downloadUrl = Template.of("downloadurl", "https://www.spigotmc.org/resources/77506/updates"); | ||||||
|             pp.sendMessage(boundary); |             pp.sendMessage(boundary); | ||||||
|             pp.sendMessage(updateNotification, internalVersion, spigotVersion, downloadUrl); |             pp.sendMessage(updateNotification, internalVersion, spigotVersion, downloadUrl); | ||||||
|             pp.sendMessage(boundary); |             pp.sendMessage(boundary); | ||||||
| @@ -380,6 +379,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|         this.eventDispatcher.doRespawnTask(pp); |         this.eventDispatcher.doRespawnTask(pp); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @SuppressWarnings("deprecation") // We explicitly want #getHomeSynchronous here | ||||||
|     @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) |     @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) | ||||||
|     public void onTeleport(PlayerTeleportEvent event) { |     public void onTeleport(PlayerTeleportEvent event) { | ||||||
|         Player player = event.getPlayer(); |         Player player = event.getPlayer(); | ||||||
| @@ -418,8 +418,8 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                             .getHomeSynchronous() |                             .getHomeSynchronous() | ||||||
|                             .equals(BukkitUtil.adaptComplete(to)))) { |                             .equals(BukkitUtil.adaptComplete(to)))) { | ||||||
|                         pp.sendMessage( |                         pp.sendMessage( | ||||||
|                                 TranslatableCaption.of("permission.no_permission_event"), |                                 TranslatableCaption.of("deny.no_enter"), | ||||||
|                                 Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_ENTRY_DENIED)) |                                 Template.of("plot", plot.toString()) | ||||||
|                         ); |                         ); | ||||||
|                         event.setCancelled(true); |                         event.setCancelled(true); | ||||||
|                     } |                     } | ||||||
| @@ -535,7 +535,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                     if (lastPlot != null && !plotExit(pp, lastPlot) && this.tmpTeleport && !kickAccess.get().orElse(false)) { |                     if (lastPlot != null && !plotExit(pp, lastPlot) && this.tmpTeleport && !kickAccess.get().orElse(false)) { | ||||||
|                         pp.sendMessage( |                         pp.sendMessage( | ||||||
|                                 TranslatableCaption.of("permission.no_permission_event"), |                                 TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                                 Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_EXIT_DENIED)) |                                 Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_EXIT_DENIED)) | ||||||
|                         ); |                         ); | ||||||
|                         this.tmpTeleport = false; |                         this.tmpTeleport = false; | ||||||
|                         if (lastPlot.equals(BukkitUtil.adapt(from).getPlot())) { |                         if (lastPlot.equals(BukkitUtil.adapt(from).getPlot())) { | ||||||
| @@ -552,8 +552,8 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                 ForceFieldListener.handleForcefield(player, pp, now); |                 ForceFieldListener.handleForcefield(player, pp, now); | ||||||
|             } else if (!plotEntry(pp, now) && this.tmpTeleport) { |             } else if (!plotEntry(pp, now) && this.tmpTeleport) { | ||||||
|                 pp.sendMessage( |                 pp.sendMessage( | ||||||
|                         TranslatableCaption.of("permission.no_permission_event"), |                         TranslatableCaption.of("deny.no_enter"), | ||||||
|                         Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_ENTRY_DENIED)) |                         Template.of("plot", now.toString()) | ||||||
|                 ); |                 ); | ||||||
|                 this.tmpTeleport = false; |                 this.tmpTeleport = false; | ||||||
|                 to.setX(from.getBlockX()); |                 to.setX(from.getBlockX()); | ||||||
| @@ -572,7 +572,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                     player.teleport(event.getTo()); |                     player.teleport(event.getTo()); | ||||||
|                     this.tmpTeleport = true; |                     this.tmpTeleport = true; | ||||||
|                     pp.sendMessage(TranslatableCaption.of("border.denied")); |                     pp.sendMessage(TranslatableCaption.of("border.denied")); | ||||||
|                 } else { |                 } else if (MathMan.roundInt(from.getX()) <= border) { // Only send if they just moved out of the border | ||||||
|                     pp.sendMessage(TranslatableCaption.of("border.bypass.exited")); |                     pp.sendMessage(TranslatableCaption.of("border.bypass.exited")); | ||||||
|                 } |                 } | ||||||
|             } else if (x2 < -border && this.tmpTeleport) { |             } else if (x2 < -border && this.tmpTeleport) { | ||||||
| @@ -582,7 +582,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                     player.teleport(event.getTo()); |                     player.teleport(event.getTo()); | ||||||
|                     this.tmpTeleport = true; |                     this.tmpTeleport = true; | ||||||
|                     pp.sendMessage(TranslatableCaption.of("border.denied")); |                     pp.sendMessage(TranslatableCaption.of("border.denied")); | ||||||
|                 } else { |                 } else if (MathMan.roundInt(from.getX()) >= -border) { // Only send if they just moved out of the border | ||||||
|                     pp.sendMessage(TranslatableCaption.of("border.bypass.exited")); |                     pp.sendMessage(TranslatableCaption.of("border.bypass.exited")); | ||||||
|                 } |                 } | ||||||
|             } else if (((x1 = MathMan.roundInt(from.getX())) >= border && x2 <= border) || (x1 <= -border && x2 >= -border)) { |             } else if (((x1 = MathMan.roundInt(from.getX())) >= border && x2 <= border) || (x1 <= -border && x2 >= -border)) { | ||||||
| @@ -613,19 +613,19 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                 } |                 } | ||||||
|                 return; |                 return; | ||||||
|             } |             } | ||||||
|             Plot now = area.getPlot(location); |             Plot plot = area.getPlot(location); | ||||||
|             Plot lastPlot; |             Plot lastPlot; | ||||||
|             try (final MetaDataAccess<Plot> lastPlotAccess = |             try (final MetaDataAccess<Plot> lastPlotAccess = | ||||||
|                          pp.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_LAST_PLOT)) { |                          pp.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_LAST_PLOT)) { | ||||||
|                 lastPlot = lastPlotAccess.get().orElse(null); |                 lastPlot = lastPlotAccess.get().orElse(null); | ||||||
|             } |             } | ||||||
|             if (now == null) { |             if (plot == null) { | ||||||
|                 try (final MetaDataAccess<Boolean> kickAccess = |                 try (final MetaDataAccess<Boolean> kickAccess = | ||||||
|                              pp.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_KICK)) { |                              pp.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_KICK)) { | ||||||
|                     if (lastPlot != null && !plotExit(pp, lastPlot) && this.tmpTeleport && !kickAccess.get().orElse(false)) { |                     if (lastPlot != null && !plotExit(pp, lastPlot) && this.tmpTeleport && !kickAccess.get().orElse(false)) { | ||||||
|                         pp.sendMessage( |                         pp.sendMessage( | ||||||
|                                 TranslatableCaption.of("permission.no_permission_event"), |                                 TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                                 Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_EXIT_DENIED)) |                                 Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_EXIT_DENIED)) | ||||||
|                         ); |                         ); | ||||||
|                         this.tmpTeleport = false; |                         this.tmpTeleport = false; | ||||||
|                         if (lastPlot.equals(BukkitUtil.adapt(from).getPlot())) { |                         if (lastPlot.equals(BukkitUtil.adapt(from).getPlot())) { | ||||||
| @@ -638,12 +638,12 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                         return; |                         return; | ||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
|             } else if (now.equals(lastPlot)) { |             } else if (plot.equals(lastPlot)) { | ||||||
|                 ForceFieldListener.handleForcefield(player, pp, now); |                 ForceFieldListener.handleForcefield(player, pp, plot); | ||||||
|             } else if (!plotEntry(pp, now) && this.tmpTeleport) { |             } else if (!plotEntry(pp, plot) && this.tmpTeleport) { | ||||||
|                 pp.sendMessage( |                 pp.sendMessage( | ||||||
|                         TranslatableCaption.of("permission.no_permission_event"), |                         TranslatableCaption.of("deny.no_enter"), | ||||||
|                         Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_ENTRY_DENIED)) |                         Template.of("plot", plot.toString()) | ||||||
|                 ); |                 ); | ||||||
|                 this.tmpTeleport = false; |                 this.tmpTeleport = false; | ||||||
|                 player.teleport(from); |                 player.teleport(from); | ||||||
| @@ -663,7 +663,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                     player.teleport(event.getTo()); |                     player.teleport(event.getTo()); | ||||||
|                     this.tmpTeleport = true; |                     this.tmpTeleport = true; | ||||||
|                     pp.sendMessage(TranslatableCaption.of("border.denied")); |                     pp.sendMessage(TranslatableCaption.of("border.denied")); | ||||||
|                 } else { |                 } else if (MathMan.roundInt(from.getZ()) <= border) { // Only send if they just moved out of the border | ||||||
|                     pp.sendMessage(TranslatableCaption.of("border.bypass.exited")); |                     pp.sendMessage(TranslatableCaption.of("border.bypass.exited")); | ||||||
|                 } |                 } | ||||||
|             } else if (z2 < -border && this.tmpTeleport) { |             } else if (z2 < -border && this.tmpTeleport) { | ||||||
| @@ -673,7 +673,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                     player.teleport(event.getTo()); |                     player.teleport(event.getTo()); | ||||||
|                     this.tmpTeleport = true; |                     this.tmpTeleport = true; | ||||||
|                     pp.sendMessage(TranslatableCaption.of("border.denied")); |                     pp.sendMessage(TranslatableCaption.of("border.denied")); | ||||||
|                 } else { |                 } else if (MathMan.roundInt(from.getZ()) >= -border) { // Only send if they just moved out of the border | ||||||
|                     pp.sendMessage(TranslatableCaption.of("border.bypass.exited")); |                     pp.sendMessage(TranslatableCaption.of("border.bypass.exited")); | ||||||
|                 } |                 } | ||||||
|             } else if (((z1 = MathMan.roundInt(from.getZ())) >= border && z2 <= border) || (z1 <= -border && z2 >= -border)) { |             } else if (((z1 = MathMan.roundInt(from.getZ())) >= border && z2 <= border) || (z1 <= -border && z2 >= -border)) { | ||||||
| @@ -729,9 +729,9 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|         String worldName = plot.getWorldName(); |         String worldName = plot.getWorldName(); | ||||||
|         Caption msg = TranslatableCaption.of("chat.plot_chat_format"); |         Caption msg = TranslatableCaption.of("chat.plot_chat_format"); | ||||||
|         Template msgTemplate; |         Template msgTemplate; | ||||||
|         Template worldNameTemplate = Template.template("world", worldName); |         Template worldNameTemplate = Template.of("world", worldName); | ||||||
|         Template plotTemplate = Template.template("plot_id", id.toString()); |         Template plotTemplate = Template.of("plot_id", id.toString()); | ||||||
|         Template senderTemplate = Template.template("sender", sender); |         Template senderTemplate = Template.of("sender", sender); | ||||||
|         // If we do/don't want colour, we need to be careful about how to go about it, as players could attempt either <gold></gold> or &6 etc. |         // If we do/don't want colour, we need to be careful about how to go about it, as players could attempt either <gold></gold> or &6 etc. | ||||||
|         // In both cases, we want to use a Component Template to ensure that the player cannot use any placeholders in their message on purpose |         // In both cases, we want to use a Component Template to ensure that the player cannot use any placeholders in their message on purpose | ||||||
|         //  or accidentally, as component templates are done at the end. We also need to deserialize from legacy color codes to a Component if |         //  or accidentally, as component templates are done at the end. We also need to deserialize from legacy color codes to a Component if | ||||||
| @@ -746,7 +746,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                             )) |                             )) | ||||||
|                     ); |                     ); | ||||||
|         } else { |         } else { | ||||||
|             msgTemplate = Template.template("msg", BukkitUtil.MINI_MESSAGE.deserialize( |             msgTemplate = Template.of("msg", BukkitUtil.MINI_MESSAGE.deserialize( | ||||||
|                     ChatColor.stripColor(BukkitUtil.LEGACY_COMPONENT_SERIALIZER.serialize(Component.text(message))))); |                     ChatColor.stripColor(BukkitUtil.LEGACY_COMPONENT_SERIALIZER.serialize(Component.text(message))))); | ||||||
|         } |         } | ||||||
|         for (PlotPlayer<?> receiver : plotRecipients) { |         for (PlotPlayer<?> receiver : plotRecipients) { | ||||||
| @@ -754,18 +754,18 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|         } |         } | ||||||
|         if (!spies.isEmpty()) { |         if (!spies.isEmpty()) { | ||||||
|             Caption spymsg = TranslatableCaption.of("chat.plot_chat_spy_format"); |             Caption spymsg = TranslatableCaption.of("chat.plot_chat_spy_format"); | ||||||
|             Template plotidTemplate = Template.template("plot_id", id.getX() + ";" + id.getY()); |             Template plotidTemplate = Template.of("plot_id", id.getX() + ";" + id.getY()); | ||||||
|             Template spysenderTemplate = Template.template("sender", sender); |             Template spysenderTemplate = Template.of("sender", sender); | ||||||
|             Template spymessageTemplate = Template.template("msg", Component.text(message)); |             Template spymessageTemplate = Template.of("msg", Component.text(message)); | ||||||
|             for (PlotPlayer<?> player : spies) { |             for (PlotPlayer<?> player : spies) { | ||||||
|                 player.sendMessage(spymsg, worldNameTemplate, plotidTemplate, spysenderTemplate, spymessageTemplate); |                 player.sendMessage(spymsg, worldNameTemplate, plotidTemplate, spysenderTemplate, spymessageTemplate); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         if (Settings.Chat.LOG_PLOTCHAT_TO_CONSOLE) { |         if (Settings.Chat.LOG_PLOTCHAT_TO_CONSOLE) { | ||||||
|             Caption spymsg = TranslatableCaption.of("chat.plot_chat_spy_format"); |             Caption spymsg = TranslatableCaption.of("chat.plot_chat_spy_format"); | ||||||
|             Template plotidTemplate = Template.template("plot_id", id.getX() + ";" + id.getY()); |             Template plotidTemplate = Template.of("plot_id", id.getX() + ";" + id.getY()); | ||||||
|             Template spysenderTemplate = Template.template("sender", sender); |             Template spysenderTemplate = Template.of("sender", sender); | ||||||
|             Template spymessageTemplate = Template.template("msg", Component.text(message)); |             Template spymessageTemplate = Template.of("msg", Component.text(message)); | ||||||
|             ConsolePlayer.getConsole().sendMessage(spymsg, worldNameTemplate, plotidTemplate, spysenderTemplate, |             ConsolePlayer.getConsole().sendMessage(spymsg, worldNameTemplate, plotidTemplate, spysenderTemplate, | ||||||
|                     spymessageTemplate |                     spymessageTemplate | ||||||
|             ); |             ); | ||||||
| @@ -921,7 +921,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|             if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_ROAD)) { |             if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_ROAD)) { | ||||||
|                 pp.sendMessage( |                 pp.sendMessage( | ||||||
|                         TranslatableCaption.of("permission.no_permission_event"), |                         TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                         Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD)) |                         Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD)) | ||||||
|                 ); |                 ); | ||||||
|                 cancelled = true; |                 cancelled = true; | ||||||
|             } |             } | ||||||
| @@ -929,7 +929,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|             if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) { |             if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) { | ||||||
|                 pp.sendMessage( |                 pp.sendMessage( | ||||||
|                         TranslatableCaption.of("permission.no_permission_event"), |                         TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                         Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) |                         Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) | ||||||
|                 ); |                 ); | ||||||
|                 cancelled = true; |                 cancelled = true; | ||||||
|             } |             } | ||||||
| @@ -939,7 +939,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) { |                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) { | ||||||
|                     pp.sendMessage( |                     pp.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission_event"), |                             TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                             Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_OTHER)) |                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_OTHER)) | ||||||
|                     ); |                     ); | ||||||
|                     cancelled = true; |                     cancelled = true; | ||||||
|                 } |                 } | ||||||
| @@ -977,7 +977,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                     .hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_ROAD)) { |                     .hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_ROAD)) { | ||||||
|                 pp.sendMessage( |                 pp.sendMessage( | ||||||
|                         TranslatableCaption.of("permission.no_permission_event"), |                         TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                         Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD)) |                         Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD)) | ||||||
|                 ); |                 ); | ||||||
|                 e.setCancelled(true); |                 e.setCancelled(true); | ||||||
|             } |             } | ||||||
| @@ -995,7 +995,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                 if (!Permissions.hasPermission(pp, "plots.admin.interact.unowned")) { |                 if (!Permissions.hasPermission(pp, "plots.admin.interact.unowned")) { | ||||||
|                     pp.sendMessage( |                     pp.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission_event"), |                             TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                             Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) |                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) | ||||||
|                     ); |                     ); | ||||||
|                     e.setCancelled(true); |                     e.setCancelled(true); | ||||||
|                 } |                 } | ||||||
| @@ -1010,7 +1010,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) { |                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) { | ||||||
|                     pp.sendMessage( |                     pp.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission_event"), |                             TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                             Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_OTHER)) |                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_OTHER)) | ||||||
|                     ); |                     ); | ||||||
|                     e.setCancelled(true); |                     e.setCancelled(true); | ||||||
|                     plot.debug(pp.getName() + " could not interact with " + entity.getType() |                     plot.debug(pp.getName() + " could not interact with " + entity.getType() | ||||||
| @@ -1064,9 +1064,13 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|         if (area == null) { |         if (area == null) { | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|         PlayerBlockEventType eventType = null; |         PlayerBlockEventType eventType; | ||||||
|         BlockType blocktype1; |         BlockType blocktype1; | ||||||
|         Block block = event.getClickedBlock(); |         Block block = event.getClickedBlock(); | ||||||
|  |         if (block == null) { | ||||||
|  |             // We do not care in this case, the player is likely interacting with air ("nothing"). | ||||||
|  |             return; | ||||||
|  |         } | ||||||
|         Location location = BukkitUtil.adapt(block.getLocation()); |         Location location = BukkitUtil.adapt(block.getLocation()); | ||||||
|         Action action = event.getAction(); |         Action action = event.getAction(); | ||||||
|         switch (action) { |         switch (action) { | ||||||
| @@ -1226,7 +1230,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|             } |             } | ||||||
|             pp.sendMessage( |             pp.sendMessage( | ||||||
|                     TranslatableCaption.of("permission.no_permission_event"), |                     TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                     Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD)) |                     Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD)) | ||||||
|             ); |             ); | ||||||
|             event.setCancelled(true); |             event.setCancelled(true); | ||||||
|         } else if (!plot.hasOwner()) { |         } else if (!plot.hasOwner()) { | ||||||
| @@ -1235,23 +1239,16 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|             } |             } | ||||||
|             pp.sendMessage( |             pp.sendMessage( | ||||||
|                     TranslatableCaption.of("permission.no_permission_event"), |                     TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                     Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) |                     Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) | ||||||
|             ); |             ); | ||||||
|             event.setCancelled(true); |             event.setCancelled(true); | ||||||
|         } else if (!plot.isAdded(pp.getUUID())) { |         } else if (!plot.isAdded(pp.getUUID())) { | ||||||
|             List<BlockTypeWrapper> use = plot.getFlag(UseFlag.class); |  | ||||||
|             final BlockType blockType = BukkitAdapter.asBlockType(block.getType()); |  | ||||||
|             for (final BlockTypeWrapper blockTypeWrapper : use) { |  | ||||||
|                 if (blockTypeWrapper.accepts(blockType)) { |  | ||||||
|                     return; |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|             if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { |             if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||||
|                 return; |                 return; | ||||||
|             } |             } | ||||||
|             pp.sendMessage( |             pp.sendMessage( | ||||||
|                     TranslatableCaption.of("permission.no_permission_event"), |                     TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                     Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER)) |                     Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER)) | ||||||
|             ); |             ); | ||||||
|             event.setCancelled(true); |             event.setCancelled(true); | ||||||
|         } else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { |         } else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { | ||||||
| @@ -1298,7 +1295,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|             } |             } | ||||||
|             plotPlayer.sendMessage( |             plotPlayer.sendMessage( | ||||||
|                     TranslatableCaption.of("permission.no_permission_event"), |                     TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                     Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD)) |                     Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD)) | ||||||
|             ); |             ); | ||||||
|             event.setCancelled(true); |             event.setCancelled(true); | ||||||
|         } else if (!plot.hasOwner()) { |         } else if (!plot.hasOwner()) { | ||||||
| @@ -1307,24 +1304,16 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|             } |             } | ||||||
|             plotPlayer.sendMessage( |             plotPlayer.sendMessage( | ||||||
|                     TranslatableCaption.of("permission.no_permission_event"), |                     TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                     Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) |                     Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) | ||||||
|             ); |             ); | ||||||
|             event.setCancelled(true); |             event.setCancelled(true); | ||||||
|         } else if (!plot.isAdded(plotPlayer.getUUID())) { |         } else if (!plot.isAdded(plotPlayer.getUUID())) { | ||||||
|             List<BlockTypeWrapper> use = plot.getFlag(UseFlag.class); |  | ||||||
|             Block block = event.getBlockClicked(); |  | ||||||
|             final BlockType blockType = BukkitAdapter.asBlockType(block.getType()); |  | ||||||
|             for (final BlockTypeWrapper blockTypeWrapper : use) { |  | ||||||
|                 if (blockTypeWrapper.accepts(blockType)) { |  | ||||||
|                     return; |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|             if (Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { |             if (Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||||
|                 return; |                 return; | ||||||
|             } |             } | ||||||
|             plotPlayer.sendMessage( |             plotPlayer.sendMessage( | ||||||
|                     TranslatableCaption.of("permission.no_permission_event"), |                     TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                     Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER)) |                     Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER)) | ||||||
|             ); |             ); | ||||||
|             event.setCancelled(true); |             event.setCancelled(true); | ||||||
|         } else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { |         } else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { | ||||||
| @@ -1356,7 +1345,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|             if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) { |             if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) { | ||||||
|                 pp.sendMessage( |                 pp.sendMessage( | ||||||
|                         TranslatableCaption.of("permission.no_permission_event"), |                         TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                         Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD)) |                         Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD)) | ||||||
|                 ); |                 ); | ||||||
|                 event.setCancelled(true); |                 event.setCancelled(true); | ||||||
|             } |             } | ||||||
| @@ -1365,7 +1354,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) { |                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) { | ||||||
|                     pp.sendMessage( |                     pp.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission_event"), |                             TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                             Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) |                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) | ||||||
|                     ); |                     ); | ||||||
|                     event.setCancelled(true); |                     event.setCancelled(true); | ||||||
|                 } |                 } | ||||||
| @@ -1376,7 +1365,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                     if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { |                     if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { | ||||||
|                         pp.sendMessage( |                         pp.sendMessage( | ||||||
|                                 TranslatableCaption.of("permission.no_permission_event"), |                                 TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                                 Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER)) |                                 Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER)) | ||||||
|                         ); |                         ); | ||||||
|                         event.setCancelled(true); |                         event.setCancelled(true); | ||||||
|                     } |                     } | ||||||
| @@ -1405,7 +1394,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_ROAD)) { |                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_ROAD)) { | ||||||
|                     pp.sendMessage( |                     pp.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission_event"), |                             TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                             Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_ROAD)) |                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_ROAD)) | ||||||
|                     ); |                     ); | ||||||
|                     event.setCancelled(true); |                     event.setCancelled(true); | ||||||
|                 } |                 } | ||||||
| @@ -1413,7 +1402,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) { |                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) { | ||||||
|                     pp.sendMessage( |                     pp.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission_event"), |                             TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                             Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) |                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) | ||||||
|                     ); |                     ); | ||||||
|                     event.setCancelled(true); |                     event.setCancelled(true); | ||||||
|                 } |                 } | ||||||
| @@ -1424,7 +1413,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_OTHER)) { |                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_OTHER)) { | ||||||
|                     pp.sendMessage( |                     pp.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission_event"), |                             TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                             Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER)) |                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER)) | ||||||
|                     ); |                     ); | ||||||
|                     event.setCancelled(true); |                     event.setCancelled(true); | ||||||
|                     plot.debug(p.getName() |                     plot.debug(p.getName() | ||||||
| @@ -1446,7 +1435,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                                 .hasPermission(player, Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) { |                                 .hasPermission(player, Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) { | ||||||
|                             player.sendMessage( |                             player.sendMessage( | ||||||
|                                     TranslatableCaption.of("permission.no_permission_event"), |                                     TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                                     Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) |                                     Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) | ||||||
|                             ); |                             ); | ||||||
|                             event.setCancelled(true); |                             event.setCancelled(true); | ||||||
|                         } |                         } | ||||||
| @@ -1456,7 +1445,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                                     .hasPermission(player, Permission.PERMISSION_ADMIN_DESTROY_OTHER)) { |                                     .hasPermission(player, Permission.PERMISSION_ADMIN_DESTROY_OTHER)) { | ||||||
|                                 player.sendMessage( |                                 player.sendMessage( | ||||||
|                                         TranslatableCaption.of("permission.no_permission_event"), |                                         TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                                         Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER)) |                                         Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER)) | ||||||
|                                 ); |                                 ); | ||||||
|                                 event.setCancelled(true); |                                 event.setCancelled(true); | ||||||
|                                 plot.debug(player.getName() |                                 plot.debug(player.getName() | ||||||
| @@ -1488,7 +1477,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|             if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_ROAD)) { |             if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_ROAD)) { | ||||||
|                 pp.sendMessage( |                 pp.sendMessage( | ||||||
|                         TranslatableCaption.of("permission.no_permission_event"), |                         TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                         Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD)) |                         Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD)) | ||||||
|                 ); |                 ); | ||||||
|                 event.setCancelled(true); |                 event.setCancelled(true); | ||||||
|             } |             } | ||||||
| @@ -1496,7 +1485,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|             if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) { |             if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) { | ||||||
|                 pp.sendMessage( |                 pp.sendMessage( | ||||||
|                         TranslatableCaption.of("permission.no_permission_event"), |                         TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                         Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) |                         Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) | ||||||
|                 ); |                 ); | ||||||
|                 event.setCancelled(true); |                 event.setCancelled(true); | ||||||
|             } |             } | ||||||
| @@ -1554,7 +1543,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|             if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) { |             if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) { | ||||||
|                 pp.sendMessage( |                 pp.sendMessage( | ||||||
|                         TranslatableCaption.of("permission.no_permission_event"), |                         TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                         Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_OTHER)) |                         Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_OTHER)) | ||||||
|                 ); |                 ); | ||||||
|                 event.setCancelled(true); |                 event.setCancelled(true); | ||||||
|             } |             } | ||||||
| @@ -1576,7 +1565,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_ROAD)) { |                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_ROAD)) { | ||||||
|                     pp.sendMessage( |                     pp.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission_event"), |                             TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                             Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_ROAD)) |                             Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_ROAD)) | ||||||
|                     ); |                     ); | ||||||
|                     event.setCancelled(true); |                     event.setCancelled(true); | ||||||
|                 } |                 } | ||||||
| @@ -1585,7 +1574,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                     if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_UNOWNED)) { |                     if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_UNOWNED)) { | ||||||
|                         pp.sendMessage( |                         pp.sendMessage( | ||||||
|                                 TranslatableCaption.of("permission.no_permission_event"), |                                 TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                                 Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_UNOWNED)) |                                 Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_UNOWNED)) | ||||||
|                         ); |                         ); | ||||||
|                         event.setCancelled(true); |                         event.setCancelled(true); | ||||||
|                         return; |                         return; | ||||||
| @@ -1599,7 +1588,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|                     if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_OTHER)) { |                     if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_OTHER)) { | ||||||
|                         pp.sendMessage( |                         pp.sendMessage( | ||||||
|                                 TranslatableCaption.of("permission.no_permission_event"), |                                 TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                                 Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_OTHER)) |                                 Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_OTHER)) | ||||||
|                         ); |                         ); | ||||||
|                         event.setCancelled(true); |                         event.setCancelled(true); | ||||||
|                         plot.debug(pp.getName() |                         plot.debug(pp.getName() | ||||||
| @@ -1610,43 +1599,6 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) |  | ||||||
|     public void onPlayerEggThrow(PlayerEggThrowEvent event) { |  | ||||||
|         Location location = BukkitUtil.adapt(event.getEgg().getLocation()); |  | ||||||
|         PlotArea area = location.getPlotArea(); |  | ||||||
|         if (area == null) { |  | ||||||
|             return; |  | ||||||
|         } |  | ||||||
|         Player player = event.getPlayer(); |  | ||||||
|         BukkitPlayer plotPlayer = BukkitUtil.adapt(player); |  | ||||||
|         Plot plot = area.getPlot(location); |  | ||||||
|         if (plot == null) { |  | ||||||
|             if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PROJECTILE_ROAD)) { |  | ||||||
|                 plotPlayer.sendMessage( |  | ||||||
|                         TranslatableCaption.of("permission.no_permission_event"), |  | ||||||
|                         Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_ROAD)) |  | ||||||
|                 ); |  | ||||||
|                 event.setHatching(false); |  | ||||||
|             } |  | ||||||
|         } else if (!plot.hasOwner()) { |  | ||||||
|             if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) { |  | ||||||
|                 plotPlayer.sendMessage( |  | ||||||
|                         TranslatableCaption.of("permission.no_permission_event"), |  | ||||||
|                         Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) |  | ||||||
|                 ); |  | ||||||
|                 event.setHatching(false); |  | ||||||
|             } |  | ||||||
|         } else if (!plot.isAdded(plotPlayer.getUUID())) { |  | ||||||
|             if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) { |  | ||||||
|                 plotPlayer.sendMessage( |  | ||||||
|                         TranslatableCaption.of("permission.no_permission_event"), |  | ||||||
|                         Template.template("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) |  | ||||||
|                 ); |  | ||||||
|                 event.setHatching(false); |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     @EventHandler |     @EventHandler | ||||||
|     public void onItemDrop(PlayerDropItemEvent event) { |     public void onItemDrop(PlayerDropItemEvent event) { | ||||||
|         Player player = event.getPlayer(); |         Player player = event.getPlayer(); | ||||||
| @@ -1720,6 +1672,7 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @SuppressWarnings("deprecation") // #getLocate is needed for Spigot compatibility | ||||||
|     @EventHandler |     @EventHandler | ||||||
|     public void onLocaleChange(final PlayerLocaleChangeEvent event) { |     public void onLocaleChange(final PlayerLocaleChangeEvent event) { | ||||||
|         // The event is fired before the player is deemed online upon login |         // The event is fired before the player is deemed online upon login | ||||||
| @@ -1755,22 +1708,49 @@ public class PlayerEventListener extends PlotListener implements Listener { | |||||||
|  |  | ||||||
|     @EventHandler |     @EventHandler | ||||||
|     public void onPortalCreation(PortalCreateEvent event) { |     public void onPortalCreation(PortalCreateEvent event) { | ||||||
|         Location location = BukkitUtil.adapt(event.getEntity().getLocation()); |         String world = event.getWorld().getName(); | ||||||
|         PlotArea area = location.getPlotArea(); |         if (PlotSquared.get().getPlotAreaManager().getPlotAreasSet(world).size() == 0) { | ||||||
|         if (area == null) { |  | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|         Plot plot = location.getOwnedPlot(); |         int minX = Integer.MAX_VALUE; | ||||||
|         if (plot == null) { |         int maxX = Integer.MIN_VALUE; | ||||||
|             if (area.isRoadFlags() && area.getRoadFlag(DenyPortalsFlag.class)) { |         int minZ = Integer.MAX_VALUE; | ||||||
|                 event.setCancelled(true); |         int maxZ = Integer.MIN_VALUE; | ||||||
|  |         for (BlockState state : event.getBlocks()) { | ||||||
|  |             minX = Math.min(state.getX(), minX); | ||||||
|  |             maxX = Math.max(state.getX(), maxX); | ||||||
|  |             minZ = Math.min(state.getZ(), minZ); | ||||||
|  |             maxZ = Math.max(state.getZ(), maxZ); | ||||||
|  |         } | ||||||
|  |         int y = event.getBlocks().get(0).getY(); // Don't need to worry about this too much | ||||||
|  |         for (Location location : Set.of( // Use Set to lazily avoid duplicate locations | ||||||
|  |                 Location.at(world, minX, y, maxX), | ||||||
|  |                 Location.at(world, minZ, y, maxZ), | ||||||
|  |                 Location.at(world, minX, y, maxZ), | ||||||
|  |                 Location.at(world, minZ, y, maxX) | ||||||
|  |         )) { | ||||||
|  |             PlotArea area = location.getPlotArea(); | ||||||
|  |             if (area == null) { | ||||||
|  |                 continue; | ||||||
|  |             } | ||||||
|  |             Plot plot = location.getOwnedPlot(); | ||||||
|  |             if (plot == null) { | ||||||
|  |                 if (area.isRoadFlags() && area.getRoadFlag(DenyPortalsFlag.class)) { | ||||||
|  |                     event.setCancelled(true); | ||||||
|  |                     return; | ||||||
|  |                 } | ||||||
|  |                 continue; | ||||||
|             } |             } | ||||||
|             return; |  | ||||||
|         } |  | ||||||
|         if (plot.getFlag(DenyPortalsFlag.class)) { |  | ||||||
|             if (plot.getFlag(DenyPortalsFlag.class)) { |             if (plot.getFlag(DenyPortalsFlag.class)) { | ||||||
|                 plot.debug(event.getEntity().getName() + " did not create a portal because of deny-portals = true"); |                 StringBuilder builder = new StringBuilder(); | ||||||
|  |                 if (event.getEntity() != null) { | ||||||
|  |                     builder.append(event.getEntity().getName()).append(" did not create a portal"); | ||||||
|  |                 } else { | ||||||
|  |                     builder.append("Portal creation cancelled"); | ||||||
|  |                 } | ||||||
|  |                 plot.debug(builder.append(" because of deny-portals = true").toString()); | ||||||
|                 event.setCancelled(true); |                 event.setCancelled(true); | ||||||
|  |                 return; | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -28,6 +28,7 @@ package com.plotsquared.bukkit.listener; | |||||||
| import com.google.inject.Inject; | import com.google.inject.Inject; | ||||||
| import com.plotsquared.bukkit.util.BukkitEntityUtil; | import com.plotsquared.bukkit.util.BukkitEntityUtil; | ||||||
| import com.plotsquared.bukkit.util.BukkitUtil; | import com.plotsquared.bukkit.util.BukkitUtil; | ||||||
|  | import com.plotsquared.core.configuration.caption.TranslatableCaption; | ||||||
| import com.plotsquared.core.location.Location; | import com.plotsquared.core.location.Location; | ||||||
| import com.plotsquared.core.permissions.Permission; | import com.plotsquared.core.permissions.Permission; | ||||||
| import com.plotsquared.core.player.PlotPlayer; | import com.plotsquared.core.player.PlotPlayer; | ||||||
| @@ -36,6 +37,7 @@ import com.plotsquared.core.plot.PlotArea; | |||||||
| import com.plotsquared.core.plot.PlotHandler; | import com.plotsquared.core.plot.PlotHandler; | ||||||
| import com.plotsquared.core.plot.world.PlotAreaManager; | import com.plotsquared.core.plot.world.PlotAreaManager; | ||||||
| import com.plotsquared.core.util.Permissions; | import com.plotsquared.core.util.Permissions; | ||||||
|  | import net.kyori.adventure.text.minimessage.Template; | ||||||
| import org.bukkit.entity.Entity; | import org.bukkit.entity.Entity; | ||||||
| import org.bukkit.entity.LivingEntity; | import org.bukkit.entity.LivingEntity; | ||||||
| import org.bukkit.entity.Player; | import org.bukkit.entity.Player; | ||||||
| @@ -96,9 +98,6 @@ public class ProjectileEventListener implements Listener { | |||||||
|     @EventHandler |     @EventHandler | ||||||
|     public void onProjectileLaunch(ProjectileLaunchEvent event) { |     public void onProjectileLaunch(ProjectileLaunchEvent event) { | ||||||
|         Projectile entity = event.getEntity(); |         Projectile entity = event.getEntity(); | ||||||
|         if (!(entity instanceof ThrownPotion)) { |  | ||||||
|             return; |  | ||||||
|         } |  | ||||||
|         ProjectileSource shooter = entity.getShooter(); |         ProjectileSource shooter = entity.getShooter(); | ||||||
|         if (!(shooter instanceof Player)) { |         if (!(shooter instanceof Player)) { | ||||||
|             return; |             return; | ||||||
| @@ -109,9 +108,34 @@ public class ProjectileEventListener implements Listener { | |||||||
|         } |         } | ||||||
|         PlotPlayer<Player> pp = BukkitUtil.adapt((Player) shooter); |         PlotPlayer<Player> pp = BukkitUtil.adapt((Player) shooter); | ||||||
|         Plot plot = location.getOwnedPlot(); |         Plot plot = location.getOwnedPlot(); | ||||||
|         if (plot != null && !plot.isAdded(pp.getUUID())) { |  | ||||||
|             entity.remove(); |         if (plot == null) { | ||||||
|             event.setCancelled(true); |             if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_ROAD)) { | ||||||
|  |                 pp.sendMessage( | ||||||
|  |                         TranslatableCaption.of("permission.no_permission_event"), | ||||||
|  |                         Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_ROAD)) | ||||||
|  |                 ); | ||||||
|  |                 entity.remove(); | ||||||
|  |                 event.setCancelled(true); | ||||||
|  |             } | ||||||
|  |         } else if (!plot.hasOwner()) { | ||||||
|  |             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)) | ||||||
|  |                 ); | ||||||
|  |                 entity.remove(); | ||||||
|  |                 event.setCancelled(true); | ||||||
|  |             } | ||||||
|  |         } else if (!plot.isAdded(pp.getUUID())) { | ||||||
|  |             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)) | ||||||
|  |                 ); | ||||||
|  |                 entity.remove(); | ||||||
|  |                 event.setCancelled(true); | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -131,14 +155,14 @@ public class ProjectileEventListener implements Listener { | |||||||
|         if (shooter instanceof Player) { |         if (shooter instanceof Player) { | ||||||
|             PlotPlayer<?> pp = BukkitUtil.adapt((Player) shooter); |             PlotPlayer<?> pp = BukkitUtil.adapt((Player) shooter); | ||||||
|             if (plot == null) { |             if (plot == null) { | ||||||
|                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_PROJECTILE_UNOWNED)) { |                 if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) { | ||||||
|                     entity.remove(); |                     entity.remove(); | ||||||
|                     event.setCancelled(true); |                     event.setCancelled(true); | ||||||
|                 } |                 } | ||||||
|                 return; |                 return; | ||||||
|             } |             } | ||||||
|             if (plot.isAdded(pp.getUUID()) || Permissions |             if (plot.isAdded(pp.getUUID()) || Permissions | ||||||
|                     .hasPermission(pp, Permission.PERMISSION_PROJECTILE_OTHER)) { |                     .hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) { | ||||||
|                 return; |                 return; | ||||||
|             } |             } | ||||||
|             entity.remove(); |             entity.remove(); | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -43,7 +43,6 @@ import java.lang.reflect.Method; | |||||||
|  |  | ||||||
| import static com.plotsquared.core.util.ReflectionUtils.getRefClass; | import static com.plotsquared.core.util.ReflectionUtils.getRefClass; | ||||||
|  |  | ||||||
| @SuppressWarnings("unused") |  | ||||||
| public class SingleWorldListener implements Listener { | public class SingleWorldListener implements Listener { | ||||||
|  |  | ||||||
|     private final Method methodGetHandleChunk; |     private final Method methodGetHandleChunk; | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -25,6 +25,7 @@ | |||||||
|  */ |  */ | ||||||
| package com.plotsquared.bukkit.managers; | package com.plotsquared.bukkit.managers; | ||||||
|  |  | ||||||
|  | /* | ||||||
| import com.google.inject.Singleton; | import com.google.inject.Singleton; | ||||||
| import org.bukkit.World; | import org.bukkit.World; | ||||||
| import org.checkerframework.checker.nullness.qual.NonNull; | import org.checkerframework.checker.nullness.qual.NonNull; | ||||||
| @@ -35,10 +36,9 @@ import se.hyperver.hyperverse.world.WorldConfigurationBuilder; | |||||||
| import se.hyperver.hyperverse.world.WorldFeatures; | import se.hyperver.hyperverse.world.WorldFeatures; | ||||||
| import se.hyperver.hyperverse.world.WorldType; | import se.hyperver.hyperverse.world.WorldType; | ||||||
|  |  | ||||||
| /** | Hyperverse implementation is currently put on ice until Hyperverse is released on a stable line and deployed to the central | ||||||
|  * Hyperverse specific manager that creates worlds | repository. | ||||||
|  * using Hyperverse's API |  | ||||||
|  */ |  | ||||||
| @Singleton | @Singleton | ||||||
| public class HyperverseWorldManager extends BukkitWorldManager { | public class HyperverseWorldManager extends BukkitWorldManager { | ||||||
|  |  | ||||||
| @@ -67,3 +67,4 @@ public class HyperverseWorldManager extends BukkitWorldManager { | |||||||
|     } |     } | ||||||
|  |  | ||||||
| } | } | ||||||
|  |  */ | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -36,7 +36,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; | |||||||
|  * world creation by executing a console command |  * world creation by executing a console command | ||||||
|  * |  * | ||||||
|  * @deprecated Deprecated and scheduled for removal without replacement |  * @deprecated Deprecated and scheduled for removal without replacement | ||||||
|  * in favor of the build in setup wizard. |  *         in favor of the build in setup wizard. | ||||||
|  */ |  */ | ||||||
| @Deprecated(forRemoval = true) | @Deprecated(forRemoval = true) | ||||||
| @Singleton | @Singleton | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -162,6 +162,7 @@ public class BukkitPlayer extends PlotPlayer<Player> { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @SuppressWarnings("StringSplitter") | ||||||
|     @Override |     @Override | ||||||
|     @NonNegative |     @NonNegative | ||||||
|     public int hasPermissionRange( |     public int hasPermissionRange( | ||||||
| @@ -319,7 +320,7 @@ public class BukkitPlayer extends PlotPlayer<Player> { | |||||||
|         if (id == ItemTypes.AIR) { |         if (id == ItemTypes.AIR) { | ||||||
|             // Let's just stop all the discs because why not? |             // Let's just stop all the discs because why not? | ||||||
|             for (final Sound sound : Arrays.stream(Sound.values()) |             for (final Sound sound : Arrays.stream(Sound.values()) | ||||||
|                     .filter(sound -> sound.name().contains("DISC")).collect(Collectors.toList())) { |                     .filter(sound -> sound.name().contains("DISC")).toList()) { | ||||||
|                 player.stopSound(sound); |                 player.stopSound(sound); | ||||||
|             } |             } | ||||||
|             // this.player.playEffect(BukkitUtil.getLocation(location), Effect.RECORD_PLAY, Material.AIR); |             // this.player.playEffect(BukkitUtil.getLocation(location), Effect.RECORD_PLAY, Material.AIR); | ||||||
| @@ -331,6 +332,7 @@ public class BukkitPlayer extends PlotPlayer<Player> { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @SuppressWarnings("deprecation") // Needed for Spigot compatibility | ||||||
|     @Override |     @Override | ||||||
|     public void kick(final String message) { |     public void kick(final String message) { | ||||||
|         this.player.kickPlayer(message); |         this.player.kickPlayer(message); | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -51,7 +51,6 @@ import com.sk89q.worldedit.world.biome.BiomeType; | |||||||
| import com.sk89q.worldedit.world.block.BaseBlock; | import com.sk89q.worldedit.world.block.BaseBlock; | ||||||
| import com.sk89q.worldedit.world.block.BlockState; | import com.sk89q.worldedit.world.block.BlockState; | ||||||
| import org.bukkit.Bukkit; | import org.bukkit.Bukkit; | ||||||
| import org.bukkit.Chunk; |  | ||||||
| import org.bukkit.block.Block; | import org.bukkit.block.Block; | ||||||
| import org.bukkit.block.Container; | import org.bukkit.block.Container; | ||||||
| import org.bukkit.block.data.BlockData; | import org.bukkit.block.data.BlockData; | ||||||
| @@ -199,7 +198,7 @@ public class BukkitQueueCoordinator extends BasicQueueCoordinator { | |||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
|                 if (localChunk.getTiles().size() > 0) { |                 if (localChunk.getTiles().size() > 0) { | ||||||
|                     localChunk.getTiles().forEach(((blockVector3, tag) -> { |                     localChunk.getTiles().forEach((blockVector3, tag) -> { | ||||||
|                         try { |                         try { | ||||||
|                             BaseBlock block = getWorld().getBlock(blockVector3).toBaseBlock(tag); |                             BaseBlock block = getWorld().getBlock(blockVector3).toBaseBlock(tag); | ||||||
|                             getWorld().setBlock(blockVector3, block, noSideEffectSet); |                             getWorld().setBlock(blockVector3, block, noSideEffectSet); | ||||||
| @@ -207,7 +206,7 @@ public class BukkitQueueCoordinator extends BasicQueueCoordinator { | |||||||
|                             StateWrapper sw = new StateWrapper(tag); |                             StateWrapper sw = new StateWrapper(tag); | ||||||
|                             sw.restoreTag(getWorld().getName(), blockVector3.getX(), blockVector3.getY(), blockVector3.getZ()); |                             sw.restoreTag(getWorld().getName(), blockVector3.getX(), blockVector3.getY(), blockVector3.getZ()); | ||||||
|                         } |                         } | ||||||
|                     })); |                     }); | ||||||
|                 } |                 } | ||||||
|                 if (localChunk.getEntities().size() > 0) { |                 if (localChunk.getEntities().size() > 0) { | ||||||
|                     localChunk.getEntities().forEach((location, entity) -> getWorld().createEntity(location, entity)); |                     localChunk.getEntities().forEach((location, entity) -> getWorld().createEntity(location, entity)); | ||||||
| @@ -238,6 +237,7 @@ public class BukkitQueueCoordinator extends BasicQueueCoordinator { | |||||||
|     /** |     /** | ||||||
|      * Set a block to the world. First tries WNA but defaults to normal block setting methods if that fails |      * Set a block to the world. First tries WNA but defaults to normal block setting methods if that fails | ||||||
|      */ |      */ | ||||||
|  |     @SuppressWarnings("unused") | ||||||
|     private void setWorldBlock(int x, int y, int z, @NonNull BaseBlock block, @NonNull BlockVector2 blockVector2, boolean edge) { |     private void setWorldBlock(int x, int y, int z, @NonNull BaseBlock block, @NonNull BlockVector2 blockVector2, boolean edge) { | ||||||
|         try { |         try { | ||||||
|             BlockVector3 loc = BlockVector3.at(x, y, z); |             BlockVector3 loc = BlockVector3.at(x, y, z); | ||||||
| @@ -266,9 +266,7 @@ public class BukkitQueueCoordinator extends BasicQueueCoordinator { | |||||||
|         } catch (WorldEditException ignored) { |         } catch (WorldEditException ignored) { | ||||||
|             // Fallback to not so nice method |             // Fallback to not so nice method | ||||||
|             BlockData blockData = BukkitAdapter.adapt(block); |             BlockData blockData = BukkitAdapter.adapt(block); | ||||||
|             Chunk chunk = getBukkitWorld().getChunkAt(blockVector2.getX(), blockVector2.getZ()); |             Block existing = getBukkitWorld().getBlockAt(x, y, z); | ||||||
|  |  | ||||||
|             Block existing = chunk.getBlock(x, y, z); |  | ||||||
|             final BlockState existingBaseBlock = BukkitAdapter.adapt(existing.getBlockData()); |             final BlockState existingBaseBlock = BukkitAdapter.adapt(existing.getBlockData()); | ||||||
|             if (BukkitBlockUtil.get(existing).equals(existingBaseBlock) && existing.getBlockData().matches(blockData)) { |             if (BukkitBlockUtil.get(existing).equals(existingBaseBlock) && existing.getBlockData().matches(blockData)) { | ||||||
|                 return; |                 return; | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -166,6 +166,7 @@ public class StateWrapper { | |||||||
|         return str; |         return str; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @SuppressWarnings("deprecation") // #setLine is needed for Spigot compatibility | ||||||
|     public boolean restoreTag(String worldName, int x, int y, int z) { |     public boolean restoreTag(String worldName, int x, int y, int z) { | ||||||
|         if (this.tag == null) { |         if (this.tag == null) { | ||||||
|             return false; |             return false; | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -188,7 +188,7 @@ public class BukkitEntityUtil { | |||||||
|                 if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY + "." + stub)) { |                 if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY + "." + stub)) { | ||||||
|                     plotPlayer.sendMessage( |                     plotPlayer.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission_event"), |                             TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                             Template.template("node", Permission.PERMISSION_ADMIN_DESTROY + "." + stub) |                             Template.of("node", Permission.PERMISSION_ADMIN_DESTROY + "." + stub) | ||||||
|                     ); |                     ); | ||||||
|                     return false; |                     return false; | ||||||
|                 } |                 } | ||||||
| @@ -200,7 +200,7 @@ public class BukkitEntityUtil { | |||||||
|                 if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY + "." + stub)) { |                 if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY + "." + stub)) { | ||||||
|                     plotPlayer.sendMessage( |                     plotPlayer.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission_event"), |                             TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                             Template.template("node", Permission.PERMISSION_ADMIN_DESTROY + "." + stub) |                             Template.of("node", Permission.PERMISSION_ADMIN_DESTROY + "." + stub) | ||||||
|                     ); |                     ); | ||||||
|                     if (plot != null) { |                     if (plot != null) { | ||||||
|                         plot.debug(player.getName() |                         plot.debug(player.getName() | ||||||
| @@ -221,7 +221,7 @@ public class BukkitEntityUtil { | |||||||
|                 if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) { |                 if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) { | ||||||
|                     plotPlayer.sendMessage( |                     plotPlayer.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission_event"), |                             TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                             Template.template("node", Permission.PERMISSION_ADMIN_PVE + "." + stub) |                             Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub) | ||||||
|                     ); |                     ); | ||||||
|                     if (plot != null) { |                     if (plot != null) { | ||||||
|                         plot.debug(player.getName() + " could not attack " + entityType |                         plot.debug(player.getName() + " could not attack " + entityType | ||||||
| @@ -242,7 +242,7 @@ public class BukkitEntityUtil { | |||||||
|                 if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) { |                 if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) { | ||||||
|                     plotPlayer.sendMessage( |                     plotPlayer.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission_event"), |                             TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                             Template.template("node", Permission.PERMISSION_ADMIN_PVE + "." + stub) |                             Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub) | ||||||
|                     ); |                     ); | ||||||
|                     if (plot != null) { |                     if (plot != null) { | ||||||
|                         plot.debug(player.getName() + " could not attack " + entityType |                         plot.debug(player.getName() + " could not attack " + entityType | ||||||
| @@ -256,7 +256,7 @@ public class BukkitEntityUtil { | |||||||
|                             .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVP + "." + stub)) { |                             .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVP + "." + stub)) { | ||||||
|                         plotPlayer.sendMessage( |                         plotPlayer.sendMessage( | ||||||
|                                 TranslatableCaption.of("permission.no_permission_event"), |                                 TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                                 Template.template("node", Permission.PERMISSION_ADMIN_PVP + "." + stub) |                                 Template.of("node", Permission.PERMISSION_ADMIN_PVP + "." + stub) | ||||||
|                         ); |                         ); | ||||||
|                         plot.debug(player.getName() + " could not attack " + entityType |                         plot.debug(player.getName() + " could not attack " + entityType | ||||||
|                                 + " because pve = false"); |                                 + " because pve = false"); | ||||||
| @@ -270,7 +270,7 @@ public class BukkitEntityUtil { | |||||||
|                 if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVP + "." + stub)) { |                 if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVP + "." + stub)) { | ||||||
|                     plotPlayer.sendMessage( |                     plotPlayer.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission_event"), |                             TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                             Template.template("node", Permission.PERMISSION_ADMIN_PVP + "." + stub) |                             Template.of("node", Permission.PERMISSION_ADMIN_PVP + "." + stub) | ||||||
|                     ); |                     ); | ||||||
|                     return false; |                     return false; | ||||||
|                 } |                 } | ||||||
| @@ -287,7 +287,7 @@ public class BukkitEntityUtil { | |||||||
|                 if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) { |                 if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) { | ||||||
|                     plotPlayer.sendMessage( |                     plotPlayer.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission_event"), |                             TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                             Template.template("node", Permission.PERMISSION_ADMIN_PVE + "." + stub) |                             Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub) | ||||||
|                     ); |                     ); | ||||||
|                     if (plot != null) { |                     if (plot != null) { | ||||||
|                         plot.debug(player.getName() + " could not attack " + entityType |                         plot.debug(player.getName() + " could not attack " + entityType | ||||||
| @@ -309,7 +309,7 @@ public class BukkitEntityUtil { | |||||||
|                 if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) { |                 if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) { | ||||||
|                     plotPlayer.sendMessage( |                     plotPlayer.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission_event"), |                             TranslatableCaption.of("permission.no_permission_event"), | ||||||
|                             Template.template("node", Permission.PERMISSION_ADMIN_PVE + "." + stub) |                             Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub) | ||||||
|                     ); |                     ); | ||||||
|                     if (plot != null) { |                     if (plot != null) { | ||||||
|                         plot.debug(player.getName() + " could not attack " + entityType |                         plot.debug(player.getName() + " could not attack " + entityType | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -77,6 +77,7 @@ public class BukkitInventoryUtil extends InventoryUtil { | |||||||
|         return stack; |         return stack; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @SuppressWarnings("deprecation") // Paper deprecation | ||||||
|     @Override |     @Override | ||||||
|     public void open(PlotInventory inv) { |     public void open(PlotInventory inv) { | ||||||
|         BukkitPlayer bp = (BukkitPlayer) inv.getPlayer(); |         BukkitPlayer bp = (BukkitPlayer) inv.getPlayer(); | ||||||
| @@ -113,6 +114,7 @@ public class BukkitInventoryUtil extends InventoryUtil { | |||||||
|         bp.player.updateInventory(); |         bp.player.updateInventory(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @SuppressWarnings("deprecation") // Paper deprecation | ||||||
|     public PlotItemStack getItem(ItemStack item) { |     public PlotItemStack getItem(ItemStack item) { | ||||||
|         if (item == null) { |         if (item == null) { | ||||||
|             return null; |             return null; | ||||||
| @@ -145,6 +147,7 @@ public class BukkitInventoryUtil extends InventoryUtil { | |||||||
|                 .toArray(PlotItemStack[]::new); |                 .toArray(PlotItemStack[]::new); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @SuppressWarnings("deprecation") // #getTitle is needed for Spigot compatibility | ||||||
|     @Override |     @Override | ||||||
|     public boolean isOpen(PlotInventory plotInventory) { |     public boolean isOpen(PlotInventory plotInventory) { | ||||||
|         if (!plotInventory.isOpen()) { |         if (!plotInventory.isOpen()) { | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -54,7 +54,6 @@ import io.papermc.lib.PaperLib; | |||||||
| import net.kyori.adventure.platform.bukkit.BukkitAudiences; | import net.kyori.adventure.platform.bukkit.BukkitAudiences; | ||||||
| import net.kyori.adventure.text.minimessage.MiniMessage; | import net.kyori.adventure.text.minimessage.MiniMessage; | ||||||
| import net.kyori.adventure.text.minimessage.Template; | import net.kyori.adventure.text.minimessage.Template; | ||||||
| import net.kyori.adventure.text.minimessage.template.TemplateResolver; |  | ||||||
| import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; | import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; | ||||||
| import org.apache.logging.log4j.LogManager; | import org.apache.logging.log4j.LogManager; | ||||||
| import org.apache.logging.log4j.Logger; | import org.apache.logging.log4j.Logger; | ||||||
| @@ -370,8 +369,7 @@ public class BukkitUtil extends WorldUtil { | |||||||
|             if (blockstate instanceof final Sign sign) { |             if (blockstate instanceof final Sign sign) { | ||||||
|                 for (int i = 0; i < lines.length; i++) { |                 for (int i = 0; i < lines.length; i++) { | ||||||
|                     sign.setLine(i, LEGACY_COMPONENT_SERIALIZER |                     sign.setLine(i, LEGACY_COMPONENT_SERIALIZER | ||||||
|                             .serialize(MINI_MESSAGE.deserialize(lines[i].getComponent(LocaleHolder.console()), |                             .serialize(MINI_MESSAGE.parse(lines[i].getComponent(LocaleHolder.console()), replacements))); | ||||||
|                                     TemplateResolver.templates(replacements)))); |  | ||||||
|                 } |                 } | ||||||
|                 sign.update(true); |                 sign.update(true); | ||||||
|             } |             } | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -61,6 +61,7 @@ public class UpdateUtility implements Listener { | |||||||
|         internalVersion = PlotSquared.get().getVersion(); |         internalVersion = PlotSquared.get().getVersion(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @SuppressWarnings({"deprecation", "DefaultCharset"}) // Suppress Json deprecation, we can't use features from gson 2.8.1 and newer yet | ||||||
|     public void updateChecker() { |     public void updateChecker() { | ||||||
|         task = Bukkit.getScheduler().runTaskTimerAsynchronously(this.javaPlugin, () -> { |         task = Bukkit.getScheduler().runTaskTimerAsynchronously(this.javaPlugin, () -> { | ||||||
|             try { |             try { | ||||||
| @@ -68,7 +69,7 @@ public class UpdateUtility implements Listener { | |||||||
|                         "https://api.spigotmc.org/simple/0.1/index.php?action=getResource&id=77506") |                         "https://api.spigotmc.org/simple/0.1/index.php?action=getResource&id=77506") | ||||||
|                         .openConnection(); |                         .openConnection(); | ||||||
|                 connection.setRequestMethod("GET"); |                 connection.setRequestMethod("GET"); | ||||||
|                 JsonObject result = (new JsonParser()) |                 JsonObject result = new JsonParser() | ||||||
|                         .parse(new JsonReader(new InputStreamReader(connection.getInputStream()))) |                         .parse(new JsonReader(new InputStreamReader(connection.getInputStream()))) | ||||||
|                         .getAsJsonObject(); |                         .getAsJsonObject(); | ||||||
|                 spigotVersion = result.get("current_version").getAsString(); |                 spigotVersion = result.get("current_version").getAsString(); | ||||||
| @@ -91,7 +92,7 @@ public class UpdateUtility implements Listener { | |||||||
|                 notify = false; |                 notify = false; | ||||||
|                 LOGGER.info("Congratulations! You are running the latest PlotSquared version"); |                 LOGGER.info("Congratulations! You are running the latest PlotSquared version"); | ||||||
|             } |             } | ||||||
|         }, 0L, Settings.UpdateChecker.POLL_RATE * 60 * 20); |         }, 0L, (long) Settings.UpdateChecker.POLL_RATE * 60 * 20); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     private void cancelTask() { |     private void cancelTask() { | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -75,6 +75,7 @@ public class FaweSchematicHandler extends SchematicHandler { | |||||||
|         return delegate.save(tag, path); |         return delegate.save(tag, path); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @SuppressWarnings("removal") // Just the override | ||||||
|     @Override |     @Override | ||||||
|     public void upload(final CompoundTag tag, final UUID uuid, final String file, final RunnableVal<URL> whenDone) { |     public void upload(final CompoundTag tag, final UUID uuid, final String file, final RunnableVal<URL> whenDone) { | ||||||
|         delegate.upload(tag, uuid, file, whenDone); |         delegate.upload(tag, uuid, file, whenDone); | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -22,7 +22,7 @@ dependencies { | |||||||
|     api(libs.guiceassistedinject) { |     api(libs.guiceassistedinject) { | ||||||
|         exclude("com.google.inject", "guice") |         exclude("com.google.inject", "guice") | ||||||
|     } |     } | ||||||
|     compileOnlyApi(libs.findbugs) |     api(libs.findbugs) | ||||||
|  |  | ||||||
|     // Plugins |     // Plugins | ||||||
|     compileOnly(libs.worldeditCore) { |     compileOnly(libs.worldeditCore) { | ||||||
| @@ -40,9 +40,7 @@ dependencies { | |||||||
|     // Other libraries |     // Other libraries | ||||||
|     api(libs.prtree) |     api(libs.prtree) | ||||||
|     api(libs.aopalliance) |     api(libs.aopalliance) | ||||||
|     api(libs.rorledning) { |     api(libs.cloudServices) | ||||||
|         exclude(group = "com.google.guava") |  | ||||||
|     } |  | ||||||
|     api(libs.arkitektonika) |     api(libs.arkitektonika) | ||||||
|     api(libs.paster) |     api(libs.paster) | ||||||
| } | } | ||||||
| @@ -50,9 +48,9 @@ dependencies { | |||||||
| tasks.processResources { | tasks.processResources { | ||||||
|     filesMatching("plugin.properties") { |     filesMatching("plugin.properties") { | ||||||
|         expand( |         expand( | ||||||
|             "version" to project.version.toString(), |                 "version" to project.version.toString(), | ||||||
|             "commit" to rootProject.grgit.head().abbreviatedId, |                 "commit" to rootProject.grgit.head().abbreviatedId, | ||||||
|             "date" to rootProject.grgit.head().dateTime.format(DateTimeFormatter.ofPattern("yy.MM.dd")) |                 "date" to rootProject.grgit.head().dateTime.format(DateTimeFormatter.ofPattern("yy.MM.dd")) | ||||||
|         ) |         ) | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -25,10 +25,10 @@ | |||||||
|  */ |  */ | ||||||
| package com.plotsquared.core; | package com.plotsquared.core; | ||||||
|  |  | ||||||
|  | import cloud.commandframework.services.ServicePipeline; | ||||||
| import com.google.inject.Injector; | import com.google.inject.Injector; | ||||||
| import com.google.inject.Key; | import com.google.inject.Key; | ||||||
| import com.google.inject.TypeLiteral; | import com.google.inject.TypeLiteral; | ||||||
| import com.intellectualsites.services.ServicePipeline; |  | ||||||
| import com.plotsquared.core.backup.BackupManager; | import com.plotsquared.core.backup.BackupManager; | ||||||
| import com.plotsquared.core.configuration.caption.LocaleHolder; | import com.plotsquared.core.configuration.caption.LocaleHolder; | ||||||
| import com.plotsquared.core.generator.GeneratorWrapper; | import com.plotsquared.core.generator.GeneratorWrapper; | ||||||
| @@ -40,6 +40,7 @@ import com.plotsquared.core.permissions.PermissionHandler; | |||||||
| import com.plotsquared.core.player.PlotPlayer; | import com.plotsquared.core.player.PlotPlayer; | ||||||
| import com.plotsquared.core.plot.world.PlotAreaManager; | import com.plotsquared.core.plot.world.PlotAreaManager; | ||||||
| import com.plotsquared.core.queue.GlobalBlockQueue; | import com.plotsquared.core.queue.GlobalBlockQueue; | ||||||
|  | import com.plotsquared.core.util.AnnotationHelper; | ||||||
| import com.plotsquared.core.util.ChunkManager; | import com.plotsquared.core.util.ChunkManager; | ||||||
| import com.plotsquared.core.util.EconHandler; | import com.plotsquared.core.util.EconHandler; | ||||||
| import com.plotsquared.core.util.PlatformWorldManager; | import com.plotsquared.core.util.PlatformWorldManager; | ||||||
| @@ -291,6 +292,15 @@ public interface PlotPlatform<P> extends LocaleHolder { | |||||||
|      */ |      */ | ||||||
|     @NonNull String pluginsFormatted(); |     @NonNull String pluginsFormatted(); | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * Get the kind of WorldEdit implementation | ||||||
|  |      * | ||||||
|  |      * @return worldedit implementations | ||||||
|  |      * @since 6.3.0 | ||||||
|  |      */ | ||||||
|  |     @AnnotationHelper.ApiDescription(info = "Internal use only") | ||||||
|  |     @NonNull String worldEditImplementations(); | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * Load the caption maps |      * Load the caption maps | ||||||
|      */ |      */ | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -342,6 +342,7 @@ public class PlotSquared { | |||||||
|      * @param plotArea the {@link PlotArea} to add. |      * @param plotArea the {@link PlotArea} to add. | ||||||
|      * @see #removePlotArea(PlotArea) To remove the reference |      * @see #removePlotArea(PlotArea) To remove the reference | ||||||
|      */ |      */ | ||||||
|  |     @SuppressWarnings("unchecked") | ||||||
|     public void addPlotArea(final @NonNull PlotArea plotArea) { |     public void addPlotArea(final @NonNull PlotArea plotArea) { | ||||||
|         HashMap<PlotId, Plot> plots; |         HashMap<PlotId, Plot> plots; | ||||||
|         if (plots_tmp == null || (plots = plots_tmp.remove(plotArea.toString())) == null) { |         if (plots_tmp == null || (plots = plots_tmp.remove(plotArea.toString())) == null) { | ||||||
| @@ -556,6 +557,7 @@ public class PlotSquared { | |||||||
|      * |      * | ||||||
|      * @param input an array of plots to sort |      * @param input an array of plots to sort | ||||||
|      */ |      */ | ||||||
|  |     @SuppressWarnings("unchecked") | ||||||
|     private void sortPlotsByHash(final @NonNull Plot @NonNull [] input) { |     private void sortPlotsByHash(final @NonNull Plot @NonNull [] input) { | ||||||
|         List<Plot>[] bucket = new ArrayList[32]; |         List<Plot>[] bucket = new ArrayList[32]; | ||||||
|         Arrays.fill(bucket, new ArrayList<>()); |         Arrays.fill(bucket, new ArrayList<>()); | ||||||
| @@ -696,20 +698,12 @@ public class PlotSquared { | |||||||
|         ArrayList<Plot> toReturn = new ArrayList<>(plots.size()); |         ArrayList<Plot> toReturn = new ArrayList<>(plots.size()); | ||||||
|         for (PlotArea area : areas) { |         for (PlotArea area : areas) { | ||||||
|             switch (type) { |             switch (type) { | ||||||
|                 case CREATION_DATE: |                 case CREATION_DATE -> toReturn.addAll(sortPlotsByTemp(map.get(area))); | ||||||
|                     toReturn.addAll(sortPlotsByTemp(map.get(area))); |                 case CREATION_DATE_TIMESTAMP -> toReturn.addAll(sortPlotsByTimestamp(map.get(area))); | ||||||
|                     break; |                 case DISTANCE_FROM_ORIGIN -> toReturn.addAll(sortPlotsByHash(map.get(area))); | ||||||
|                 case CREATION_DATE_TIMESTAMP: |                 case LAST_MODIFIED -> toReturn.addAll(sortPlotsByModified(map.get(area))); | ||||||
|                     toReturn.addAll(sortPlotsByTimestamp(map.get(area))); |                 default -> { | ||||||
|                     break; |                 } | ||||||
|                 case DISTANCE_FROM_ORIGIN: |  | ||||||
|                     toReturn.addAll(sortPlotsByHash(map.get(area))); |  | ||||||
|                     break; |  | ||||||
|                 case LAST_MODIFIED: |  | ||||||
|                     toReturn.addAll(sortPlotsByModified(map.get(area))); |  | ||||||
|                     break; |  | ||||||
|                 default: |  | ||||||
|                     break; |  | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         return toReturn; |         return toReturn; | ||||||
| @@ -1540,7 +1534,7 @@ public class PlotSquared { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * Register a caption map. The namespace needs be equal to the namespace used for |      * Register a caption map. The namespace needs to be equal to the namespace used for | ||||||
|      * the {@link TranslatableCaption}s inside the map. |      * the {@link TranslatableCaption}s inside the map. | ||||||
|      * |      * | ||||||
|      * @param namespace  Namespace |      * @param namespace  Namespace | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -107,7 +107,7 @@ public class SimpleBackupManager implements BackupManager { | |||||||
|             if (player != null) { |             if (player != null) { | ||||||
|                 player.sendMessage( |                 player.sendMessage( | ||||||
|                         TranslatableCaption.of("backups.backup_automatic_started"), |                         TranslatableCaption.of("backups.backup_automatic_started"), | ||||||
|                         Template.template("plot", plot.getId().toString()) |                         Template.of("plot", plot.getId().toString()) | ||||||
|                 ); |                 ); | ||||||
|             } |             } | ||||||
|             profile.createBackup().whenComplete((backup, throwable) -> { |             profile.createBackup().whenComplete((backup, throwable) -> { | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -29,7 +29,8 @@ import java.util.Arrays; | |||||||
|  |  | ||||||
| public class ArrayUtil { | public class ArrayUtil { | ||||||
|  |  | ||||||
|     public static final <T> T[] concatAll(T[] first, T[]... rest) { |     @SuppressWarnings("unchecked") | ||||||
|  |     public static <T> T[] concatAll(T[] first, T[]... rest) { | ||||||
|         int totalLength = first.length; |         int totalLength = first.length; | ||||||
|         for (T[] array : rest) { |         for (T[] array : rest) { | ||||||
|             totalLength += array.length; |             totalLength += array.length; | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -35,6 +35,7 @@ public class FlatRandomCollection<T> extends RandomCollection<T> { | |||||||
|  |  | ||||||
|     private final T[] values; |     private final T[] values; | ||||||
|  |  | ||||||
|  |     @SuppressWarnings("unchecked") | ||||||
|     public FlatRandomCollection(Map<T, Double> weights, Random random) { |     public FlatRandomCollection(Map<T, Double> weights, Random random) { | ||||||
|         super(weights, random); |         super(weights, random); | ||||||
|         int max = 0; |         int max = 0; | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -241,6 +241,7 @@ public class QuadMap<T> { | |||||||
|         return false; |         return false; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @SuppressWarnings("unchecked") | ||||||
|     public void recalculateSkip() { |     public void recalculateSkip() { | ||||||
|         QuadMap<T> map = null; |         QuadMap<T> map = null; | ||||||
|         for (QuadMap<T> current : new QuadMap[]{this.one, this.two, this.three, this.four}) { |         for (QuadMap<T> current : new QuadMap[]{this.one, this.two, this.three, this.four}) { | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -77,7 +77,7 @@ public class Add extends Command { | |||||||
|                 TranslatableCaption.of("permission.no_plot_perms") |                 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.template("value", "/plot add <player | *>") |                 Template.of("value", "/plot add <player | *>") | ||||||
|         ); |         ); | ||||||
|         final CompletableFuture<Boolean> future = new CompletableFuture<>(); |         final CompletableFuture<Boolean> future = new CompletableFuture<>(); | ||||||
|         PlayerManager.getUUIDsFromString(args[0], (uuids, throwable) -> { |         PlayerManager.getUUIDsFromString(args[0], (uuids, throwable) -> { | ||||||
| @@ -87,7 +87,7 @@ public class Add extends Command { | |||||||
|                 } else { |                 } else { | ||||||
|                     player.sendMessage( |                     player.sendMessage( | ||||||
|                             TranslatableCaption.of("errors.invalid_player"), |                             TranslatableCaption.of("errors.invalid_player"), | ||||||
|                             Template.template("value", args[0]) |                             Template.of("value", args[0]) | ||||||
|                     ); |                     ); | ||||||
|                 } |                 } | ||||||
|                 future.completeExceptionally(throwable); |                 future.completeExceptionally(throwable); | ||||||
| @@ -95,7 +95,7 @@ public class Add extends Command { | |||||||
|             } else { |             } else { | ||||||
|                 try { |                 try { | ||||||
|                     checkTrue(!uuids.isEmpty(), TranslatableCaption.of("errors.invalid_player"), |                     checkTrue(!uuids.isEmpty(), TranslatableCaption.of("errors.invalid_player"), | ||||||
|                             Template.template("value", args[0]) |                             Template.of("value", args[0]) | ||||||
|                     ); |                     ); | ||||||
|                     Iterator<UUID> iterator = uuids.iterator(); |                     Iterator<UUID> iterator = uuids.iterator(); | ||||||
|                     int size = plot.getTrusted().size() + plot.getMembers().size(); |                     int size = plot.getTrusted().size() + plot.getMembers().size(); | ||||||
| @@ -106,7 +106,7 @@ public class Add extends Command { | |||||||
|                                         .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_TRUST))) { |                                         .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_TRUST))) { | ||||||
|                             player.sendMessage( |                             player.sendMessage( | ||||||
|                                     TranslatableCaption.of("errors.invalid_player"), |                                     TranslatableCaption.of("errors.invalid_player"), | ||||||
|                                     Template.template("value", PlayerManager.getName(uuid)) |                                     Template.of("value", PlayerManager.resolveName(uuid).getComponent(player)) | ||||||
|                             ); |                             ); | ||||||
|                             iterator.remove(); |                             iterator.remove(); | ||||||
|                             continue; |                             continue; | ||||||
| @@ -114,7 +114,7 @@ public class Add extends Command { | |||||||
|                         if (plot.isOwner(uuid)) { |                         if (plot.isOwner(uuid)) { | ||||||
|                             player.sendMessage( |                             player.sendMessage( | ||||||
|                                     TranslatableCaption.of("member.already_added"), |                                     TranslatableCaption.of("member.already_added"), | ||||||
|                                     Template.template("player", PlayerManager.getName(uuid)) |                                     Template.of("player", PlayerManager.resolveName(uuid).getComponent(player)) | ||||||
|                             ); |                             ); | ||||||
|                             iterator.remove(); |                             iterator.remove(); | ||||||
|                             continue; |                             continue; | ||||||
| @@ -122,7 +122,7 @@ public class Add extends Command { | |||||||
|                         if (plot.getMembers().contains(uuid)) { |                         if (plot.getMembers().contains(uuid)) { | ||||||
|                             player.sendMessage( |                             player.sendMessage( | ||||||
|                                     TranslatableCaption.of("member.already_added"), |                                     TranslatableCaption.of("member.already_added"), | ||||||
|                                     Template.template("player", PlayerManager.getName(uuid)) |                                     Template.of("player", PlayerManager.resolveName(uuid).getComponent(player)) | ||||||
|                             ); |                             ); | ||||||
|                             iterator.remove(); |                             iterator.remove(); | ||||||
|                             continue; |                             continue; | ||||||
| @@ -135,7 +135,7 @@ public class Add extends Command { | |||||||
|                     if (localAddSize >= maxAddSize) { |                     if (localAddSize >= maxAddSize) { | ||||||
|                         player.sendMessage( |                         player.sendMessage( | ||||||
|                                 TranslatableCaption.of("members.plot_max_members_added"), |                                 TranslatableCaption.of("members.plot_max_members_added"), | ||||||
|                                 Template.template("amount", String.valueOf(localAddSize)) |                                 Template.of("amount", String.valueOf(localAddSize)) | ||||||
|                         ); |                         ); | ||||||
|                         return; |                         return; | ||||||
|                     } |                     } | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -99,7 +99,7 @@ public class Alias extends SubCommand { | |||||||
|                 } else { |                 } else { | ||||||
|                     player.sendMessage( |                     player.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission"), |                             TranslatableCaption.of("permission.no_permission"), | ||||||
|                             Template.template("node", String.valueOf(Permission.PERMISSION_ALIAS_SET)) |                             Template.of("node", String.valueOf(Permission.PERMISSION_ALIAS_SET)) | ||||||
|                     ); |                     ); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
| @@ -115,7 +115,7 @@ public class Alias extends SubCommand { | |||||||
|                 } else { |                 } else { | ||||||
|                     player.sendMessage( |                     player.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission"), |                             TranslatableCaption.of("permission.no_permission"), | ||||||
|                             Template.template("node", String.valueOf(Permission.PERMISSION_ALIAS_REMOVE)) |                             Template.of("node", String.valueOf(Permission.PERMISSION_ALIAS_REMOVE)) | ||||||
|                     ); |                     ); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
| @@ -156,13 +156,13 @@ public class Alias extends SubCommand { | |||||||
|                     .anyMatch()) { |                     .anyMatch()) { | ||||||
|                 player.sendMessage( |                 player.sendMessage( | ||||||
|                         TranslatableCaption.of("alias.alias_is_taken"), |                         TranslatableCaption.of("alias.alias_is_taken"), | ||||||
|                         Template.template("alias", alias) |                         Template.of("alias", alias) | ||||||
|                 ); |                 ); | ||||||
|                 return; |                 return; | ||||||
|             } |             } | ||||||
|             if (Settings.UUID.OFFLINE) { |             if (Settings.UUID.OFFLINE) { | ||||||
|                 plot.setAlias(alias); |                 plot.setAlias(alias); | ||||||
|                 player.sendMessage(TranslatableCaption.of("alias.alias_set_to"), Template.template("alias", alias)); |                 player.sendMessage(TranslatableCaption.of("alias.alias_set_to"), Template.of("alias", alias)); | ||||||
|                 return; |                 return; | ||||||
|             } |             } | ||||||
|             PlotSquared.get().getImpromptuUUIDPipeline().getSingle(alias, ((uuid, throwable) -> { |             PlotSquared.get().getImpromptuUUIDPipeline().getSingle(alias, ((uuid, throwable) -> { | ||||||
| @@ -171,13 +171,13 @@ public class Alias extends SubCommand { | |||||||
|                 } else if (uuid != null) { |                 } else if (uuid != null) { | ||||||
|                     player.sendMessage( |                     player.sendMessage( | ||||||
|                             TranslatableCaption.of("alias.alias_is_taken"), |                             TranslatableCaption.of("alias.alias_is_taken"), | ||||||
|                             Template.template("alias", alias) |                             Template.of("alias", alias) | ||||||
|                     ); |                     ); | ||||||
|                 } else { |                 } else { | ||||||
|                     plot.setAlias(alias); |                     plot.setAlias(alias); | ||||||
|                     player.sendMessage( |                     player.sendMessage( | ||||||
|                             TranslatableCaption.of("alias.alias_set_to"), |                             TranslatableCaption.of("alias.alias_set_to"), | ||||||
|                             Template.template("alias", alias) |                             Template.of("alias", alias) | ||||||
|                     ); |                     ); | ||||||
|                 } |                 } | ||||||
|             })); |             })); | ||||||
| @@ -189,7 +189,7 @@ public class Alias extends SubCommand { | |||||||
|         if (!plot.getAlias().isEmpty()) { |         if (!plot.getAlias().isEmpty()) { | ||||||
|             player.sendMessage( |             player.sendMessage( | ||||||
|                     TranslatableCaption.of("alias.alias_removed"), |                     TranslatableCaption.of("alias.alias_removed"), | ||||||
|                     Template.template("alias", alias) |                     Template.of("alias", alias) | ||||||
|             ); |             ); | ||||||
|         } else { |         } else { | ||||||
|             player.sendMessage( |             player.sendMessage( | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  *                                    | | |  *                                    | | | ||||||
|  *                                    |_| |  *                                    |_| | ||||||
|  *            PlotSquared plot management system for Minecraft |  *            PlotSquared plot management system for Minecraft | ||||||
|  *                  Copyright (C) 2021 IntellectualSites |  *               Copyright (C) 2014 - 2022 IntellectualSites | ||||||
|  * |  * | ||||||
|  *     This program is free software: you can redistribute it and/or modify |  *     This program is free software: you can redistribute it and/or modify | ||||||
|  *     it under the terms of the GNU General Public License as published by |  *     it under the terms of the GNU General Public License as published by | ||||||
| @@ -76,7 +76,6 @@ import com.sk89q.worldedit.math.BlockVector3; | |||||||
| import com.sk89q.worldedit.regions.CuboidRegion; | import com.sk89q.worldedit.regions.CuboidRegion; | ||||||
| import com.sk89q.worldedit.regions.Region; | import com.sk89q.worldedit.regions.Region; | ||||||
| import net.kyori.adventure.text.minimessage.Template; | import net.kyori.adventure.text.minimessage.Template; | ||||||
| import net.kyori.adventure.text.minimessage.template.TemplateResolver; |  | ||||||
| import org.checkerframework.checker.nullness.qual.NonNull; | import org.checkerframework.checker.nullness.qual.NonNull; | ||||||
|  |  | ||||||
| import java.io.File; | import java.io.File; | ||||||
| @@ -148,14 +147,14 @@ public class Area extends SubCommand { | |||||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_CREATE)) { |                 if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_CREATE)) { | ||||||
|                     player.sendMessage( |                     player.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission"), |                             TranslatableCaption.of("permission.no_permission"), | ||||||
|                             Template.template("node", String.valueOf(Permission.PERMISSION_AREA_CREATE)) |                             Template.of("node", String.valueOf(Permission.PERMISSION_AREA_CREATE)) | ||||||
|                     ); |                     ); | ||||||
|                     return false; |                     return false; | ||||||
|                 } |                 } | ||||||
|                 if (args.length < 2) { |                 if (args.length < 2) { | ||||||
|                     player.sendMessage( |                     player.sendMessage( | ||||||
|                             TranslatableCaption.of("single.single_area_needs_name"), |                             TranslatableCaption.of("single.single_area_needs_name"), | ||||||
|                             Template.template("command", "/plot area single <name>") |                             Template.of("command", "/plot area single <name>") | ||||||
|                     ); |                     ); | ||||||
|                     return false; |                     return false; | ||||||
|                 } |                 } | ||||||
| @@ -286,7 +285,7 @@ public class Area extends SubCommand { | |||||||
|                     } else { |                     } else { | ||||||
|                         player.sendMessage( |                         player.sendMessage( | ||||||
|                                 TranslatableCaption.of("errors.error_create"), |                                 TranslatableCaption.of("errors.error_create"), | ||||||
|                                 Template.template("world", hybridPlotWorld.getWorldName()) |                                 Template.of("world", hybridPlotWorld.getWorldName()) | ||||||
|                         ); |                         ); | ||||||
|                     } |                     } | ||||||
|                 }; |                 }; | ||||||
| @@ -297,7 +296,7 @@ public class Area extends SubCommand { | |||||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_CREATE)) { |                 if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_CREATE)) { | ||||||
|                     player.sendMessage( |                     player.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission"), |                             TranslatableCaption.of("permission.no_permission"), | ||||||
|                             Template.template("node", String.valueOf(Permission.PERMISSION_AREA_CREATE)) |                             Template.of("node", String.valueOf(Permission.PERMISSION_AREA_CREATE)) | ||||||
|                     ); |                     ); | ||||||
|                     return false; |                     return false; | ||||||
|                 } |                 } | ||||||
| @@ -330,12 +329,12 @@ public class Area extends SubCommand { | |||||||
|                                 ); |                                 ); | ||||||
|                                 player.sendMessage( |                                 player.sendMessage( | ||||||
|                                         TranslatableCaption.of("set.set_attribute"), |                                         TranslatableCaption.of("set.set_attribute"), | ||||||
|                                         Template.template("attribute", "area_pos1"), |                                         Template.of("attribute", "area_pos1"), | ||||||
|                                         Template.template("value", location.getX() + "," + location.getZ()) |                                         Template.of("value", location.getX() + "," + location.getZ()) | ||||||
|                                 ); |                                 ); | ||||||
|                                 player.sendMessage( |                                 player.sendMessage( | ||||||
|                                         TranslatableCaption.of("area.set_pos2"), |                                         TranslatableCaption.of("area.set_pos2"), | ||||||
|                                         Template.template("command", "/plot area create pos2") |                                         Template.of("command", "/plot area create pos2") | ||||||
|                                 ); |                                 ); | ||||||
|                                 return true; |                                 return true; | ||||||
|                             } |                             } | ||||||
| @@ -375,7 +374,7 @@ public class Area extends SubCommand { | |||||||
|                                 if (!areas.isEmpty()) { |                                 if (!areas.isEmpty()) { | ||||||
|                                     player.sendMessage( |                                     player.sendMessage( | ||||||
|                                             TranslatableCaption.of("cluster.cluster_intersection"), |                                             TranslatableCaption.of("cluster.cluster_intersection"), | ||||||
|                                             Template.template("cluster", areas.iterator().next().toString()) |                                             Template.of("cluster", areas.iterator().next().toString()) | ||||||
|                                     ); |                                     ); | ||||||
|                                     return false; |                                     return false; | ||||||
|                                 } |                                 } | ||||||
| @@ -414,7 +413,7 @@ public class Area extends SubCommand { | |||||||
|                                     } else { |                                     } else { | ||||||
|                                         player.sendMessage( |                                         player.sendMessage( | ||||||
|                                                 TranslatableCaption.of("errors.error_create"), |                                                 TranslatableCaption.of("errors.error_create"), | ||||||
|                                                 Template.template("world", area.getWorldName()) |                                                 Template.of("world", area.getWorldName()) | ||||||
|                                         ); |                                         ); | ||||||
|                                     } |                                     } | ||||||
|                                 }; |                                 }; | ||||||
| @@ -448,7 +447,7 @@ public class Area extends SubCommand { | |||||||
|                         if (other != null && Objects.equals(pa.getId(), other.getId())) { |                         if (other != null && Objects.equals(pa.getId(), other.getId())) { | ||||||
|                             player.sendMessage( |                             player.sendMessage( | ||||||
|                                     TranslatableCaption.of("setup.setup_world_taken"), |                                     TranslatableCaption.of("setup.setup_world_taken"), | ||||||
|                                     Template.template("value", pa.toString()) |                                     Template.of("value", pa.toString()) | ||||||
|                             ); |                             ); | ||||||
|                             return false; |                             return false; | ||||||
|                         } |                         } | ||||||
| @@ -463,8 +462,8 @@ public class Area extends SubCommand { | |||||||
|                             if (pair.length != 2) { |                             if (pair.length != 2) { | ||||||
|                                 player.sendMessage( |                                 player.sendMessage( | ||||||
|                                         TranslatableCaption.of("commandconfig.command_syntax_extended"), |                                         TranslatableCaption.of("commandconfig.command_syntax_extended"), | ||||||
|                                         Template.template("value1,", getCommandString()), |                                         Template.of("value1,", getCommandString()), | ||||||
|                                         Template.template("value2", " create [world[:id]] [<modifier>=<value>]...") |                                         Template.of("value2", " create [world[:id]] [<modifier>=<value>]...") | ||||||
|                                 ); |                                 ); | ||||||
|                                 return false; |                                 return false; | ||||||
|                             } |                             } | ||||||
| @@ -500,8 +499,8 @@ public class Area extends SubCommand { | |||||||
|                                 default -> { |                                 default -> { | ||||||
|                                     player.sendMessage( |                                     player.sendMessage( | ||||||
|                                             TranslatableCaption.of("commandconfig.command_syntax_extended"), |                                             TranslatableCaption.of("commandconfig.command_syntax_extended"), | ||||||
|                                             Template.template("value1", getCommandString()), |                                             Template.of("value1", getCommandString()), | ||||||
|                                             Template.template("value2", " create [world[:id]] [<modifier>=<value>]...") |                                             Template.of("value2", " create [world[:id]] [<modifier>=<value>]...") | ||||||
|                                     ); |                                     ); | ||||||
|                                     return false; |                                     return false; | ||||||
|                                 } |                                 } | ||||||
| @@ -511,7 +510,7 @@ public class Area extends SubCommand { | |||||||
|                             if (this.worldUtil.isWorld(pa.getWorldName())) { |                             if (this.worldUtil.isWorld(pa.getWorldName())) { | ||||||
|                                 player.sendMessage( |                                 player.sendMessage( | ||||||
|                                         TranslatableCaption.of("setup.setup_world_taken"), |                                         TranslatableCaption.of("setup.setup_world_taken"), | ||||||
|                                         Template.template("value", pa.getWorldName()) |                                         Template.of("value", pa.getWorldName()) | ||||||
|                                 ); |                                 ); | ||||||
|                                 return false; |                                 return false; | ||||||
|                             } |                             } | ||||||
| @@ -532,7 +531,7 @@ public class Area extends SubCommand { | |||||||
|                                 } else { |                                 } else { | ||||||
|                                     player.sendMessage( |                                     player.sendMessage( | ||||||
|                                             TranslatableCaption.of("errors.error_create"), |                                             TranslatableCaption.of("errors.error_create"), | ||||||
|                                             Template.template("world", pa.getWorldName()) |                                             Template.of("world", pa.getWorldName()) | ||||||
|                                     ); |                                     ); | ||||||
|                                 } |                                 } | ||||||
|                                 try { |                                 try { | ||||||
| @@ -551,12 +550,12 @@ public class Area extends SubCommand { | |||||||
|                         if (pa.getId() == null) { |                         if (pa.getId() == null) { | ||||||
|                             player.sendMessage( |                             player.sendMessage( | ||||||
|                                     TranslatableCaption.of("commandconfig.command_syntax"), |                                     TranslatableCaption.of("commandconfig.command_syntax"), | ||||||
|                                     Template.template("value", getUsage()) |                                     Template.of("value", getUsage()) | ||||||
|                             ); |                             ); | ||||||
|                             player.sendMessage( |                             player.sendMessage( | ||||||
|                                     TranslatableCaption.of("commandconfig.command_syntax_extended"), |                                     TranslatableCaption.of("commandconfig.command_syntax_extended"), | ||||||
|                                     Template.template("value1", getCommandString()), |                                     Template.of("value1", getCommandString()), | ||||||
|                                     Template.template("value2", " create [world[:id]] [<modifier>=<value>]...") |                                     Template.of("value2", " create [world[:id]] [<modifier>=<value>]...") | ||||||
|                             ); |                             ); | ||||||
|                             return false; |                             return false; | ||||||
|                         } |                         } | ||||||
| @@ -573,7 +572,7 @@ public class Area extends SubCommand { | |||||||
|                         metaData.computeIfAbsent(player.getUUID(), missingUUID -> new HashMap<>()).put("area_create_area", pa); |                         metaData.computeIfAbsent(player.getUUID(), missingUUID -> new HashMap<>()).put("area_create_area", pa); | ||||||
|                         player.sendMessage( |                         player.sendMessage( | ||||||
|                                 TranslatableCaption.of("single.get_position"), |                                 TranslatableCaption.of("single.get_position"), | ||||||
|                                 Template.template("command", getCommandString()) |                                 Template.of("command", getCommandString()) | ||||||
|                         ); |                         ); | ||||||
|                         break; |                         break; | ||||||
|                 } |                 } | ||||||
| @@ -583,7 +582,7 @@ public class Area extends SubCommand { | |||||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_INFO)) { |                 if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_INFO)) { | ||||||
|                     player.sendMessage( |                     player.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission"), |                             TranslatableCaption.of("permission.no_permission"), | ||||||
|                             Template.template("node", String.valueOf(Permission.PERMISSION_AREA_INFO)) |                             Template.of("node", String.valueOf(Permission.PERMISSION_AREA_INFO)) | ||||||
|                     ); |                     ); | ||||||
|                     return false; |                     return false; | ||||||
|                 } |                 } | ||||||
| @@ -594,15 +593,15 @@ public class Area extends SubCommand { | |||||||
|                     default -> { |                     default -> { | ||||||
|                         player.sendMessage( |                         player.sendMessage( | ||||||
|                                 TranslatableCaption.of("commandconfig.command_syntax_extended"), |                                 TranslatableCaption.of("commandconfig.command_syntax_extended"), | ||||||
|                                 Template.template("value1", getCommandString()), |                                 Template.of("value1", getCommandString()), | ||||||
|                                 Template.template("value2", " info [area]") |                                 Template.of("value2", " info [area]") | ||||||
|                         ); |                         ); | ||||||
|                         return false; |                         return false; | ||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
|                 if (area == null) { |                 if (area == null) { | ||||||
|                     if (args.length == 2) { |                     if (args.length == 2) { | ||||||
|                         player.sendMessage(TranslatableCaption.of("errors.not_valid_plot_world"), Template.template("value", args[1])); |                         player.sendMessage(TranslatableCaption.of("errors.not_valid_plot_world"), Template.of("value", args[1])); | ||||||
|                     } else { |                     } else { | ||||||
|                         player.sendMessage(TranslatableCaption.of("errors.not_in_plot_world")); |                         player.sendMessage(TranslatableCaption.of("errors.not_in_plot_world")); | ||||||
|                     } |                     } | ||||||
| @@ -626,19 +625,19 @@ public class Area extends SubCommand { | |||||||
|                     percent = claimed == 0 ? 0 : 100d * claimed / Integer.MAX_VALUE; |                     percent = claimed == 0 ? 0 : 100d * claimed / Integer.MAX_VALUE; | ||||||
|                     region = "N/A"; |                     region = "N/A"; | ||||||
|                 } |                 } | ||||||
|                 Template headerTemplate = Template.template( |                 Template headerTemplate = Template.of( | ||||||
|                         "header", |                         "header", | ||||||
|                         TranslatableCaption.of("info.plot_info_header").getComponent(player) |                         TranslatableCaption.of("info.plot_info_header").getComponent(player) | ||||||
|                 ); |                 ); | ||||||
|                 Template nameTemplate = Template.template("name", name); |                 Template nameTemplate = Template.of("name", name); | ||||||
|                 Template typeTemplate = Template.template("type", area.getType().name()); |                 Template typeTemplate = Template.of("type", area.getType().name()); | ||||||
|                 Template terrainTemplate = Template.template("terrain", area.getTerrain().name()); |                 Template terrainTemplate = Template.of("terrain", area.getTerrain().name()); | ||||||
|                 Template usageTemplate = Template.template("usage", String.format("%.2f", percent)); |                 Template usageTemplate = Template.of("usage", String.format("%.2f", percent)); | ||||||
|                 Template claimedTemplate = Template.template("claimed", String.valueOf(claimed)); |                 Template claimedTemplate = Template.of("claimed", String.valueOf(claimed)); | ||||||
|                 Template clustersTemplate = Template.template("clusters", String.valueOf(clusters)); |                 Template clustersTemplate = Template.of("clusters", String.valueOf(clusters)); | ||||||
|                 Template regionTemplate = Template.template("region", region); |                 Template regionTemplate = Template.of("region", region); | ||||||
|                 Template generatorTemplate = Template.template("generator", generator); |                 Template generatorTemplate = Template.of("generator", generator); | ||||||
|                 Template footerTemplate = Template.template( |                 Template footerTemplate = Template.of( | ||||||
|                         "footer", |                         "footer", | ||||||
|                         TranslatableCaption.of("info.plot_info_footer").getComponent(player) |                         TranslatableCaption.of("info.plot_info_footer").getComponent(player) | ||||||
|                 ); |                 ); | ||||||
| @@ -661,7 +660,7 @@ public class Area extends SubCommand { | |||||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_LIST)) { |                 if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_LIST)) { | ||||||
|                     player.sendMessage( |                     player.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission"), |                             TranslatableCaption.of("permission.no_permission"), | ||||||
|                             Template.template("node", String.valueOf(Permission.PERMISSION_AREA_LIST)) |                             Template.of("node", String.valueOf(Permission.PERMISSION_AREA_LIST)) | ||||||
|                     ); |                     ); | ||||||
|                     return false; |                     return false; | ||||||
|                 } |                 } | ||||||
| @@ -678,13 +677,13 @@ public class Area extends SubCommand { | |||||||
|                     default: |                     default: | ||||||
|                         player.sendMessage( |                         player.sendMessage( | ||||||
|                                 TranslatableCaption.of("commandconfig.command_syntax_extended"), |                                 TranslatableCaption.of("commandconfig.command_syntax_extended"), | ||||||
|                                 Template.template("value1", getCommandString()), |                                 Template.of("value1", getCommandString()), | ||||||
|                                 Template.template("value2", " list [#]") |                                 Template.of("value2", " list [#]") | ||||||
|                         ); |                         ); | ||||||
|                         return false; |                         return false; | ||||||
|                 } |                 } | ||||||
|                 final List<PlotArea> areas = new ArrayList<>(Arrays.asList(this.plotAreaManager.getAllPlotAreas())); |                 final List<PlotArea> areas = new ArrayList<>(Arrays.asList(this.plotAreaManager.getAllPlotAreas())); | ||||||
|                 paginate(player, areas, 8, page, new RunnableVal3<>() { |                 paginate(player, areas, 8, page, new RunnableVal3<Integer, PlotArea, CaptionHolder>() { | ||||||
|                     @Override |                     @Override | ||||||
|                     public void run(Integer i, PlotArea area, CaptionHolder caption) { |                     public void run(Integer i, PlotArea area, CaptionHolder caption) { | ||||||
|                         String name; |                         String name; | ||||||
| @@ -705,27 +704,27 @@ public class Area extends SubCommand { | |||||||
|                             percent = claimed == 0 ? 0 : (double) claimed / Short.MAX_VALUE * Short.MAX_VALUE; |                             percent = claimed == 0 ? 0 : (double) claimed / Short.MAX_VALUE * Short.MAX_VALUE; | ||||||
|                             region = "N/A"; |                             region = "N/A"; | ||||||
|                         } |                         } | ||||||
|                         Template claimedTemplate = Template.template("claimed", String.valueOf(claimed)); |                         Template claimedTemplate = Template.of("claimed", String.valueOf(claimed)); | ||||||
|                         Template usageTemplate = Template.template("usage", String.format("%.2f", percent) + "%"); |                         Template usageTemplate = Template.of("usage", String.format("%.2f", percent) + "%"); | ||||||
|                         Template clustersTemplate = Template.template("clusters", String.valueOf(clusters)); |                         Template clustersTemplate = Template.of("clusters", String.valueOf(clusters)); | ||||||
|                         Template regionTemplate = Template.template("region", region); |                         Template regionTemplate = Template.of("region", region); | ||||||
|                         Template generatorTemplate = Template.template("generator", generator); |                         Template generatorTemplate = Template.of("generator", generator); | ||||||
|                         String tooltip = MINI_MESSAGE.serialize(MINI_MESSAGE |                         String tooltip = MINI_MESSAGE.serialize(MINI_MESSAGE | ||||||
|                                 .deserialize( |                                 .parse( | ||||||
|                                         TranslatableCaption.of("info.area_list_tooltip").getComponent(player), |                                         TranslatableCaption.of("info.area_list_tooltip").getComponent(player), | ||||||
|                                         TemplateResolver.templates(claimedTemplate, |                                         claimedTemplate, | ||||||
|                                                 usageTemplate, |                                         usageTemplate, | ||||||
|                                                 clustersTemplate, |                                         clustersTemplate, | ||||||
|                                                 regionTemplate, |                                         regionTemplate, | ||||||
|                                                 generatorTemplate) |                                         generatorTemplate | ||||||
|                                 )); |                                 )); | ||||||
|                         Template tooltipTemplate = Template.template("hover_info", tooltip); |                         Template tooltipTemplate = Template.of("hover_info", tooltip); | ||||||
|                         Template visitcmdTemplate = Template.template("command_tp", "/plot area tp " + area); |                         Template visitcmdTemplate = Template.of("command_tp", "/plot area tp " + area); | ||||||
|                         Template infocmdTemplate = Template.template("command_info", "/plot area info " + area); |                         Template infocmdTemplate = Template.of("command_info", "/plot area info " + area); | ||||||
|                         Template numberTemplate = Template.template("number", String.valueOf(i)); |                         Template numberTemplate = Template.of("number", String.valueOf(i)); | ||||||
|                         Template nameTemplate = Template.template("area_name", name); |                         Template nameTemplate = Template.of("area_name", name); | ||||||
|                         Template typeTemplate = Template.template("area_type", area.getType().name()); |                         Template typeTemplate = Template.of("area_type", area.getType().name()); | ||||||
|                         Template terrainTemplate = Template.template("area_terrain", area.getTerrain().name()); |                         Template terrainTemplate = Template.of("area_terrain", area.getTerrain().name()); | ||||||
|                         caption.set(TranslatableCaption.of("info.area_list_item")); |                         caption.set(TranslatableCaption.of("info.area_list_item")); | ||||||
|                         caption.setTemplates( |                         caption.setTemplates( | ||||||
|                                 tooltipTemplate, |                                 tooltipTemplate, | ||||||
| @@ -744,7 +743,7 @@ public class Area extends SubCommand { | |||||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_REGEN)) { |                 if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_REGEN)) { | ||||||
|                     player.sendMessage( |                     player.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission"), |                             TranslatableCaption.of("permission.no_permission"), | ||||||
|                             Template.template("node", String.valueOf(Permission.PERMISSION_AREA_REGEN)) |                             Template.of("node", String.valueOf(Permission.PERMISSION_AREA_REGEN)) | ||||||
|                     ); |                     ); | ||||||
|                     return false; |                     return false; | ||||||
|                 } |                 } | ||||||
| @@ -756,7 +755,7 @@ public class Area extends SubCommand { | |||||||
|                 if (area.getType() != PlotAreaType.PARTIAL) { |                 if (area.getType() != PlotAreaType.PARTIAL) { | ||||||
|                     player.sendMessage( |                     player.sendMessage( | ||||||
|                             TranslatableCaption.of("single.delete_world_region"), |                             TranslatableCaption.of("single.delete_world_region"), | ||||||
|                             Template.template("world", area.getWorldName()) |                             Template.of("world", area.getWorldName()) | ||||||
|                     ); |                     ); | ||||||
|                     return false; |                     return false; | ||||||
|                 } |                 } | ||||||
| @@ -777,20 +776,20 @@ public class Area extends SubCommand { | |||||||
|                 if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_TP)) { |                 if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_TP)) { | ||||||
|                     player.sendMessage( |                     player.sendMessage( | ||||||
|                             TranslatableCaption.of("permission.no_permission"), |                             TranslatableCaption.of("permission.no_permission"), | ||||||
|                             Template.template("node", String.valueOf(Permission.PERMISSION_AREA_TP)) |                             Template.of("node", String.valueOf(Permission.PERMISSION_AREA_TP)) | ||||||
|                     ); |                     ); | ||||||
|                     return false; |                     return false; | ||||||
|                 } |                 } | ||||||
|                 if (args.length != 2) { |                 if (args.length != 2) { | ||||||
|                     player.sendMessage( |                     player.sendMessage( | ||||||
|                             TranslatableCaption.of("commandconfig.command_syntax"), |                             TranslatableCaption.of("commandconfig.command_syntax"), | ||||||
|                             Template.template("value", "/plot area tp [area]") |                             Template.of("value", "/plot area tp [area]") | ||||||
|                     ); |                     ); | ||||||
|                     return false; |                     return false; | ||||||
|                 } |                 } | ||||||
|                 PlotArea area = this.plotAreaManager.getPlotAreaByString(args[1]); |                 PlotArea area = this.plotAreaManager.getPlotAreaByString(args[1]); | ||||||
|                 if (area == null) { |                 if (area == null) { | ||||||
|                     player.sendMessage(TranslatableCaption.of("errors.not_valid_plot_world"), Template.template("value", args[1])); |                     player.sendMessage(TranslatableCaption.of("errors.not_valid_plot_world"), Template.of("value", args[1])); | ||||||
|                     return false; |                     return false; | ||||||
|                 } |                 } | ||||||
|                 Location center; |                 Location center; | ||||||
|   | |||||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user