Compare commits

...

106 Commits

Author SHA1 Message Date
12463dbb1c refactor!: Align plugin's java version with API java version 2022-01-24 15:16:10 +01:00
6a5859ee0f build: Update release-drafter/release-drafter action to v5.17.6 (#3467)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-24 11:06:27 +01:00
59e0b4b67a feat: unknown owner(s) for plot expiry (#3452)
* feat: unknown owner(s) for plot expiry

* Sort plugins on `/plot debugpaste` alphabetically (#3447)

* feat: Sort plugins on debugpaste alphabetically

* Put (F[A])WE at the top

* feat: Add 1.18's music disc additions to `/plot music` (#3446)

* refactor: Prepare removal of our maven repository (#3451)

* Allow restoration of road schematic height calculation behaviour from pre 6.1.4 (#3444)

* refactor: Update SquirrelID GAV

* build: Release 6.3.0

* build: Back to snapshot for development

* fix: fallback method in BukkitQueueCoordinator uses world coordinates

* mark since tags as TODO

* fix: get the lowest diff for plot age

* fix: initialize with high value and better readability

* fix: no need for multiple age checks

* fix: address exceptions in plot analysis

* chore: address requested changes

* chore: Fix introduced violations

Co-authored-by: Alex <mc.cache@web.de>
Co-authored-by: Jordan <dordsor21@gmail.com>
2022-01-23 10:44:11 +01:00
5fc153d896 fix: PlayerInteractEvent does not necessarily interact with a block (#3463) 2022-01-22 17:25:41 +01:00
a003836dbc feat: plot-title flag value should allow single values (#3410) 2022-01-22 11:02:08 +01:00
42bf413528 chore: Address more violations 2022-01-20 21:01:38 +01:00
827f46566c draft: Address false positives in code style issues (#3461)
* chore: Address false positive code style issues

* chore: More work

* More work
2022-01-20 12:39:40 +01:00
6f4d2f6d5a Fix: Missing Component returns + plot info on unknown plot owner (#3449)
* Fix: getName should return something

* Fix caption typo

* Deprecate old getName methods + add new methods for username retrieval

* Remove wildcard import

* Use @since TODO instead of hard coded version

* chore: Update `@since` tags to TODO

Co-authored-by: NotMyFault <mc.cache@web.de>
2022-01-19 15:56:31 +01:00
6073b96317 feat: add worldname to the notify flags (#3457)
* feat: add worldname to the notify flags

* fix: change default message

* refactor: extract duplicated code

* fix: use area instead of world
2022-01-18 20:42:44 +01:00
74a490f9f0 build: Update release-drafter/release-drafter action to v5.17.5 (#3460)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-17 11:19:28 +01:00
3a752db698 build: Switch to Fawe release 2022-01-15 16:50:03 +01:00
7cdde5a822 build: Back to snapshot for development 2022-01-14 11:46:02 +01:00
8b6e7b2f2b build: Release 6.3.0 2022-01-14 11:14:00 +01:00
06f0b42a97 refactor: Update SquirrelID GAV 2022-01-14 10:58:44 +01:00
9a85080bf6 Allow restoration of road schematic height calculation behaviour from pre 6.1.4 (#3444) 2022-01-14 10:46:04 +01:00
d14d2caa2d refactor: Prepare removal of our maven repository (#3451) 2022-01-13 14:50:07 +01:00
bcfe7c58dd feat: Add 1.18's music disc additions to /plot music (#3446) 2022-01-12 22:22:01 +01:00
289f0f3bfd Sort plugins on /plot debugpaste alphabetically (#3447)
* feat: Sort plugins on debugpaste alphabetically

* Put (F[A])WE at the top
2022-01-12 22:21:51 +01:00
6fc4005c72 Fix for unwanted audio panning (#3430)
* Fixes https://github.com/IntellectualSites/PlotSquared/issues/3422

* Removed old code

Co-authored-by: Alex <mc.cache@web.de>
2022-01-11 11:02:23 +01:00
8f7c2e4c02 fix: /plot music being able to be used on unclaimed plots (#3432) 2022-01-11 11:01:36 +01:00
b43d08f4aa feat: Display explosion particles even after the event got canceled (with setting to control behavior) (#3436)
* feat: display explosion particles even after event cancel
And add settings option to change behavior

* refactor

* refactor: Change settings comment to clearer connect to it's purpose.
2022-01-10 13:18:19 +01:00
2c55c6a92e build: Update dependency org.checkerframework:checker-qual to v3.21.1 (#3441)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-10 11:26:53 +01:00
31f48cc7d1 Fix: 1.18 uses the same field as 1.17 for mustNotSave (#3428) 2022-01-05 21:22:09 +01:00
4b77f1ab28 Make road flags great again (#3420)
Fixes #3111
2022-01-05 21:21:58 +01:00
7cc38b5fa8 Fix: use ownersInclude instead of ownedBy where required (#3419)
* Fix: use ownersInclude instead of ownedBy where required
- Also account for multiple plot owners in Cluster player removal
- Add whereBasePlot to avoid merged plots listing multiple times if required
- Only use ownersInclude in visit if enabled in config
- Fixes #3143

* Remove static import
2022-01-05 21:21:48 +01:00
0c76d08b10 Only send border area exit message once (#3418)
Fixes #3335
2022-01-05 21:21:37 +01:00
9c474570c8 Fix: use portal corners to test for event cancellation as entity can be null (#3417)
* Fix: use portal corners to test for event cancellation as entity can be null

* Remove duplicate flag check?

* Simplify to Set#of
2022-01-05 21:21:25 +01:00
7e1d56c849 fix: Reimplement the "unknown owner" option to plot purge (#3412)
- Warn user that backgorund UUID caching may fix the issue
- Also correct the UUID set when purging based on "shared" (added) player
- Fixes #3353
2022-01-05 21:21:08 +01:00
07d0f124b4 ci: Let release drafter listen to forks too 2022-01-05 11:56:28 +01:00
8d6c621763 ci: Setup auto rebase (#3431) 2022-01-04 15:38:21 +01:00
cef7098014 build: Update plugin shadow to v7.1.2 (#3427)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-03 13:52:29 +01:00
e1efa7266e build: Update dependency cloud.commandframework:cloud-services to v1.6.1 (#3425)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-03 11:45:04 +01:00
f363941719 build: Update dependency org.apache.logging.log4j:log4j-api to v2.17.1 (#3426)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-03 11:14:52 +01:00
25095f4546 chore: Welcome 2022 2022-01-02 22:22:19 +01:00
fd0c2050d8 Refactor: Replace Rörledning with Cloud-Services (#3409)
* Refactor: Replace Rörledning with Cloud-Services

Cloud-Services is actually maintained, as opposed to Rörledning. Furthermore, Rörledning is available through Maven Central, whereas rörledning isn't.

This is a semi-breaking change, but because we relocate, it might be fine? Either way, this is a necessary change.

* build: Provide jsr at runtime

* Merge branch 'v6' into refactor/v6/cloud-services

Co-authored-by: NotMyFault <mc.cache@web.de>
2021-12-31 15:49:11 +01:00
07fdc94dd8 Account for mutability of plot objects when sending move/swap success messages (#3414)
Fixes #3337
2021-12-31 15:46:08 +01:00
b501a81e21 build: Exchange mvdwapi version to our ones 2021-12-31 01:29:30 +01:00
eb334b3aac Fix: add missing placeholders for plot info
Fixes #3339
2021-12-30 14:41:31 +00:00
a77a51b6f2 build: Back to snapshot for development 2021-12-30 10:31:08 +01:00
7d981bc610 build: Release 6.2.2 2021-12-30 10:14:15 +01:00
3eb485e900 refactor: Drop guava annotations and create annotation helper (#3389) 2021-12-29 16:18:19 +01:00
9f4af889f7 fix: npe thrown in entity spawn listener (#3399) 2021-12-27 11:01:28 +01:00
2559c889e2 build: Update dependency me.clip:placeholderapi to v2.11.1 (#3403)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-27 10:42:37 +01:00
2cf268b99c build: Update actions/setup-java action to v2.5.0 (#3404)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-27 10:42:07 +01:00
e6fad8309c build: Update dependency gradle to v7.3.3 (#3402)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-27 10:40:00 +01:00
7551450cf9 fix: Send user-friendly message on join of denied plot (#3388)
Also refactor local variable `now` to a more fitting name
2021-12-26 23:28:50 +01:00
e042566bb7 fix: Strip redundant space at flag collection (#3400) 2021-12-26 23:28:03 +01:00
1f26808c7b Don't return the "side" for world plots when accessing default home locations 2021-12-22 17:47:48 +00:00
a7026047d0 Adding gold at the end might stop the prefix weirdness? 2021-12-22 17:46:39 +00:00
af2613202d refactor: Satisfy Semgrep 2021-12-22 02:06:07 +01:00
3da1e9255a build: Update dependency me.clip:placeholderapi to v2.11.0 (#3395)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-21 10:49:47 +01:00
9394906a79 build: Update dependency org.checkerframework:checker-qual to v3.21.0 (#3394)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-20 13:47:16 +01:00
d881cb6084 build: Update dependency com.intellectualsites.paster:Paster to v1.1.3 (#3391)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-20 11:55:54 +01:00
b9d43897af build: Update dependency net.essentialsx:EssentialsX to v2.19.2 (#3392)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-20 11:55:46 +01:00
76b58485a9 build: Update actions/checkout action to v2.4.0 (#3393)
* build: Update actions/checkout action to v2.4.0

* chore: Invert bolt's status

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: NotMyFault <mc.cache@web.de>
2021-12-20 11:55:14 +01:00
7002df0bc7 build: Bump dependencies for 1.18 2021-12-18 23:10:41 +01:00
958aac3cb1 chore: Configure bolt 2021-12-18 13:12:00 +01:00
a93402e27b fix: Standardize projectile permissions (#3374)
* fix: Standardize projectile permissions

- Let all projectiles (not just splash potions) have a permissions check on throwing
- Fixes snowballs, eggs, etc. being able to be thrown when not added to the plot, etc.
- Fixes #2986 (splash potions only able being to be thrown when also added to the plot)
- Remove the specialized code for egg hatching as now eggs are cancelled entirely
- Remove the non-standard plots.projectile.unowned and plots.projectile.other permissions in favor of the standard admin ones

* docs: Add back deprecated projectile permissions

* docs: Update Core/src/main/java/com/plotsquared/core/permissions/Permission.java

Co-authored-by: Alex <mc.cache@web.de>

Co-authored-by: Alex <mc.cache@web.de>
2021-12-17 22:06:56 +01:00
92f41f43c5 fix: Ignore the use flag for liquid placement/removal (#3375)
Fixes #3069
2021-12-17 21:52:15 +01:00
392ee9fa07 ci: Escape workflow tasks 2021-12-17 21:36:56 +01:00
8859871e89 build: Back to snapshot for development 2021-12-14 23:14:35 +01:00
93d99630a9 build: Release 6.2.1 2021-12-14 23:06:55 +01:00
47ae79e123 Revert "refactor: Address MiniMessage deprecations (#3354)" (#3371)
This reverts commit f086826942.
2021-12-14 23:04:36 +01:00
f9ad00c2c8 build: Update dependency org.apache.logging.log4j:log4j-api to v2.16.0 (#3368)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-14 13:57:16 +01:00
566af259db build: Update dependency org.checkerframework:checker-qual to v3.20.0 (#3369)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-13 15:11:48 +01:00
d9a6431078 build: Back to snapshot for development 2021-12-13 13:47:28 +01:00
e9c9375e78 build: Release 6.2.0 2021-12-13 13:35:37 +01:00
7c99c8aabf build: Update dependency com.intellectualsites.arkitektonika:Arkitektonika-Client to v2.1.1 (#3365)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-13 11:31:15 +01:00
88eb8f88a7 build: Update com.fastasyncworldedit to v1.17-419
Closes #3363
2021-12-13 11:11:00 +01:00
fd118c2c37 build: Update com.sk89q.worldedit to v7.2.8 (#3364)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-13 10:42:47 +01:00
858b6b5471 tests: Move to JUnit 5 (#3357) 2021-12-13 10:41:36 +01:00
f086826942 refactor: Address MiniMessage deprecations (#3354)
* refactor: Address MiniMessage deprecations

* refactor: More MiniMessage deprecations

* Move away from our `Templates#of`

* Address comments

* style: Address migration style issues

* docs: Add javadoc link for MiniMessage
2021-12-13 09:48:34 +01:00
9c84dc2bc0 build: Update pipeline version to release build 2021-12-10 11:25:21 +01:00
cba0f3ac1f build: Switch PRTree GAV to our deployment (#3360)
* build: Switch PRTree repository

* build: Use our GAV
2021-12-09 18:30:35 +01:00
b9a130ab00 feat: Add -Post events firing after operational plot events (#3334)
* Create Post* events

* Address license violations

* address review

* standardize post event calls in EventDispatcher

* Add package-info.java

* Add @since-tag to Post* events

* fix licenser issue

Co-authored-by: Alex <mc.cache@web.de>
2021-12-06 19:50:04 +01:00
688056352b build: Update dependency net.kyori:adventure-platform-bukkit to v4.0.1 (#3356)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-06 14:33:04 +01:00
2a40f52dea docs: Update issue template to 1.18 2021-12-05 23:29:28 +01:00
3ed369de19 style: Add missing bracket for deny example (#3351) 2021-11-29 20:56:48 +01:00
bec51401a3 build: Update dependency org.junit.jupiter:junit-jupiter to v5.8.2 (#3350)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-29 11:25:01 +01:00
109f884b5f build: Update dependency io.papermc:paperlib to v1.0.7 (#3349)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-29 11:13:23 +01:00
8f3fa419c4 Fixes #3344, Wrong iterator algorithm in PlotRangeIterator (#3345) 2021-11-23 19:52:23 +00:00
a9f08bc885 build: Update dependencies
Closes #3330
2021-11-15 12:41:52 +01:00
a8923ec729 build: Back to snapshot for development 2021-11-11 23:01:37 +01:00
4eafd043a3 Release 6.1.4 2021-11-11 22:49:46 +01:00
826cc8c835 build: Update Gradle 2021-11-11 22:43:48 +01:00
d1dbf777a4 Don't check/set if a chunk should be saved if it's a world-plot 2021-11-11 17:57:59 +00:00
823e78377b feat: Better deciding of heights to use for generation and schematics (#3300)
* Better deciding of heights to use for generation and schematics
 - If bedrock is disabled, we should still be filling the space with something
 - Use minBuildHeight instead of hardcoding "1" for schematics (it is still 1 by default) to ensure all-encompassing schematics
 - Schematic generation/handling for roads etc. should be accounting for all of wall, road, and plot heights for deciding point of origin
 - Fixes #3269
 - Starts to address #3175

* Also do for HybridPlotManager clear
2021-11-11 17:33:38 +00:00
87a2e81ec3 Don't write biome data to schematics if it's not present 2021-11-10 19:51:14 +00:00
88775334b7 Schematic paths are configurable (#3303) 2021-11-09 10:32:07 +00:00
e126547e97 chore: Update com.fastasyncworldedit to v1.17-390 (#3324)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-09 10:00:14 +01:00
c1163cdb2e feat: Split configuration for teleport on claim/auto (#3308)
- Fixes #2953
2021-11-07 22:29:49 +01:00
30d06b7801 build: Reduce consumer dependencies 2021-11-05 11:57:58 +01:00
a5cf7bf2c2 Fix BlockLoc to the requirements for use as a home location
- Add home locations to #fromString
 - Switch to y=Integer#minValue more
 - May help with #3321
2021-11-04 20:47:56 +00:00
3d4d413de8 Minor adjustment to plot home location logic
- Allow "centre" spelling
 - ClassicPlotWorld contains the PLOT_HEIGHT config setting, not HPW
2021-11-02 15:41:16 +00:00
b97e843849 perf: Get rid of Guice overhead when accessing the plot area manager (#3315)
Fixes #3311
Co-authored-by: Jordan <dordsor21@gmail.com>
2021-11-02 13:38:48 +00:00
48c7a3e94e refactor: Use player friendly done message on restricted building (#3309) 2021-11-02 13:32:04 +00:00
7263290bbe fix: Untrusted visit flag not working with untrusted visit permission
Fixes #3317 
Co-authored-by: Alex <mc.cache@web.de>
2021-11-02 13:28:39 +00:00
e99c4e3289 chore: Update dependency org.checkerframework:checker-qual to v3.19.0 (#3320)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-01 21:51:53 +01:00
87cb26189f Closes #3313 2021-11-01 14:07:44 +01:00
2dae336a5f chore: Update com.fastasyncworldedit to v1.17-380 (#3312)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-01 14:06:47 +01:00
258ed1469b chore: Update dependency net.kyori:adventure-api to v4.9.3 (#3314)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-01 14:06:40 +01:00
6f3eabba0e feat: Don't display the default plot title if on a server-plot, unless configured otherwise. (#3305)
- If plot-title flag is set, title will still be displayed.
2021-11-01 11:23:53 +00:00
804228fa6c Allow pitch and yaw to be used in default home location (#3304) 2021-10-29 10:48:35 +01:00
be85708e5a feat: Add border bypass permission (#3302)
* Add border bypass permission
 - Fixes #3297

* Add permission to plots.admin permpack

* Implement messages on leaving/entering border area

* Rename to border.denied and make border msg red

* change too le/ge as tthey are likely to be equal to border when hit.
 - Since we check for being across the border beforehand, it will hopefully not be spammed too much?
 - If it's spammed then either we use meta to set if a player's left the border, or we just remove the come-back-in altogether because it's a little looong
2021-10-28 10:13:36 +02:00
f2368f97df chore: Update com.sk89q.worldedit to v7.2.7 (#3299)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-25 11:22:31 +02:00
df87bcb743 build: Back to snapshot for development 2021-10-18 20:30:28 +02:00
574 changed files with 2490 additions and 1479 deletions

View File

@ -18,8 +18,6 @@ body:
options: options:
- Paper - Paper
- Spigot - Spigot
- Tuinity
- Purpur
validations: validations:
required: true required: true
@ -29,6 +27,8 @@ body:
description: Which server version version you using? If your server version is not listed, it is not supported. Update to a supported version first. description: Which server version version you using? If your server version is not listed, it is not supported. Update to a supported version first.
multiple: false multiple: false
options: options:
- '1.18.1'
- '1.18'
- '1.17.1' - '1.17.1'
- '1.16.5' - '1.16.5'
- '1.15.2' - '1.15.2'

2
.github/stale.yml vendored
View File

@ -1,4 +1,4 @@
daysUntilStale: 60 daysUntilStale: 30
daysUntilClose: 7 daysUntilClose: 7
only: issues only: issues
exemptLabels: exemptLabels:

View File

@ -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.3.4" 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.3.1" 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 closeSonatypeStagingRepository" 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
View 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 }}

View File

@ -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
View 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
View File

@ -0,0 +1,13 @@
{
"scanSettings": {
"baseBranches": ["v6"]
},
"checkRunSettings": {
"vulnerableCheckRunConclusionLevel": "success",
"displayMode": "diff"
},
"issueSettings": {
"minSeverityLevel": "LOW"
},
"enableRenovate": "true"
}

View File

@ -24,7 +24,7 @@ dependencies {
implementation(libs.bstats) implementation(libs.bstats)
// Paper // Paper
compileOnlyApi(libs.paper) compileOnly(libs.paper)
implementation(libs.paperlib) implementation(libs.paperlib)
// Plugins // Plugins
@ -32,7 +32,7 @@ dependencies {
exclude(group = "org.bukkit") exclude(group = "org.bukkit")
exclude(group = "org.spigotmc") exclude(group = "org.spigotmc")
} }
compileOnlyApi(libs.fastasyncworldeditBukkit) { isTransitive = false } compileOnly(libs.fastasyncworldeditBukkit) { isTransitive = false }
testImplementation(libs.fastasyncworldeditBukkit) { isTransitive = false } testImplementation(libs.fastasyncworldeditBukkit) { isTransitive = false }
compileOnly(libs.vault) { compileOnly(libs.vault) {
exclude(group = "org.bukkit") exclude(group = "org.bukkit")
@ -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.
@ -95,9 +96,9 @@ tasks {
withType<Javadoc> { withType<Javadoc> {
val opt = options as StandardJavadocDocletOptions val opt = options as StandardJavadocDocletOptions
opt.links("https://papermc.io/javadocs/paper/1.17/") opt.links("https://papermc.io/javadocs/paper/1.17/")
opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-core/7.2.6/") 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.6/") 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.1/") opt.links("https://jd.adventure.kyori.net/api/4.9.3/")
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/")
} }

View File

@ -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

View File

@ -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);
@ -1180,6 +1198,11 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
return this.injector; return this.injector;
} }
@Override
public @NonNull PlotAreaManager plotAreaManager() {
return this.plotAreaManager;
}
@NonNull @NonNull
@Override @Override
public Locale getLocale() { public Locale getLocale() {
@ -1199,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);
} }

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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();

View File

@ -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
@ -318,8 +318,7 @@ public class BlockEventListener implements Listener {
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { } else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
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("done.building_restricted")
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
); );
event.setCancelled(true); event.setCancelled(true);
return; return;
@ -401,8 +400,7 @@ public class BlockEventListener implements Listener {
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { } else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
plotPlayer.sendMessage( plotPlayer.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("done.building_restricted")
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER))
); );
event.setCancelled(true); event.setCancelled(true);
return; return;

View File

@ -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

View File

@ -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
@ -32,6 +32,7 @@ import com.plotsquared.core.location.Location;
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.world.PlotAreaManager; import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.plot.world.SinglePlotArea;
import com.plotsquared.core.util.ReflectionUtils.RefClass; import com.plotsquared.core.util.ReflectionUtils.RefClass;
import com.plotsquared.core.util.ReflectionUtils.RefField; import com.plotsquared.core.util.ReflectionUtils.RefField;
import com.plotsquared.core.util.ReflectionUtils.RefMethod; import com.plotsquared.core.util.ReflectionUtils.RefMethod;
@ -107,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();
@ -181,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;
@ -295,7 +241,7 @@ public class ChunkListener implements Listener {
Chunk chunk = event.getChunk(); Chunk chunk = event.getChunk();
if (Settings.Chunk_Processor.AUTO_TRIM) { if (Settings.Chunk_Processor.AUTO_TRIM) {
String world = chunk.getWorld().getName(); String world = chunk.getWorld().getName();
if (this.plotAreaManager.hasPlotArea(world)) { if ((!Settings.Enabled_Components.WORLDS || !SinglePlotArea.isSinglePlotWorld(world)) && this.plotAreaManager.hasPlotArea(world)) {
if (unloadChunk(world, chunk, true)) { if (unloadChunk(world, chunk, true)) {
return; return;
} }
@ -365,8 +311,7 @@ public class ChunkListener implements Listener {
} }
private void cleanChunk(final Chunk chunk) { private void cleanChunk(final Chunk chunk) {
TaskManager.index.incrementAndGet(); final int currentIndex = TaskManager.index.incrementAndGet();
final int currentIndex = TaskManager.index.get();
PlotSquaredTask task = TaskManager.runTaskRepeat(() -> { PlotSquaredTask task = TaskManager.runTaskRepeat(() -> {
if (!chunk.isLoaded()) { if (!chunk.isLoaded()) {
Objects.requireNonNull(TaskManager.removeTask(currentIndex)).cancel(); Objects.requireNonNull(TaskManager.removeTask(currentIndex)).cancel();

View File

@ -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();

View File

@ -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);
} }

View File

@ -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

View File

@ -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;
@ -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);
}
} }
} }

View File

@ -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;

View File

@ -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();
@ -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.of("node", String.valueOf(Permission.PERMISSION_ADMIN_ENTRY_DENIED)) Template.of("plot", plot.toString())
); );
event.setCancelled(true); event.setCancelled(true);
} }
@ -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.of("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());
@ -564,19 +564,31 @@ public class PlayerEventListener extends PlotListener implements Listener {
return; return;
} }
int border = area.getBorder(); int border = area.getBorder();
int x1;
if (x2 > border && this.tmpTeleport) { if (x2 > border && this.tmpTeleport) {
to.setX(border - 1); if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
this.tmpTeleport = false; to.setX(border - 1);
player.teleport(event.getTo()); this.tmpTeleport = false;
this.tmpTeleport = true; player.teleport(event.getTo());
pp.sendMessage(TranslatableCaption.of("border.border")); this.tmpTeleport = true;
} pp.sendMessage(TranslatableCaption.of("border.denied"));
if (x2 < -border && this.tmpTeleport) { } else if (MathMan.roundInt(from.getX()) <= border) { // Only send if they just moved out of the border
to.setX(-border + 1); pp.sendMessage(TranslatableCaption.of("border.bypass.exited"));
this.tmpTeleport = false; }
player.teleport(event.getTo()); } else if (x2 < -border && this.tmpTeleport) {
this.tmpTeleport = true; if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
pp.sendMessage(TranslatableCaption.of("border.border")); to.setX(-border + 1);
this.tmpTeleport = false;
player.teleport(event.getTo());
this.tmpTeleport = true;
pp.sendMessage(TranslatableCaption.of("border.denied"));
} else if (MathMan.roundInt(from.getX()) >= -border) { // Only send if they just moved out of the border
pp.sendMessage(TranslatableCaption.of("border.bypass.exited"));
}
} else if (((x1 = MathMan.roundInt(from.getX())) >= border && x2 <= border) || (x1 <= -border && x2 >= -border)) {
if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
pp.sendMessage(TranslatableCaption.of("border.bypass.entered"));
}
} }
} }
int z2; int z2;
@ -601,13 +613,13 @@ 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)) {
@ -626,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.of("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);
@ -643,18 +655,31 @@ public class PlayerEventListener extends PlotListener implements Listener {
return; return;
} }
int border = area.getBorder(); int border = area.getBorder();
int z1;
if (z2 > border && this.tmpTeleport) { if (z2 > border && this.tmpTeleport) {
to.setZ(border - 1); if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
this.tmpTeleport = false; to.setZ(border - 1);
player.teleport(event.getTo()); this.tmpTeleport = false;
this.tmpTeleport = true; player.teleport(event.getTo());
pp.sendMessage(TranslatableCaption.of("border.border")); this.tmpTeleport = true;
pp.sendMessage(TranslatableCaption.of("border.denied"));
} else if (MathMan.roundInt(from.getZ()) <= border) { // Only send if they just moved out of the border
pp.sendMessage(TranslatableCaption.of("border.bypass.exited"));
}
} else if (z2 < -border && this.tmpTeleport) { } else if (z2 < -border && this.tmpTeleport) {
to.setZ(-border + 1); if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
this.tmpTeleport = false; to.setZ(-border + 1);
player.teleport(event.getTo()); this.tmpTeleport = false;
this.tmpTeleport = true; player.teleport(event.getTo());
pp.sendMessage(TranslatableCaption.of("border.border")); this.tmpTeleport = true;
pp.sendMessage(TranslatableCaption.of("border.denied"));
} else if (MathMan.roundInt(from.getZ()) >= -border) { // Only send if they just moved out of the border
pp.sendMessage(TranslatableCaption.of("border.bypass.exited"));
}
} else if (((z1 = MathMan.roundInt(from.getZ())) >= border && z2 <= border) || (z1 <= -border && z2 >= -border)) {
if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
pp.sendMessage(TranslatableCaption.of("border.bypass.entered"));
}
} }
} }
} }
@ -960,8 +985,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
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("done.building_restricted")
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
); );
e.setCancelled(true); e.setCancelled(true);
return; return;
@ -1040,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) {
@ -1215,13 +1243,6 @@ public class PlayerEventListener extends PlotListener implements Listener {
); );
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;
} }
@ -1233,8 +1254,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { } else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
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("done.building_restricted")
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
); );
event.setCancelled(true); event.setCancelled(true);
} }
@ -1288,14 +1308,6 @@ public class PlayerEventListener extends PlotListener implements Listener {
); );
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;
} }
@ -1307,8 +1319,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { } else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
plotPlayer.sendMessage( plotPlayer.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("done.building_restricted")
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
); );
event.setCancelled(true); event.setCancelled(true);
} }
@ -1588,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.of("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.of("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.of("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();
@ -1698,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
@ -1733,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;
} }
} }
} }

View File

@ -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();

View File

@ -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

View File

@ -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
@ -27,6 +27,7 @@ package com.plotsquared.bukkit.listener;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.plot.world.PlotAreaManager; import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.plot.world.SinglePlotArea;
import com.plotsquared.core.plot.world.SinglePlotAreaManager; import com.plotsquared.core.plot.world.SinglePlotAreaManager;
import com.plotsquared.core.util.ReflectionUtils; import com.plotsquared.core.util.ReflectionUtils;
import org.bukkit.Chunk; import org.bukkit.Chunk;
@ -42,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;
@ -86,7 +86,7 @@ public class SingleWorldListener implements Listener {
if (!(man instanceof SinglePlotAreaManager)) { if (!(man instanceof SinglePlotAreaManager)) {
return; return;
} }
if (!isPlotId(name)) { if (!SinglePlotArea.isSinglePlotWorld(name)) {
return; return;
} }
@ -103,31 +103,4 @@ public class SingleWorldListener implements Listener {
handle(event); handle(event);
} }
private boolean isPlotId(String worldName) {
int len = worldName.length();
int separator = 0;
for (int i = 0; i < len; i++) {
switch (worldName.charAt(i)) {
case '_':
separator++;
break;
case '-':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
break;
default:
return false;
}
}
return separator == 1;
}
} }

View File

@ -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

View File

@ -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

View File

@ -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 {
} }
} }
*/

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
@ -178,8 +178,7 @@ public class BukkitEntityUtil {
if (!Permissions if (!Permissions
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { .hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
plotPlayer.sendMessage( plotPlayer.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("done.building_restricted")
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
); );
return false; return false;
} }

View File

@ -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()) {

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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() {

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -248,9 +248,12 @@ permissions:
plots.admin.components.other: true plots.admin.components.other: true
plots.admin.vehicle.break.unowned: true plots.admin.vehicle.break.unowned: true
plots.admin.pve.unowned: true plots.admin.pve.unowned: true
plots.admin.border.bypass: true
plots.teleport.delay.bypass: plots.teleport.delay.bypass:
default: op default: op
plots.admin.border.bypass:
default: op
plots.worldedit.bypass: plots.worldedit.bypass:
default: op default: op
plots.gamemode.bypass: plots.gamemode.bypass:

View File

@ -5,8 +5,8 @@ dependencies {
compileOnlyApi(libs.checkerqual) compileOnlyApi(libs.checkerqual)
// Minecraft expectations // Minecraft expectations
compileOnlyApi(libs.guava)
compileOnlyApi(libs.gson) compileOnlyApi(libs.gson)
compileOnly(libs.guava)
// Platform expectations // Platform expectations
compileOnlyApi(libs.snakeyaml) compileOnlyApi(libs.snakeyaml)
@ -22,16 +22,16 @@ 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
compileOnlyApi(libs.worldeditCore) { compileOnly(libs.worldeditCore) {
exclude(group = "bukkit-classloader-check") exclude(group = "bukkit-classloader-check")
exclude(group = "mockito-core") exclude(group = "mockito-core")
exclude(group = "dummypermscompat") exclude(group = "dummypermscompat")
} }
testImplementation(libs.worldeditCore) testImplementation(libs.worldeditCore)
compileOnlyApi(libs.fastasyncworldeditCore) { isTransitive = false } compileOnly(libs.fastasyncworldeditCore) { isTransitive = false }
testImplementation(libs.fastasyncworldeditCore) { isTransitive = false } testImplementation(libs.fastasyncworldeditCore) { isTransitive = false }
// Logging // Logging
@ -40,9 +40,7 @@ dependencies {
// Other libraries // Other libraries
api(libs.prtree) api(libs.prtree)
api(libs.aopalliance) api(libs.aopalliance)
api(libs.pipeline) { api(libs.cloudServices)
exclude(group = "com.google.guava")
}
api(libs.arkitektonika) api(libs.arkitektonika)
api(libs.paster) api(libs.paster)
} }

View File

@ -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

View File

@ -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;
@ -38,7 +38,9 @@ import com.plotsquared.core.inject.annotations.DefaultGenerator;
import com.plotsquared.core.location.World; import com.plotsquared.core.location.World;
import com.plotsquared.core.permissions.PermissionHandler; 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.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;
@ -268,6 +270,13 @@ public interface PlotPlatform<P> extends LocaleHolder {
return injector().getInstance(ChunkManager.class); return injector().getInstance(ChunkManager.class);
} }
/**
* Get the {@link PlotAreaManager} implementation.
*
* @return the PlotAreaManager
*/
@NonNull PlotAreaManager plotAreaManager();
/** /**
* Get the platform specific console {@link Audience} * Get the platform specific console {@link Audience}
* *
@ -283,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
*/ */

View File

@ -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,7 +283,7 @@ public class PlotSquared {
* @return Plot area manager * @return Plot area manager
*/ */
public @NonNull PlotAreaManager getPlotAreaManager() { public @NonNull PlotAreaManager getPlotAreaManager() {
return this.platform.injector().getInstance(PlotAreaManager.class); return this.platform.plotAreaManager();
} }
public void startExpiryTasks() { public void startExpiryTasks() {
@ -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;
@ -758,6 +752,9 @@ public class PlotSquared {
if (this_max < last_max) { if (this_max < last_max) {
plot.getArea().setMeta("lastPlot", plot.getId()); plot.getArea().setMeta("lastPlot", plot.getId());
} }
if (callEvent) {
eventDispatcher.callPostDelete(plot);
}
return true; return true;
} }
return false; return false;
@ -1537,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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
@ -193,19 +193,28 @@ public class PlayerBackupProfile implements BackupProfile {
future.completeExceptionally(new IllegalArgumentException( future.completeExceptionally(new IllegalArgumentException(
"The backup is non-existent or not in the correct format")); "The backup is non-existent or not in the correct format"));
} else { } else {
this.schematicHandler.paste(schematic, plot, 0, 1, 0, false, player, new RunnableVal<Boolean>() { this.schematicHandler.paste(
@Override schematic,
public void run(Boolean value) { plot,
if (value) { 0,
future.complete(null); plot.getArea().getMinBuildHeight(),
} else { 0,
future.completeExceptionally(new RuntimeException(MINI_MESSAGE.stripTokens( false,
TranslatableCaption player,
.of("schematics.schematic_paste_failed") new RunnableVal<>() {
.getComponent(ConsolePlayer.getConsole())))); @Override
public void run(Boolean value) {
if (value) {
future.complete(null);
} else {
future.completeExceptionally(new RuntimeException(MINI_MESSAGE.stripTokens(
TranslatableCaption
.of("schematics.schematic_paste_failed")
.getComponent(ConsolePlayer.getConsole()))));
}
}
} }
} );
});
} }
}); });
} }

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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}) {

View File

@ -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

View File

@ -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

View File

@ -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
@ -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.of("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.of("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.of("player", PlayerManager.getName(uuid)) Template.of("player", PlayerManager.resolveName(uuid).getComponent(player))
); );
iterator.remove(); iterator.remove();
continue; continue;

Some files were not shown because too many files have changed in this diff Show More