Compare commits

...

2829 Commits
v3.5.0 ... v6

Author SHA1 Message Date
renovate[bot]
52823f5024
Update Ilshidur/action-discord digest to 08d9328 (#3974)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-05 10:15:38 +01:00
renovate[bot]
1326c257a0
Update dependency com.intellectualsites.arkitektonika:Arkitektonika-Client to v2.1.2 (#3972)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-05 10:15:27 +01:00
ByteExceptionM
fc3137cd96
Fix farmland moisturize (#3978)
* fix: Fix farmland gets moisturizes

Signed-off-by: ByteExceptionM <git@byteexception.eu>

* chore: Revert code reformat

Signed-off-by: ByteExceptionM <git@byteexception.eu>

---------

Signed-off-by: ByteExceptionM <git@byteexception.eu>
2023-03-05 10:15:05 +01:00
Alexander Brandes
c46cc73f52
Turn down renovate a bit 2023-03-05 00:03:39 +01:00
renovate[bot]
f11acacedd
Update dependency com.intellectualsites.prtree:PRTree to v2.0.1 (#3975)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-02 22:36:18 +01:00
Alexander Brandes
d1bac90745
Update developers field 2023-03-02 20:48:33 +01:00
Alexander Brandes
e98f628d34
Pin GH actions to SHA to avoid mutable refs (#3973) 2023-03-02 12:30:14 +01:00
renovate[bot]
b2ab61559c
Update dependency com.diffplug.spotless to v6.16.0 (#3970)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-02 00:46:34 +01:00
renovate[bot]
dd6eb8e74f
Update dependency cloud.commandframework:cloud-services to v1.8.2 (#3971)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-02 00:46:19 +01:00
renovate[bot]
97cdd03ea4
Update dependency gradle to v7.6.1 (#3967)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-27 21:24:04 +01:00
Alexander Brandes
f5118e6802
Don't fire 'PlotUnlinkEvent' twice on plot clear (#3947) 2023-02-23 09:26:30 +01:00
renovate[bot]
94ca5cf679
Update dependency cloud.commandframework:cloud-services to v1.8.1 (#3965)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-22 23:47:31 +01:00
renovate[bot]
5a55a1f602
Update dependency io.github.gradle-nexus.publish-plugin to v1.2.0 (#3966)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-22 23:47:13 +01:00
renovate[bot]
ed33635a15
Update dependency com.diffplug.spotless to v6.15.0 (#3959)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-11 09:35:35 +01:00
renovate[bot]
888682e5d0
Update dependency com.intellectualsites.bom:bom-1.18.x to v1.24 (#3960)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-11 09:35:21 +01:00
Alexander Brandes
72bb5f00b0
Back to snapshot for development 2023-02-10 17:16:52 +01:00
Alexander Brandes
773fd6f59f
Release 6.11.0 2023-02-10 17:12:15 +01:00
ByteExceptionM
5cce86d924
feat: Add event firing on remove road entity (#3955)
* feat: Add event firing on remove road entity

Signed-off-by: ByteExceptionM <git@byteexception.eu>

* chore: Add some more entity vars

Signed-off-by: ByteExceptionM <git@byteexception.eu>

* chore: Rename method

Signed-off-by: ByteExceptionM <git@byteexception.eu>

* chore: Code cleanup

Signed-off-by: ByteExceptionM <git@byteexception.eu>

* chore: Code reformat

Signed-off-by: ByteExceptionM <git@byteexception.eu>

* chore: Change iterator removal

Signed-off-by: ByteExceptionM <git@byteexception.eu>

* Comply with checkstyle

---------

Signed-off-by: ByteExceptionM <git@byteexception.eu>
Co-authored-by: Alexander Brandes <mc.cache@web.de>
2023-02-09 20:51:59 +01:00
renovate[bot]
84567bcb00
Update dependency com.diffplug.spotless to v6.14.1 (#3957)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-06 12:48:30 +01:00
Traks
d7c2ab1d16
Make farmland keep its moisture (#3952)
Handle MoistureChangeEvent for farm land
2023-01-31 11:22:13 +01:00
renovate[bot]
0d359ade0c
Update dependency com.diffplug.spotless to v6.14.0 (#3950)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-28 19:21:35 +01:00
renovate[bot]
ffbec24290
Update dependency com.intellectualsites.bom:bom-1.18.x to v1.23 (#3948)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-24 22:35:15 +01:00
Alexander Brandes
ab357deb48
Put more legacy web interface deprecations in place 2023-01-23 13:40:35 +01:00
Alexander Brandes
6130c3dfa5
Clarify 2D biome deprecation 2023-01-23 13:28:05 +01:00
Alexander Brandes
5787588500
Move BukkitPlotGenerator#generateChunkData() deprecation from v7 to v6 2023-01-23 13:18:20 +01:00
Alexander Brandes
b40383b5a4
Back to snapshot for development 2023-01-23 12:33:51 +01:00
Alexander Brandes
be8903128d
Release 6.10.9 2023-01-23 12:28:33 +01:00
Alexander Brandes
08800ec16d
Cleanup deperecated WorldEdit met
Co-authored-by: Matthew Kaulfers <42121989+mkaulfers@users.noreply.github.com>
2023-01-22 11:26:07 +01:00
Alexander Brandes
83e274ff9f
Revert "PS-3908: Cleanup deprecated methods to improve code maturity. (#3944)"
This reverts commit 0dd8b1053cfac7b137dc04e254dbe0582d77a6d3.
2023-01-22 11:21:01 +01:00
Matthew Kaulfers
0dd8b1053c
PS-3908: Cleanup deprecated methods to improve code maturity. (#3944)
https://github.com/IntellectualSites/PlotSquared/issues/3908
2023-01-22 00:02:15 +01:00
Alexander Brandes
0558fcf5d5
Provide full verbosity for invalid components 2023-01-21 22:27:20 +01:00
Jordan
c45bbe3ec5
fix: ensure plots are fully unlinked before the clear itself is run (#3933)
* fix: ensure plots are fully unlinked before the clear itself is run

* Update Core/src/main/java/com/plotsquared/core/plot/PlotModificationManager.java

Co-authored-by: Alexander Brandes <mc.cache@web.de>
2023-01-19 09:01:06 +01:00
Jordan
07e598e48f
fix: account for exclusivity of max build height where requires (#3935) 2023-01-16 21:15:35 +00:00
Jordan
f6f00dfcda
fix: Remove chunk#isLoaded call in BukkitChunkCoordinator (#3934) 2023-01-16 17:14:20 +00:00
Alexander Brandes
63a6bdc1d6
Terminate process if .git folder is not a repository (#3937)
Terminate process if folder is not a repository
2023-01-16 00:18:51 +01:00
Alexander Brandes
abbac057ed
Default to unix line endings (#3932)
* Default to unix line endings

* Respect preconfigured settings
2023-01-15 17:54:52 +01:00
Alexander Brandes
c978322036
Separate workflows between PRs and pushes (#3928)
* Separate workflows between PRs and pushes

* Fixup
2023-01-15 14:10:41 +01:00
Jordan
39d2f1a72c
chore: remove uses of deprecated Permissions class and add javadoc notes (#3930)
- Closes #3907
2023-01-15 14:08:59 +01:00
renovate[bot]
86919b8841
Update dependency com.diffplug.spotless to v6.13.0 (#3929)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-15 10:28:43 +01:00
Hannes Greule
00722bc463
Reduce /plot home overhead (#3921)
* Add JFR events

* Replace global connected plots cache with local cache

* Simplify isOwner check

* Avoid extensive hashing of plots

* Clear caches in more cases

* Revert "Add JFR events"

This reverts commit 78c107f1
2023-01-14 00:27:09 +01:00
renovate[bot]
6a34a1996f
Update dependency com.intellectualsites.bom:bom-1.18.x to v1.22 (#3918)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-13 22:28:58 +01:00
Alexander Brandes
1d201b04ba
chore: Update a few deprecations (#3913) 2023-01-13 17:48:13 +01:00
Alexander Brandes
e887a59158
Officially deprecated BukkitPlayer#BukkitPlayer() (#3922)
* Officially deprecated BukkitPlayer#BukkitPlayer()

* Address review feedback
2023-01-12 10:03:11 +01:00
renovate[bot]
d1b8f652a7
Update dependency org.junit.jupiter:junit-jupiter to v5.9.2 (#3923)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-11 22:16:12 +01:00
Alexander Brandes
4aa7bc51bc
Include missing javadoc option 2023-01-11 22:11:11 +01:00
Alexander Brandes
0f0030916f
Add source documentation to javadocs and add dependency tab (#3917)
Get the most out of javadocs
2023-01-11 18:25:51 +01:00
Alexander Brandes
bbf1e4fe61
Back to snapshot for development 2023-01-09 15:53:19 +01:00
Alexander Brandes
febac6fa40
Release 6.10.8 2023-01-09 15:43:51 +01:00
Alexander Brandes
99ee8a780d
Back to snapshot for development 2023-01-09 15:40:32 +01:00
Alexander Brandes
577a0d8ed9
Unstage 6.10.7 2023-01-09 15:28:31 +01:00
Alexander Brandes
02ae14894a
Stage 6.10.7 2023-01-09 15:23:50 +01:00
Alexander Brandes
78dbe7fbbc
Back to snapshot for development 2023-01-09 11:41:59 +01:00
Alexander Brandes
669293566b
Release 6.10.6 2023-01-09 11:41:12 +01:00
Alexander Brandes
707c7be5bd
Remove unused editorconfig rules (#3915) 2023-01-09 10:26:05 +01:00
Alexander Brandes
becd8c4eaf
Replace licenser with spotless (#3914) 2023-01-08 23:16:40 +01:00
Hannes Greule
339ca8e30f
Fix wrong plot id calculation for negative coordinates (#3898) 2023-01-04 12:35:12 +01:00
Alexander Brandes
742d78a505
Add 1.19.3 to the issue template 2022-12-23 13:41:58 +01:00
Hraponssi
120bf37196
Fix dispensers loading Legacy Material Support (#3894)
Fixes https://github.com/IntellectualSites/PlotSquared/issues/3883
2022-12-23 09:08:38 +00:00
renovate[bot]
2a40a6b35e
Update dependency com.intellectualsites.bom:bom-1.18.x to v1.21 (#3890)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-13 22:45:51 +01:00
renovate[bot]
ea1f35b45a
Update dependency cloud.commandframework:cloud-services to v1.8.0 (#3891)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-13 22:44:29 +01:00
renovate[bot]
15e63378a7
Update worldedit to v7.2.13 (#3889)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-11 08:39:32 +01:00
Jordan
f3bc504a6f
refactor: adjust specific Nullable annotations used (#3869) 2022-12-02 12:39:38 +00:00
renovate[bot]
3a8fae47a0
Update dependency com.intellectualsites.bom:bom-1.18.x to v1.20 (#3882)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-28 15:23:44 +01:00
Alexander Brandes
70cb1cd100
Back to snapshot for development 2022-11-28 11:18:56 +01:00
Alexander Brandes
2067cc1670
Release 6.10.5 2022-11-28 11:18:06 +01:00
renovate[bot]
e6338976dd
Update dependency gradle to v7.6 (#3880)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-25 19:20:37 +01:00
Jordan
90ebd5d5ed
feat: add a permission to override-allow a merge if the other plot's owner is offline (#3844) 2022-11-25 10:48:33 +00:00
Alexander Brandes
c973ee8649
Revert "feat: check merge limits when completing auto-merge (#3868)" - Fixes a bug in 6.10.4 (#3876)
Revert "feat: check merge limits when completing auto-merge (#3868)"

This reverts commit 25ce7a83f134921c1fc2c69f5d92ecb23edf1761.
2022-11-20 10:58:04 +01:00
Jordan
c1543f034c
feat: improve handling of null issues in plot analysis (#3867) 2022-11-17 17:23:44 +00:00
renovate[bot]
6baf339ecb
Update dependency com.intellectualsites.bom:bom-1.18.x to v1.19 (#3874)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-16 18:35:03 +01:00
Alexander Brandes
11906ef1c9
Back to snapshot for development 2022-11-16 11:30:23 +01:00
Alexander Brandes
ee8902154a
Release 6.10.4 2022-11-16 11:26:03 +01:00
Jordan
b5bc1988e5
feature: implement road flags as widely as seems reasonable (#3870)
* feature: implement road flags as widely as seems reasonable
 - Closes #3047
 - Any further road flag implementations would be very specific from what I can gather, and thus the gist of #3047 is now implemented

* Add javadoc since tag

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

* Create util class for method

Co-authored-by: Alexander Brandes <mc.cache@web.de>
2022-11-15 19:07:38 +01:00
Jordan
2147012beb
chore: deprecate paper 1.13 listener as P2 effectively doesn't support 1.13 (#3872) 2022-11-14 22:58:05 +01:00
Jordan
52bb561689
fix: attempt to recover from IllegalStateException when restoring block tags (#3838)
- Fixes #3801
2022-11-14 16:47:24 +01:00
Jordan
25ce7a83f1
feat: check merge limits when completing auto-merge (#3868)
- Closes #3748
2022-11-13 11:57:41 +01:00
Jordan
55c8a590e7
Fix item thrower/owner can be null (#3866)
fix: item thrower/owner can be nuill
 - Fixes #3862
2022-11-12 17:10:21 +01:00
renovate[bot]
28bd993680
Update dependency com.intellectualsites.bom:bom-1.18.x to v1.18 (#3864)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-06 11:13:29 +01:00
Alexander Brandes
8330f37d8a
Back to snapshot for development 2022-11-02 09:35:57 +01:00
Alexander Brandes
985fae65b6
ÂRelease 6.10.3 2022-11-02 09:34:33 +01:00
Jordan
db2d590e8e
fix: account for mismatched road-schematic heights (#3854) 2022-10-23 21:22:21 +02:00
renovate[bot]
c8d356783a
Update dependency com.intellectualsites.bom:bom-1.18.x to v1.17 (#3853)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-20 10:23:56 +02:00
Alexander Brandes
4947450ff0
Back to snapshot for development 2022-10-18 23:14:03 +02:00
Alexander Brandes
de4e91ff62
Release 6.10.2 2022-10-18 23:12:27 +02:00
Pierre Maurice Schwang
fe5e3d5f6d
Annotate ExpireManager with @Inject (#3852)
fix: annotate ExpireManager with @Inject
2022-10-18 10:17:34 +02:00
michizhou
b8b3098022
feat: Move ExpireManager to Guice by removing legacy IMP references (#3845)
* feat: Move ExpireManager to Guice by removing legacy IMP references

* Mark ExpireManager IMP as deprecated and add comments

* Add import for PlotPlatform for function reference

* Add ExpireManager instance call and optimize performance
2022-10-17 09:31:48 +02:00
renovate[bot]
0ae8fc46b8
Update dependency com.github.spotbugs:spotbugs-annotations to v4.7.3 (#3851)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-17 09:24:42 +02:00
Alexander Brandes
e0762f63a8
chore: Replace paper reference in favor of bom 2022-10-15 16:04:30 +02:00
Jordan
9f3850000c
fix: adjust nullability checks for shulkers in the kill road mobs task (#3842)
- Fixes #3789
2022-10-15 15:26:14 +02:00
BlockyTheDev
76c6be9ba7
Fix 'No resource for locale 'lang' found ' error (#3830)
* Fix #3820

* Reword message and add link to completed translations

* Fix #3820

* Reword message and add link to completed translations

* Add line breaks for better code readability

* Add line breaks for better code readability

Co-authored-by: Alexander Brandes <mc.cache@web.de>
2022-10-13 19:19:20 +02:00
Jordan
308a5aa781
Ensure all setBlock methods in BlockArrayCacheScopedQueueCoordinator apply the correct offset (#3843)
- Fixes #3783
2022-10-13 19:17:27 +02:00
Hannes Greule
e244527538
Make more complex patterns work correctly (#3847)
allow more complex patterns to work correctly
2022-10-13 19:16:19 +02:00
Jordan
11dd013333
fix: Adjust schematic height logic when pasting and actually set air as well (#3840) 2022-10-13 16:46:29 +01:00
Pierre Maurice Schwang
b740d5854c
Support MiniMessage in plot-title flag (#3835) 2022-10-10 17:41:35 +01:00
BlockyTheDev
d5445cfbef
Don't kill owned road entities (leashed / named) (#3829) 2022-10-10 17:41:25 +01:00
Alexander Brandes
3effaefda7
chore: Announce releases on Discord (#3839) 2022-10-09 16:40:51 +02:00
Hannes Greule
49b19e0eaf
Check proper locations on PortalCreateEvent (#3834)
check proper locations on PortalCreateEvent
2022-10-08 15:13:11 +02:00
Hannes Greule
caef3a923b
Deprecate PlotId#copy (#3821) 2022-10-08 14:11:16 +01:00
BlockyTheDev
d4c3ceaf2b
Move license into jar during compile process (#3826) 2022-10-08 14:10:57 +01:00
renovate[bot]
25e6aecf13
Update dependency com.intellectualsites.bom:bom-1.18.x to v1.16 (#3825)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-04 22:54:56 +02:00
Alexander Brandes
33c11fdee9
Back to snapshot for development 2022-10-04 19:31:27 +02:00
Alexander Brandes
316dd92667
Release 6.10.1 2022-10-04 19:30:44 +02:00
StealWonders
e53d2ac449
Update the plot sign when a plot has been purchased (#3822) 2022-10-03 21:51:17 +02:00
StealWonders
5786e8cc7a
refactor: replace guava's Iterables with Java's stream API (#3823) 2022-10-03 21:51:05 +02:00
Pierre Maurice Schwang
1b717c9b10
Only show visible players in /plot near (#3819)
feat: check visibility of player in `/plot near`
2022-10-03 21:50:41 +02:00
Hannes Greule
35abae99ca
Improve feedback for invalid patterns (#3818)
improve feedback for invalid patterns
2022-10-02 22:22:08 +02:00
Schuwi
d1a85982fb
Fix "set block timer" error after "/plot download" with legacy-webinterface setting (#3812)
Add missing `Plot.removeRunning` call to Download
2022-10-01 11:37:24 +02:00
resi23
3446b913cd
plots.auto.mega fix for #3815 (#3816)
Co-authored-by: Resi <unconfigured@null.spigotmc.org>
2022-09-28 10:53:44 +02:00
renovate[bot]
8b8fd6aab7
Update dependency com.intellectualsites.bom:bom-1.18.x to v1.15 (#3809)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-22 22:26:11 +02:00
Alexander Brandes
520bb64eca
Back to snapshot for development 2022-09-21 16:29:17 +02:00
Alexander Brandes
60d266b2d7
Release 6.10.0 2022-09-21 16:28:17 +02:00
Hannes Greule
8deeef4f7d
Add allay to animals (#3788)
add allay to animals
2022-09-21 16:18:34 +02:00
resi23
9b0b071c0c
Add GLOW_BERRIES to VineGrowFlag (#3803) 2022-09-21 16:18:18 +02:00
renovate[bot]
81a3f1098d
Update dependency org.junit.jupiter:junit-jupiter to v5.9.1 (#3807)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-21 16:18:08 +02:00
renovate[bot]
efc248dcdb
Update dependency com.intellectualsites.bom:bom-1.18.x to v1.14 (#3794)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-12 11:19:07 +02:00
DerEingerostete
476f3d328d
feature: add flag for beacon effects of other plots (#3627)
* feature: add flag for beacon effects of other plots

Took 7 minutes

* fix: don't add the beacon effect flag if the platform is not paper

Took 2 minutes

* fix: creating consistency in documentation

Took 7 minutes

* feature: add global paper setting for the beacon-effect

* fix: description of the plot flag and rewrite of the listener

* fix: renamed flag and added road support

* fix: renamed flag and changed flag functionality

* fix: added spigot fallback listener and fixed NPE

* refactor: Address checkstyle violations

* addition: remove beacon effects when player leaves a plot

* fix: updated javadoc and fixed usage of the PlotListener#addEffect method

* chore: Run license updater

Co-authored-by: BuildTools <unconfigured@null.spigotmc.org>
Co-authored-by: Alexander Brandes <mc.cache@web.de>
2022-09-05 20:06:37 +02:00
renovate[bot]
69f5f88183
Update dependency com.github.spotbugs:spotbugs-annotations to v4.7.2 (#3793)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-05 09:40:41 +02:00
Alexander Brandes
6df63f7fc7
Invoke -parameters on compile time (#3787)
chore: Invoke -parameters on compile time
2022-09-03 12:55:55 +02:00
renovate[bot]
295b8a0135
Update dependency cloud.commandframework:cloud-services to v1.7.1 (#3784)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-27 09:32:40 +02:00
renovate[bot]
fcc5bc5473
Update dependency net.essentialsx:EssentialsX to v2.19.7 (#3780)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-24 09:56:33 +02:00
Alexander Brandes
408b834376
[ci skip] chore: Add renovate schema URL 2022-08-20 15:31:51 +02:00
Pierre Maurice Schwang
986812b9e4
chore: make snow set more future-proof (#3768) 2022-08-19 13:41:04 +02:00
renovate[bot]
8d4333ad9d
fix(deps): update dependency net.essentialsx:essentialsx to v2.19.6 (#3770)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-13 10:12:05 +02:00
renovate[bot]
9ff9097ff9
fix(deps): update dependency net.essentialsx:essentialsx to v2.19.5 (#3767)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-12 14:13:42 +02:00
renovate[bot]
1ef424a2f1
fix(deps): update dependency com.intellectualsites.bom:bom-1.18.x to v1.13 (#3766)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-10 16:52:47 +02:00
Alexander Brandes
9fd96dbaa2
build: Back to snapshot for development 2022-08-10 11:10:41 +02:00
Alexander Brandes
b0a4e11c46
build: Release 6.9.4 2022-08-10 11:09:51 +02:00
Hannes Greule
77bce43ace
fix: replace usages of snow tag (#3758)
* replace usages of snow tag

* powder snow is 1.17+
2022-08-10 11:03:20 +02:00
Pierre Maurice Schwang
cba1927cc7
Items no longer despawn on road when natural_mob_spawning = true and kill-road-items = false (#3764)
* fix: handling of item despawning on road

* chore: de-duplicate check

* chore: check in PaperListener for consistency
2022-08-10 10:22:19 +02:00
Hannes Greule
3d19c5c2ad
perf: avoid quadratic overhead for UUID collection (#3749)
avoid quadratic overhead for UUID collection
2022-08-08 12:50:22 +02:00
Hannes Greule
e0eff15694
fix: use correct uuid type in /grant (#3759)
use correct type
2022-08-07 21:19:01 +02:00
renovate[bot]
0bdeeea83b
fix(deps): update worldedit to v7.2.12 (#3762)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-07 21:16:18 +02:00
Alexander Brandes
6f96daae56
Update bug_report.yml 2022-08-06 13:49:25 +02:00
renovate[bot]
d1021d19da
chore(deps): update dependency gradle to v7.5.1 (#3761)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-06 13:49:01 +02:00
renovate[bot]
ee589ac7f0
fix(deps): update worldedit to v7.2.11 (#3750)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-31 15:58:38 +02:00
Traks
3b747ffecf
Don't allow wall corals to dry (#3746) 2022-07-29 23:00:55 +02:00
Alexander Brandes
4e5a2b9f96
fix: Add user friendly message for creationdate placeholder (#3745) 2022-07-29 23:00:37 +02:00
Alexander Brandes
aeb4350ccb
Update bug_report.yml 2022-07-29 19:01:35 +02:00
renovate[bot]
9609990832
build: Update dependency com.intellectualsites.bom:bom-1.18.x to v1.12 (#3739)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-26 22:47:51 +02:00
renovate[bot]
0e4319b757
build: Update dependency org.junit.jupiter:junit-jupiter to v5.9.0 (#3741)
* build: Update dependency org.junit.jupiter:junit-jupiter to v5.9.0

* Update renovate.json

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Alexander Brandes <mc.cache@web.de>
2022-07-26 22:47:25 +02:00
Alexander Brandes
c8f4907f77
build: Back to snapshot for development 2022-07-25 21:11:35 +02:00
Alexander Brandes
dcf98c2298
build: Release 6.9.3 2022-07-25 21:10:39 +02:00
Hannes Greule
ae59c7442f
fix: improve handling of missing message files (#3718)
* improve handling of missing message files

* fix javadoc

Co-authored-by: Alexander Brandes <mc.cache@web.de>
2022-07-25 21:02:54 +02:00
Jordan
98708118d8
Deprecate the static Permissions "util" class that is almost entirely superseded by methods in PermissionHolder instances themselves (#3695)
Co-authored-by: Alexander Brandes <mc.cache@web.de>
2022-07-24 15:55:43 +02:00
Bernhard
276d8f8e1e
change message of /p remove <player> if player does not need to be removed (#3734)
refactor: change message of `/p remove <player>` if unnecessary
2022-07-24 10:32:29 +02:00
renovate[bot]
87f89541b5
build: Update dependency com.intellectualsites.bom:bom-1.18.x to v1.11 (#3726)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-15 10:04:01 +02:00
renovate[bot]
93f6de7029
build: Update dependency gradle to v7.5 (#3727)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-15 10:03:27 +02:00
renovate[bot]
73d2686b17
build: Update dependency com.intellectualsites.bom:bom-1.18.x to v1.10 (#3723)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-06 00:14:20 +02:00
Alexander Brandes
c446a95b07
build: Back to snapshot for development 2022-07-05 22:26:52 +02:00
Alexander Brandes
3676e1df35
build: Release 6.9.2 2022-07-05 22:25:57 +02:00
Alexander Brandes
12e2705260
Revert #3681 (#3722)
Revert "Adjust schematic height logic when pasting and actually set air as well (#3681)"

This reverts commit 08ce4c872c0f7a95e1106a4f2ee6030ee92f4de0.
2022-07-05 15:02:25 +02:00
renovate[bot]
31e777a03a
build: Update dependency me.clip:placeholderapi to v2.11.2 (#3720)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-04 14:07:14 +02:00
Alexander Brandes
7f436c405b
fix: Don't fail post processing compilation on non-ascii charmap (#3719) 2022-07-03 14:58:17 +02:00
Traks
4d4d2ab087
Ignore cancelled projectile launch events (#3709) 2022-06-28 21:15:09 +02:00
dordsor21
91017acce4
Realistically only need the "highest" y level of adding overlay block errors 2022-06-27 17:41:47 +01:00
renovate[bot]
e90fd231d9
build: Update dependency com.github.spotbugs:spotbugs-annotations to v4.7.1 (#3714)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-06-27 17:00:13 +02:00
Alexander Brandes
cd9f0789de
build: Update bom to 1.9 2022-06-27 16:47:32 +02:00
Alexander Brandes
5f4c8d92df
build: Back to snapshot for development 2022-06-27 14:57:32 +02:00
Alexander Brandes
263cb47a21
build: Release 6.9.1 2022-06-27 14:56:44 +02:00
Traks
005600c99e
Show old flag value in remove command (#3711) 2022-06-27 13:31:45 +02:00
NotMyFault
26bec7fe2f
style: Address javadoc violations 2022-06-26 11:18:33 +02:00
Jordan
f4b886d977
Minor cleanup of the plot analyze code (#3708)
- No need to wrap the final analysis into another async method. It's already contained in an async task
 - Don't overstretch a chunk bounday when setting blocks to newBlocks array
2022-06-23 19:18:29 +02:00
Traks
c09d0d882e
Use single PlotListener instance (#3704) 2022-06-22 12:50:56 +01:00
Traks
312cb2996c
Better handling of offline projectile shooters (#3705) 2022-06-22 12:50:46 +01:00
Jordan
f218902581
Implement build height limits into more events (#3691)
* Implement build height limits into more events

* Implement util method to check if y is within world build limits

* Extract duplicate player-build-height-checking to plot area
 - Extract to core module to allow any possible future platforms to access the method, as they will always duplicate

* Add code tag to javadoc

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

Co-authored-by: Alexander Brandes <mc.cache@web.de>
2022-06-21 19:09:29 +02:00
Alexander Brandes
f27009216c
chore: Replace AnnotationHelper class (#3706) 2022-06-21 19:09:17 +02:00
renovate[bot]
dda52ebc2e
build: Update dependency cloud.commandframework:cloud-services to v1.7.0 (#3701)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-06-20 10:47:49 +02:00
Alexander Brandes
9ac8d38bab
chore: Remove checkerframework from gradle libs
Closes #3700
2022-06-20 10:43:43 +02:00
Hannes Greule
6a54328f7d
refactor: replace usages of switch over keyed enums (#3673) 2022-06-19 00:59:43 +01:00
Alexander Brandes
7279862def
docs: Publish javadocs to GH actions (#3686)
* docs: Publish javadocs to GH actions

* chore: Use updated URL

* chore: Use correct URL
2022-06-17 23:40:29 +02:00
Jordan
08ce4c872c
Adjust schematic height logic when pasting and actually set air as well (#3681) 2022-06-17 15:39:41 +01:00
Jordan
2b0c5b1e21
Reset wall filling on clear (#3680)
- Implements #3591
2022-06-16 16:22:27 +02:00
Alexander Brandes
3d5c694daa
chore: Comply with OSSRH licensing guidelines (#3684) 2022-06-15 20:17:17 +02:00
Schuwi
d153232969
Fix maximum plot number check in /plot continue counting the current plot twice (#3674)
Fix max plot restriction check in continue command

Co-authored-by: Alexander Brandes <mc.cache@web.de>
2022-06-13 23:44:56 +02:00
Alexander Brandes
bb0aa8d5cc
fix: Don't publish root directory to maven repository (#3676)
* fix: Don't publish root directory (Fixes #3647)

* fix: More investigations

* fix: Exclude task 'jar' from root project

* chore: Keep group ID in the root scope
2022-06-13 15:23:12 +02:00
renovate[bot]
d69f3b0893
build: Update dependency com.intellectualsites.bom:bom-1.18.x to v1.5 (#3677)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-06-13 11:38:28 +02:00
Alexander Brandes
565838ad43
[ci skip] chore: Update renovate excludes (Closes #3678) 2022-06-13 11:36:46 +02:00
Alexander Brandes
8b52461271
build: Back to snapshot for development 2022-06-13 11:25:07 +02:00
Alexander Brandes
d08381dfed
build: Release 6.9.0 2022-06-13 11:23:48 +02:00
Jordan
b6c45f2df3
Add an on-complete task to PlotArea#mergePlots (#3671)
* Add an on-complete task to PlotArea#mergePlots

* Fix typo
2022-06-13 09:06:01 +02:00
Jordan
b9479405e1
Ensure forceSync is provided when constructing chunk coordinators (#3657)
* Ensure forceSync is provided when constructing chunk coordinators

* Re-add old factory create method and deprecate for removal

* Remove old create method that Guice doesn't like
2022-06-12 10:47:43 +02:00
Jordan
a238ff19bf
Implement tile entities to generation using Populators (#3665)
* Implement tile entities to generation using Populators
 - Fixes #3051

* Javadocs

* Don't do the big error if heads don't work

* Address comments regarding javadocs/comments

* Ensure Location is still sealed, and add api description annotation to public methods in UncheckedWorldLocation

* Clean up HybridGen
 - There's no need for while loops acting as a modulo after we've already performed a modulo
 - Make the code-sections calculating if positions are in the wall/road more readable
 - Collaps duplicate if-elseif bodies

* Better exception handling when setting data to LimitedRegion during chunk population

* Address comments

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

* Better naming for "legacy" block state populator

Co-authored-by: Alexander Brandes <mc.cache@web.de>
2022-06-12 10:47:25 +02:00
Alexander Brandes
c93b08d0c7
feat: Add 1.19 music disk to the /plot music GUI (#3668)
feat: Add 1.19 music disk to the GUI
2022-06-12 10:47:00 +02:00
Alexander Brandes
1470b7117a
chore: Add tadpole buckets to the list of dispensable items (#3669)
chore: Add tadpole buckets to the list of disposables

Signed-off-by: Alexander Brandes <mc.cache@web.de>
2022-06-12 10:46:21 +02:00
Alexander Brandes
7cbc67f4fc
chore: Fix typo 2022-06-11 17:14:51 +02:00
Alexander Brandes
0a76bbb2b0
Update README.md 2022-06-11 17:14:05 +02:00
Alexander Brandes
09cc59a1c1
docs: Unify WE, P2 and Fawe abbreviations (#3672) 2022-06-11 16:16:06 +02:00
Jordan
bf646be482
Only load world cofigurations if WorldEdit has fully enabled (safe to do) (#3666)
* Only load world cofigurations if WorldEdit has fully enabled (safe to do)
 - Fixes #3664

(cherry picked from commit f2e1e99be3b4f1fd5ce00e32ea7773dd4d1855aa)

* Fix imports

* QueryCapability is effectively a "dumb" method

* Update Core/src/main/java/com/plotsquared/core/PlotSquared.java

Co-authored-by: Alexander Brandes <mc.cache@web.de>
2022-06-10 16:52:17 +02:00
Alexander Brandes
cc7e17960b
docs: Add 1.19 to issue template 2022-06-10 13:42:09 +02:00
Bernhard
3c75b170f0
fix: mob cap counting for each connected plot individually (#3643)
cap meta is now handled in the base plot
2022-06-10 01:27:39 +02:00
dordsor21
a79c474957
Deprecate methods for removal that will be removed/had their signatures changed in v7 2022-06-09 13:49:58 +01:00
Alexander Brandes
4bb480a238
chore: Update Code of conduct email (#3661) 2022-06-09 12:58:31 +02:00
Alexander Brandes
9ffa935c0c
build: Switch to bill of materials (#3653)
* build: Switch to managed dependencies

* build: Move bom to root build script

* build: Update bom

* Update build.gradle.kts

* fix: Use the correct bom version
2022-06-09 12:57:37 +02:00
Bernhard
0a32268784
Prevent blocks moving/generating below and above build height (#3641)
* fix: cancel BlockFormEvent outside of build limit

* refactor: rename variables for easier readability

* fix: cancel liquid flow outside build limit

* refactor: implement to/from context
2022-06-05 20:51:07 +02:00
Alexander Brandes
ae3b8c06f6
chore: Address Paper javadoc warnings (#3648) 2022-06-05 20:50:49 +02:00
Alexander Brandes
713c4ad0d2
Remove aggregation of cross module javadocs (#3646)
chore: Don't aggregate javadocs anymore
2022-06-03 23:13:41 +02:00
NotMyFault
48386c0828
build: Back to snapshot for development 2022-06-01 20:12:50 +02:00
NotMyFault
625b3921e1
build: Release 6.8.1 2022-06-01 20:09:36 +02:00
Alexander Brandes
48aa37d173
Update Readme SVG (#3642)
docs: Update Readme SVG
2022-05-30 13:47:25 +02:00
Bernhard
2c2314e95c
refactor: return info.server for %plotsquared_currentplot_owner% if plot is a server plot (#3640) 2022-05-25 10:18:10 +02:00
Bernhard
5eb2fc3ad0
Kick players on merged plots appropriately (#3639)
fix: kick denied player regardless on all connected plots
2022-05-24 20:30:06 +02:00
renovate[bot]
82cd9a092c
build: Update fawe to v2.2.0 (#3637)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-05-24 13:33:54 +02:00
Alexander Brandes
62754362c2
build: Don't expose jcip and findbugs annotations to the world on runtime (#3533)
* build: Don't expose jcip and findbugs

* build: Revert relocation change of unpublished, shaded deps

* chore: Exclude .DS_Store files
2022-05-21 10:01:06 +00:00
BlockyTheDev
2e9dfd6f6f
chore: Update PaperMC repository endpoint (#3633)
Migration - New PaperMC endpoints
2022-05-21 07:57:22 +02:00
Alexander Brandes
fc9fe1462f
build: Back to snapshot for development 2022-05-18 22:07:22 +02:00
Alexander Brandes
41f546ca6b
build: Release 6.8.0 2022-05-18 22:05:31 +02:00
Alexander Brandes
d037da33cb
chore: Ignore .DS_Store files 2022-05-18 21:59:09 +02:00
renovate[bot]
dc2d08c67e
build: Update release-drafter/release-drafter action to v5.20.0 (#3624)
* build: Update release-drafter/release-drafter action to v5.20.0

* Update release-drafter.yml

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Alexander Brandes <mc.cache@web.de>
2022-05-18 17:19:23 +02:00
Jordan
96dfc27411
Fix lag caused when generating augmented worlds with roads (#3614)
- Begin by implementing forceSync to the queue system as we know the chunk will be accessible to edits in some cases (i.e. population).
 - Also implement custom SideEffectSets to override any decided by the default chunk consumer, as we do NOT want to update neighbours in population (this caused infinite generation to be required causing the lag and server death). We also do not want to enqueue the QueueCoordinator in AugmentedUtils as this would write to the world and update neighbours before we might want to (plus it's just used to restrict and offset the blocks being set)
 - Then implement disabling any biomes from being saved/set to the queue to prevent augmented worlds having their biomes overridden in roads
 - Consequently fix ScopedQueueCoordinator, preventing the y value of blocks being set from needlessly being changed, fixing road heights in augmented worlds
 - Finally we do not need a method with chunkObject in the signature in AugmentedUtils as this is no longer used by the method
2022-05-16 13:27:41 +01:00
Jordan
171d2e5e99
Fix generation of augmented/partial worlds when single worlds are enabled (#3615) 2022-05-16 13:21:43 +01:00
Bernhard
4433892431
fix: Block Endermites from spawning if mob spawning is disabled (#3623) 2022-05-16 13:20:03 +01:00
Jordan
98a07dad1b
Fix plot analysis (#3618)
* Fix plot analysis
 - Stop using deprecated ChunkQueueCoordinator and create a new purpose-built coordinator
 - Generation is chunk-by-chunk thus the old blocks cache needs to be filled accordingly
 - Remove the **four** System#gc calls
 - Fixes #3464
 - Fix really weird dumb... maths? in ExpiryTask
 - Fixes #3600

* Add since annotation

* Address comments and maxY should be inclusive

* Annotate new queue as internal use only
2022-05-15 11:58:04 +02:00
Jordan
0ffa22b7a6
Deprecations to Queues (#3613)
* Deprecations and niceties
 - Deprecate ScopedQueueCoordinator as it is poorly named
 - Deprecate ChunkQueueCoordinator for complete removal as it is poorly designed (though still used)

* Add since tags
2022-05-15 11:57:26 +02:00
Jordan
60a0129fe9
Correctly use yIndex when regenerating plots in certain world configurations (#3601)
- Fixes #3597
2022-05-15 11:42:19 +02:00
Hannes Greule
d5f8a0842b
make y location of homes always absolute part 2 (#3620) 2022-05-13 15:46:52 +02:00
Jordan
f7d55ce105
Implement restoring tags directly using a supplied block (#3616)
- Reduces overhead when setting blocks via fallback
 - Also means blocks will not be accessed via world when they should be access via chunk (https://github.com/IntellectualSites/PlotSquared/pull/3612)
2022-05-11 13:12:19 +01:00
Bernhard
85911646f3
Add ability to disable random Mojang uuid API calls (#3586)
* feature: ability to disable impromtu Mojang uuid API calls

* refactor: update comment for the new setting
2022-05-11 13:11:57 +01:00
Jordan
8b75dece69
Implement chunkObject into queueing (#3612) 2022-05-11 13:11:38 +01:00
Bernhard
7d6e515ba8
Improvements to /plot list command (#3585)
* refactor: list command shows owner better
added check for:
- unknown owners (UUID not cached/invalid)
- server plots
- plots owner by everyone

* fix: show correct color in list command if plot is owned by everyone

* refactor: improved List command for server plots

(cherry picked from commit fed700f0d8d20b0c53e7767b3b4bf04c40f9a9b5)

* refactor: removed duplicate code

* refactor: renamed placeholders to reflect their use

Co-authored-by: Alexander Brandes <mc.cache@web.de>
2022-05-10 09:50:27 +02:00
dordsor21
13d7357c85
Niceties
- Better ordering of augmented information printed to consol on startup
 - Override
2022-05-10 01:43:01 +01:00
renovate[bot]
16e26b910c
build: Update dependency com.github.spotbugs:spotbugs-annotations to v4.7.0 (#3606)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-05-09 13:53:59 +02:00
Alexander Brandes
faadebd30e
chore: Update my name (#3599) 2022-05-07 15:56:24 +02:00
Alexander Brandes
2aeacb3dcf
build: Back to snapshot for development 2022-05-05 10:07:58 +02:00
Alexander Brandes
9db7791835
build: Release 6.7.0 2022-05-05 09:58:14 +02:00
Bernhard
f49ddb819d
Add Plot flag for projectiles (#3581)
* feature: add flag for projectiles

* build: add License to ProjectilesFlag.java

Co-authored-by: Alexander Brandes <mc.cache@web.de>
2022-05-04 23:21:24 +02:00
renovate[bot]
d71c62771e
build: Update dependency org.checkerframework:checker-qual to v3.22.0 (#3595)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-05-03 09:58:14 +02:00
Traks
a6aaa9538f
Set plot biome chunk by chunk (#3590)
* Actually set plot biome chunk by chunk

* Better variable name for chunk position
2022-04-30 14:16:58 +02:00
renovate[bot]
0974fb2834
[ci skip] build: Update com.fastasyncworldedit to v2.1.2 (#3588)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-04-25 16:56:30 +02:00
renovate[bot]
8982b33b6c
build: Update github/codeql-action action to v2 (#3589)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-04-25 15:59:30 +02:00
Alexander Brandes
a7b3b3b7df
build: Back to snapshot for development 2022-04-19 08:50:50 +02:00
NotMyFault
888bb20e78
build: Release 6.6.3 2022-04-19 08:45:44 +02:00
Hannes Greule
b11bb6fa22
make y location of homes always absolute (#3568) 2022-04-19 00:48:51 +02:00
Alexander Brandes
e5764b958d
build: Replace jsr305 with spotbugs (#3576) 2022-04-19 00:48:23 +02:00
Alexander Brandes
bfe3141ff1
style: Emphasize project icon in idea selection (#3577) 2022-04-19 00:47:38 +02:00
Alexander Brandes
73c82deeb0
build: Switch back to upstream SquirrelID (#3575) 2022-04-19 00:46:39 +02:00
Pierre Maurice Schwang
38682ecff6
fix: share the QueueCoordinator in PlotModificationManager#unlinkPlot (#3571)
Co-authored-by: Alexander Brandes <mc.cache@web.de>
2022-04-15 07:01:53 +00:00
Pierre Maurice Schwang
6a54dc7eff
fix: typo (MaxBuildHeight -> MinBuildHeight) (#3572) 2022-04-15 08:59:01 +02:00
Pierre Maurice Schwang
8454c29c91
fix: Make PlayerManager#resolveName blocking for entry title (#3556) 2022-04-11 14:38:02 +00:00
renovate[bot]
b2c9311a47
build: Update com.fastasyncworldedit to v2.1.1 (#3562)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-04-04 15:32:02 +02:00
renovate[bot]
c4aa497a2b
build: Update actions/setup-java action to v3.1.0 (#3563)
* build: Update actions/setup-java action to v3.1.0

* Update build.yml

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Alexander Brandes <mc.cache@web.de>
2022-04-04 15:31:53 +02:00
NotMyFault
c13f544390
build: Back to snapshot for development 2022-04-04 13:03:49 +02:00
NotMyFault
c28177d6af
build: Release 6.6.2 2022-04-04 12:56:13 +02:00
NotMyFault
8a80f252cf
chore: Fill in since TODOs 2022-04-04 12:54:42 +02:00
renovate[bot]
93571c72d1
build: Update dependency org.checkerframework:checker-qual to v3.21.4 (#3561)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-04-04 12:47:38 +02:00
renovate[bot]
6fd7379221
build: Update dependency gradle to v7.4.2 (#3560)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-04-04 12:46:49 +02:00
Hannes Greule
dc5c80d812
clean up PlayerCommandPreprocess listener (#3557) 2022-04-01 19:30:37 +02:00
Alexander Brandes
96e9a61e7c
refactor: Deprecate Load#secToTime() (#3558) 2022-04-01 19:30:11 +02:00
Jordan
b9bd9b81e6
Make confirm tasks synchronous. It was changed in 7ac3f7ca03e2ae6066b17aa101f4be82d0b541d2 (#3551) 2022-03-23 15:04:39 +01:00
renovate[bot]
ec77812879
build: Update com.sk89q.worldedit to v7.2.10 (#3554)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-03-21 11:49:34 +01:00
dordsor21
efc2083798 Change the default sign orientation to better match the wall location 2022-03-15 16:25:40 +00:00
dordsor21
3a6f845c01 Use correct field for unsaved in 1.18 2022-03-15 16:25:23 +00:00
NotMyFault
7efd42ae45
build: Ignore kyori updates until we update MM
Closes #3543
2022-03-14 20:09:52 +01:00
renovate[bot]
f43f4cbf5d
build: Update com.fastasyncworldedit to v2.1.0 (#3541)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-03-14 15:36:43 +01:00
renovate[bot]
104cc4b7a4
build: Update dependency net.essentialsx:EssentialsX to v2.19.4 (#3540)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-03-14 12:40:03 +01:00
renovate[bot]
218be43143
build: Update dependency gradle to v7.4.1 (#3539)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-03-14 12:39:46 +01:00
Jordan
308dba5601
Only add extent to WE operations once (#3537) 2022-03-10 22:40:09 +01:00
dordsor21
5f233bb5d1 Use new FAWE method including actor for schematic pasting 2022-03-09 16:31:33 +01:00
NotMyFault
5e188d114f
build: Misc dependency updates 2022-03-08 20:50:19 +01:00
NotMyFault
660e05d27f
build: Back to snapshot for development 2022-03-08 20:21:23 +01:00
NotMyFault
4c0ad148bf
build: Release 6.6.1 2022-03-08 20:15:16 +01:00
dordsor21
5c7bfb988c
Fix #3532 2022-03-08 18:14:19 +00:00
renovate[bot]
b46f486680
build: Update actions/checkout action to v3 (#3530)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-03-07 23:14:24 +01:00
renovate[bot]
05797d0c78
build: Update dependency org.checkerframework:checker-qual to v3.21.3 (#3528)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-03-07 20:55:39 +01:00
renovate[bot]
36ef2cf9ba
build: Update dependency net.essentialsx:EssentialsX to v2.19.3 (#3527)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-03-07 20:55:28 +01:00
NotMyFault
26ec31a012
build: Back to snapshot for development 2022-03-07 15:55:25 +01:00
NotMyFault
fd4a542062
build: Release 6.6.0 2022-03-07 15:35:00 +01:00
NotMyFault
dc13f2565f
ci: Pin GH workflow dependencies 2022-03-07 15:26:41 +01:00
Jordan
9f632af0ae
Implement extended world heights from Y-64 to Y319 #3473 (#3473)
* Begin to implement extended world heights:
 - Implemented in Bukkit module (and where required in Core module)

* Implement extended world heights into core module

* Add min gen height to setup,

* Default gen/build heights based on minecraft version

* Few fixes

* Fix up queues

* Address comments

* Make road schematic stuff slightly more efficient by sharing queues

* Minor fixes, don't overlay error many times for the same y

* Fix incorrect schematic paste height, undo changes to HybridUtils

* Overhall regenallroads method to make it work, make sure BukkitChunkCoordinator can/will finish

* Process chunks in order when regenerating all roads

* Address comments

* Address comments

* Ground level//bedrock is at min gen height
 - Add comment on == rather than <= being used
 - It's because it's only checking for the bedrock layer being broken if that's disabled

* Fix offset for min build height in SchematicHandler

* Better javadoc

Co-authored-by: Hannes Greule <SirYwell@users.noreply.github.com>

* Address inclusivity issues for max world height

* Javadocs/comments/deprecation

* Use world min/max heights if present in QueueCoordinator

* Address some deprecations for regions and biome setting

* Add a count for chunks we're currently trying to load to not skip chunks at the end of a queue's edit

* Use minGenHeight + 1 rather than build height in AugmentedUtils

* Create utility method for layer index in GenChunk

* Correct height in HybridUtils, also use minGenHeight + 1

* Don't magically split to 128 height in regeneration

* Add utility methods for world height in QueueCoordinator

* Clean up ClassicPlotManager road creation/removal

* Start generation at min gen height if bedrock is disabled

* min gen height is set in PlotArea

* Add note on schem y normalisation

* Improve plot getVolume method readability

* Don't overly extend height when regenerating road region

* y index utility method in ChunknQueueCoordinator

* Layer index utility method in LocalChunk

* Use version min/max heights if world not present in QueueCoordinator

* Fix min -> max

* Don't allow players to modify outside build height when using plot set  / schematics.
 - Also fixes schematic height issues

* Remove debug

* Address comments

* Switch loadingChunks to AtomicInteger to be safe (in case of multi-threaded)

* Fix "security" issue that was already present

* Ensure sign isn't physicsed

Co-authored-by: Hannes Greule <SirYwell@users.noreply.github.com>
2022-03-05 19:03:39 +01:00
Alex
d698c6a1e5
[ci skip] Update issue templates for 1.18.2 2022-03-04 13:25:50 +01:00
renovate[bot]
40e1bd9897
build: Update dependency cloud.commandframework:cloud-services to v1.6.2 (#3522)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-03-01 16:31:40 +01:00
Hannes Greule
75f31c5bf6
Replace delombok-ed equals and hashCode methods (#3518)
* regenerate leftover delombok-ed equals and hashCode methods

* delegate to hashCode directly instead of single parameter calls
2022-02-27 18:51:37 +01:00
NotMyFault
954c813cef
build: Update gradle wrapper properly 2022-02-27 18:48:37 +01:00
Alex
05e055e9cf
ci: Bump actions/setup-java to 3.0.0 (#3519) 2022-02-25 22:43:24 +01:00
NotMyFault
2ea21c150f
build: Back to snapshot for development 2022-02-23 11:05:40 +01:00
NotMyFault
c2fd4edad5
build: Release 6.5.1 2022-02-23 11:00:45 +01:00
NotMyFault
78b8696778
refactor: Delete rebase.yml 2022-02-23 10:54:07 +01:00
Alex
e653961385
Fix shulkers teleporting on the road (#3501)
* fix: Don't teleport shulkers on the road

* Address comments
2022-02-16 13:48:20 +01:00
renovate[bot]
b21d12fd52
build: Update dependency net.luckperms:api to v5.4 (#3505)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-14 11:58:35 +01:00
Pierre Maurice Schwang
7557df96c7
Cancel block placement if the block consists of two block states (#3487)
* fix: cancel block placements out of area

* chore: use BlockMultiPlaceEvent

* chore: fix comment typo

* fix: max build height should be exclusive
2022-02-11 11:21:59 +01:00
NotMyFault
61797c3aff
build: Back to snapshot for development 2022-02-10 12:44:17 +01:00
NotMyFault
78125ff1e2
build: Release 6.5.0 2022-02-10 12:32:02 +01:00
Alex
d7c8715b25
Don't open the component GUI if the actor has no permission for a specific preset (#3496)
* fix: Handle an empty component GUI gracefully

* Address comments
2022-02-10 12:19:35 +01:00
Alex
34f005c244
Restore ability to use PlaceholderAPI in greeting and farewell flag (#3489)
Fixes #3465
2022-02-10 12:11:39 +01:00
Alex
6fbd1376ca
Don't enable presets with prices if economy is disabled (#3497) 2022-02-10 12:10:47 +01:00
Pierre Maurice Schwang
951767dc64
fix: synchronize confirmExpiry (#3481)
Prevents that the MetaDataAccess is closed before setting the data
2022-02-08 15:57:09 +01:00
Pierre Maurice Schwang
16928b05f1
Display "/plot help" categories only, if the player has permission to access these commands (#3490)
* feat: only show categories with access in help-menu

* chore: cleanup imports

* feat: tab complete should respect category permissions as well

* chore: cleanup imports again

* chore: rename ambiguous method name and update access modifier
2022-02-08 15:56:29 +01:00
renovate[bot]
fff14b05cb
build: Update release-drafter/release-drafter action to v5.18.1 (#3494)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-07 10:37:26 +01:00
renovate[bot]
e619c867e9
build: Update dependency org.checkerframework:checker-qual to v3.21.2 (#3493)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-07 10:34:53 +01:00
Pierre Maurice Schwang
543284e016
fix: NPE on unavailable music discs on lower versions (#3475)
* fix: NPE on unavailable music discs

* chore: documentation for InventoryUtil changes

* fix: no need for additional decrement

* chore: address requested changes

* fix: prevent binary mismatch

Co-authored-by: Alex <mc.cache@web.de>
2022-02-04 18:21:43 +01:00
NotMyFault
0d78ba5f35
[ci skip] ci: Don't run actions twice 2022-01-31 21:12:00 +01:00
NotMyFault
9ba2b62fc2
[ci skip] style: Restore GlobalFlagContainer's entry list being sorted alphabetically
Mostly helps me when updating the wiki
2022-01-31 15:50:44 +01:00
renovate[bot]
f10ee27fdd
build: Update dependency org.bstats:bstats-bukkit to v3 (#3486)
* build: Update dependency org.bstats:bstats-bukkit to v3

* build: Update bStats

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: NotMyFault <mc.cache@web.de>
2022-01-31 10:35:31 +01:00
renovate[bot]
3278ce1fe9
build: Update dependency com.intellectualsites.paster:Paster to v1.1.4 (#3485)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-31 10:24:16 +01:00
renovate[bot]
fefb0334bd
build: Update com.fastasyncworldedit to v2.0.1 (#3484)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-31 10:23:57 +01:00
Hannes Greule
d06a827e31
Always call plot events through the event dispatcher (#3479) 2022-01-29 13:12:00 +01:00
Alex
10bb520f3a
docs: Switch to generated wiki (#3482) 2022-01-29 00:12:54 +01:00
NotMyFault
126aa53b61
build: Back to snapshot for development 2022-01-27 14:00:51 +01:00
NotMyFault
ac71046feb
build: Release 6.4.0 2022-01-27 13:49:17 +01:00
Alex
7c290e6bd0
Align plugin's java version with API java version - Java 17 (#3468)
* refactor!: Align plugin's java version with API java version

* fix: Bump Guice to fix private injection on Java 17
2022-01-27 13:26:58 +01:00
Alex
4d297cc829
Separate linked javadocs per module (#3476)
* docs: Separate javadocs per module

* docs: Read javadoc version from Gradle version catalog
2022-01-27 13:26:27 +01:00
Alex
5ab410a5c5
fix: Don't ommit flag int input in no permission message (#3466) 2022-01-27 12:14:39 +01:00
Jordan
1f28bac955
Fix: Plot#getOwner can be nullable, and redstone may be present on unowned plots (#3472) 2022-01-27 12:14:16 +01:00
Pierre Maurice Schwang
92c54de5e9
fix: run whenDone on empty queue (#3474) 2022-01-27 12:13:55 +01:00
Alex
ff5d79699d
docs: Add @since annotation for v6 changes (#3471) 2022-01-24 21:46:01 +01:00
Alex
a0594c19ee
docs: Address dangling @see tags (#3469) 2022-01-24 21:43:35 +01:00
Alex
da41c136fe
docs: Unify true/false style in @return (#3470) 2022-01-24 21:41:54 +01:00
renovate[bot]
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
Pierre Maurice Schwang
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
Jordan
5fc153d896
fix: PlayerInteractEvent does not necessarily interact with a block (#3463) 2022-01-22 17:25:41 +01:00
Yannick Lamprecht
a003836dbc
feat: plot-title flag value should allow single values (#3410) 2022-01-22 11:02:08 +01:00
NotMyFault
42bf413528
chore: Address more violations 2022-01-20 21:01:38 +01:00
Alex
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
Pierre Maurice Schwang
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
Bernhard
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
renovate[bot]
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
NotMyFault
3a752db698
build: Switch to Fawe release 2022-01-15 16:50:03 +01:00
NotMyFault
7cdde5a822
build: Back to snapshot for development 2022-01-14 11:46:02 +01:00
NotMyFault
8b6e7b2f2b
build: Release 6.3.0 2022-01-14 11:14:00 +01:00
NotMyFault
06f0b42a97
refactor: Update SquirrelID GAV 2022-01-14 10:58:44 +01:00
Jordan
9a85080bf6
Allow restoration of road schematic height calculation behaviour from pre 6.1.4 (#3444) 2022-01-14 10:46:04 +01:00
Alex
d14d2caa2d
refactor: Prepare removal of our maven repository (#3451) 2022-01-13 14:50:07 +01:00
Alex
bcfe7c58dd
feat: Add 1.18's music disc additions to /plot music (#3446) 2022-01-12 22:22:01 +01:00
Alex
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
StealWonders
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
Alex
8f7c2e4c02
fix: /plot music being able to be used on unclaimed plots (#3432) 2022-01-11 11:01:36 +01:00
Xaver106
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
renovate[bot]
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
Jordan
31f48cc7d1
Fix: 1.18 uses the same field as 1.17 for mustNotSave (#3428) 2022-01-05 21:22:09 +01:00
Jordan
4b77f1ab28
Make road flags great again (#3420)
Fixes #3111
2022-01-05 21:21:58 +01:00
Jordan
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
Jordan
0c76d08b10
Only send border area exit message once (#3418)
Fixes #3335
2022-01-05 21:21:37 +01:00
Jordan
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
Jordan
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
NotMyFault
07d0f124b4
ci: Let release drafter listen to forks too 2022-01-05 11:56:28 +01:00
Alex
8d6c621763
ci: Setup auto rebase (#3431) 2022-01-04 15:38:21 +01:00
renovate[bot]
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
renovate[bot]
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
renovate[bot]
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
NotMyFault
25095f4546
chore: Welcome 2022 2022-01-02 22:22:19 +01:00
Alexander Söderberg
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
Jordan
07fdc94dd8
Account for mutability of plot objects when sending move/swap success messages (#3414)
Fixes #3337
2021-12-31 15:46:08 +01:00
NotMyFault
b501a81e21
build: Exchange mvdwapi version to our ones 2021-12-31 01:29:30 +01:00
dordsor21
eb334b3aac
Fix: add missing placeholders for plot info
Fixes #3339
2021-12-30 14:41:31 +00:00
NotMyFault
a77a51b6f2
build: Back to snapshot for development 2021-12-30 10:31:08 +01:00
NotMyFault
7d981bc610
build: Release 6.2.2 2021-12-30 10:14:15 +01:00
Alex
3eb485e900
refactor: Drop guava annotations and create annotation helper (#3389) 2021-12-29 16:18:19 +01:00
Yannick Lamprecht
9f4af889f7
fix: npe thrown in entity spawn listener (#3399) 2021-12-27 11:01:28 +01:00
renovate[bot]
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
renovate[bot]
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
renovate[bot]
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
Alex
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
Yannick Lamprecht
e042566bb7
fix: Strip redundant space at flag collection (#3400) 2021-12-26 23:28:03 +01:00
dordsor21
1f26808c7b
Don't return the "side" for world plots when accessing default home locations 2021-12-22 17:47:48 +00:00
dordsor21
a7026047d0
Adding gold at the end might stop the prefix weirdness? 2021-12-22 17:46:39 +00:00
NotMyFault
af2613202d
refactor: Satisfy Semgrep 2021-12-22 02:06:07 +01:00
renovate[bot]
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
renovate[bot]
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
renovate[bot]
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
renovate[bot]
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
renovate[bot]
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
NotMyFault
7002df0bc7
build: Bump dependencies for 1.18 2021-12-18 23:10:41 +01:00
NotMyFault
958aac3cb1
chore: Configure bolt 2021-12-18 13:12:00 +01:00
zombachu
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
zombachu
92f41f43c5
fix: Ignore the use flag for liquid placement/removal (#3375)
Fixes #3069
2021-12-17 21:52:15 +01:00
NotMyFault
392ee9fa07
ci: Escape workflow tasks 2021-12-17 21:36:56 +01:00
NotMyFault
8859871e89
build: Back to snapshot for development 2021-12-14 23:14:35 +01:00
NotMyFault
93d99630a9
build: Release 6.2.1 2021-12-14 23:06:55 +01:00
Alex
47ae79e123
Revert "refactor: Address MiniMessage deprecations (#3354)" (#3371)
This reverts commit f086826942288bcdfb99ee8eff450cd7cf0db038.
2021-12-14 23:04:36 +01:00
renovate[bot]
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
renovate[bot]
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
NotMyFault
d9a6431078
build: Back to snapshot for development 2021-12-13 13:47:28 +01:00
NotMyFault
e9c9375e78
build: Release 6.2.0 2021-12-13 13:35:37 +01:00
renovate[bot]
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
NotMyFault
88eb8f88a7
build: Update com.fastasyncworldedit to v1.17-419
Closes #3363
2021-12-13 11:11:00 +01:00
renovate[bot]
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
Alex
858b6b5471
tests: Move to JUnit 5 (#3357) 2021-12-13 10:41:36 +01:00
Alex
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
NotMyFault
9c84dc2bc0
build: Update pipeline version to release build 2021-12-10 11:25:21 +01:00
Alex
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
Pierre Maurice Schwang
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
renovate[bot]
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
NotMyFault
2a40f52dea
docs: Update issue template to 1.18 2021-12-05 23:29:28 +01:00
Alex
3ed369de19
style: Add missing bracket for deny example (#3351) 2021-11-29 20:56:48 +01:00
renovate[bot]
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
renovate[bot]
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
Pascal Bürklin
8f3fa419c4
Fixes #3344, Wrong iterator algorithm in PlotRangeIterator (#3345) 2021-11-23 19:52:23 +00:00
NotMyFault
a9f08bc885
build: Update dependencies
Closes #3330
2021-11-15 12:41:52 +01:00
NotMyFault
a8923ec729
build: Back to snapshot for development 2021-11-11 23:01:37 +01:00
NotMyFault
4eafd043a3
Release 6.1.4 2021-11-11 22:49:46 +01:00
NotMyFault
826cc8c835
build: Update Gradle 2021-11-11 22:43:48 +01:00
dordsor21
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
Jordan
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
dordsor21
87a2e81ec3
Don't write biome data to schematics if it's not present 2021-11-10 19:51:14 +00:00
Alex
88775334b7
Schematic paths are configurable (#3303) 2021-11-09 10:32:07 +00:00
renovate[bot]
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
Jordan
c1163cdb2e
feat: Split configuration for teleport on claim/auto (#3308)
- Fixes #2953
2021-11-07 22:29:49 +01:00
NotMyFault
30d06b7801
build: Reduce consumer dependencies 2021-11-05 11:57:58 +01:00
dordsor21
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
dordsor21
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
Hannes Greule
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
Alex
48c7a3e94e
refactor: Use player friendly done message on restricted building (#3309) 2021-11-02 13:32:04 +00:00
mindw0rm
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
renovate[bot]
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
Alex
87cb26189f
Closes #3313 2021-11-01 14:07:44 +01:00
renovate[bot]
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
renovate[bot]
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
Jordan
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
Jordan
804228fa6c
Allow pitch and yaw to be used in default home location (#3304) 2021-10-29 10:48:35 +01:00
Jordan
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
renovate[bot]
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
NotMyFault
df87bcb743
build: Back to snapshot for development 2021-10-18 20:30:28 +02:00
NotMyFault
5653d0f175
Release 6.1.3 2021-10-18 20:22:13 +02:00
NotMyFault
b022a97196
fix: Flag list parsing for console players (#3277)
Instead of recreating the logic, we can simply reuse what we created above and string-ify that for parsing.
2021-10-18 20:20:52 +02:00
dordsor21
cb596ee6ea
Fix StackOverFlow 2021-10-18 17:27:51 +01:00
Xaver106
4e391136c0
Add and Trust permission now count correctly (#3290) 2021-10-15 11:28:23 +01:00
renovate[bot]
a6a0e1d12f
chore: Update dependency org.checkerframework:checker-qual to v3.18.1 (#3283)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-10 00:23:32 +02:00
NotMyFault
d2776eed5a
[ci skip] Move to work level templates 2021-10-08 18:09:58 +02:00
NotMyFault
6528c60f4d
fix: Fix greeting & farewell captions not being used (#3272)
* fix: Fix greeting & farewell captions not being used

Fixes #3250

* feat: Allow alias in greeting & farewell flag
2021-10-07 08:10:00 +00:00
NotMyFault
7ee46be2ac
feat: Allow plot alias in title (#3273)
Fixes #3171
2021-10-07 08:07:13 +00:00
renovate[bot]
13bc231091
chore: Update com.fastasyncworldedit to v1.17-343 (#3282)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-05 10:26:42 +02:00
renovate[bot]
55d1a40394
chore: Update plugin shadow to v7.1.0 (#3284)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-04 20:18:56 +02:00
Pierre Maurice Schwang
d70f99b489
fix: Respect tab-complete aliases (Fixes #3266) (#3268)
* Fixes #3250

* ListFlag#merge should not allow duplicates (Fixes #3157) (#3265)

* feat: Respect non-visible players in tab completion (Closes #3263) (#3264)

* Respect non-visible players in tab completion (Closes #3263)

* Deprecate old Tab-Complete methods instead of hard-replacing them

* wtf git

* Mark for removal, useless new-lines

* Pass ConsolePlayer.getConsole() instead of Nullable param

* Respect tab-complete aliases (Fixes #3266)

* Useless import

Co-authored-by: NotMyFault <mc.cache@web.de>
Co-authored-by: dordsor21 <dordsor21@gmail.com>
2021-10-04 17:10:36 +02:00
renovate[bot]
fde9735da2
chore: Update dependency net.kyori:adventure-api to v4.9.2 (#3278)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-04 17:05:52 +02:00
renovate[bot]
20f0aa3656
chore: Update com.fastasyncworldedit to v1.17-341 (#3275)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-04 17:05:38 +02:00
renovate[bot]
0b7bf2d26d
chore: Update dependency dev.notmyfault.serverlib:ServerLib to v2.3.1 (#3276)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-04 17:05:24 +02:00
NotMyFault
f10e38af63
[ci skip] chore: Improve pr template fields 2021-10-04 15:43:44 +02:00
NotMyFault
21727ebfc7
build: Overhaul build & deployment workflow (#3267)
* Fixes #3250

* build: Overhaul build & deployment workflow

- Move to release drafter
- Replace publishing with gradle nexus
- Conventional commits are handy
- Determine build status in gh actions before deploying
2021-10-04 15:28:47 +02:00
Pierre Maurice Schwang
e322ee85fd
feat: Respect non-visible players in tab completion (Closes #3263) (#3264)
* Respect non-visible players in tab completion (Closes #3263)

* Deprecate old Tab-Complete methods instead of hard-replacing them

* wtf git

* Mark for removal, useless new-lines

* Pass ConsolePlayer.getConsole() instead of Nullable param
2021-10-03 14:32:02 +02:00
Pierre Maurice Schwang
541255fe7e
ListFlag#merge should not allow duplicates (Fixes #3157) (#3265) 2021-10-03 14:31:57 +02:00
renovate[bot]
20c2f36f6c
Update com.fastasyncworldedit to v1.17-336 (#3258)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-29 18:09:46 +02:00
renovate[bot]
744f7a18ae
Update dependency org.junit.jupiter:junit-jupiter to v5.8.1 (#3259)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-29 18:09:35 +02:00
NotMyFault
18eece0b71
[ci skip] chore: Renovate
Closes #3260
2021-09-29 18:09:12 +02:00
Kevin Ludwig
4f12dcf966
Return base plot when using alias (#3253) 2021-09-25 15:58:31 +02:00
NotMyFault
ee832528db
[ci skip] Adjust renovate config
Closes #3252
2021-09-21 00:52:25 +02:00
NotMyFault
bb5d6c91da
Update Fawe version 2021-09-20 16:21:18 +02:00
dordsor21
6d4adecb32
6.1.3 2021-09-18 23:07:10 +01:00
dordsor21
c37b13dcb3
Fix bad move to adventure 2021-09-18 21:54:22 +01:00
renovate[bot]
086dac2ea4
Update dependency net.kyori:adventure-platform-bukkit to v4.0.0 (#3245)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-16 15:29:17 +02:00
dordsor21
b2b8598b5b
Fix #3246 2021-09-15 13:19:25 +01:00
NotMyFault
61e5d9f1b6
Move /p components title to translations file matching other parts of components
- Also component-ify title, this must not be limited to a String.
2021-09-15 11:13:03 +02:00
renovate[bot]
c8989b3332
Update dependency org.junit.jupiter:junit-jupiter to v5.8.0 (#3244)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-13 10:23:38 +02:00
NotMyFault
9f54472dd6
Relocate annotations properly 2021-09-12 13:56:08 +02:00
NotMyFault
115932c65a
6.1.2 2021-09-11 14:28:08 +02:00
dordsor21
04821f777e
Mappings be obfuscated 2021-09-11 12:19:46 +01:00
dordsor21
cfae804780
6.1.1 2021-09-10 15:01:05 +01:00
dordsor21
4568b17c54
Fix issues with chunk saving in single world plots 2021-09-10 14:05:12 +01:00
NotMyFault
7bc76a3824
Update serverlib 2021-09-09 21:50:11 +02:00
renovate[bot]
4b8180807c
Update dependency com.intellectualsites.http:HTTP4J to v1.3 (#3239)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-09 21:44:23 +02:00
dordsor21
d77a8c8fa4
Some improvements to events (#3238)
#3222 #3072
2021-09-09 21:37:44 +02:00
NotMyFault
27a8fcd739
Plot location may be final 2021-09-09 12:36:09 +02:00
SirYwell
c25a0c65a2 Don't check same plot over and over again 2021-09-08 18:37:45 +02:00
NotMyFault
b224a8d1b8
Include world in plot chat & spy template 2021-09-07 16:36:08 +02:00
NotMyFault
87d134215f
Fix placeholder if world already exists. 2021-09-07 16:20:45 +02:00
dordsor21
93e280dba4
Remove unneeded commented out code 2021-09-07 15:08:00 +01:00
dordsor21
732f79bbfc
Fix #3231 2021-09-07 14:47:37 +01:00
dordsor21
8e5e33eec2
Fix #3127 2021-09-07 14:02:48 +01:00
NotMyFault
da3fb1abec
Closes #3236 2021-09-07 13:52:47 +02:00
NotMyFault
62d6b21081
[ci skip] Closes #3232 Closes #3233 2021-09-06 15:04:07 +02:00
NotMyFault
4caaead7ee
Renovate
Closes #3217
Closes #3226
Closes #3227
Closes #3229
Closes #3230
2021-09-06 13:47:40 +02:00
NotMyFault
be38086f6c
Update Fawe 2021-09-05 00:13:32 +02:00
NotMyFault
c18b0f943c
Switch deployment to the central repository 2021-09-04 13:58:16 +02:00
NotMyFault
f036980dc5
Disband wilderness permission pack 2021-09-03 20:01:37 +02:00
dordsor21
0e4f54e9c0
Bump (FA)WE versions 2021-08-29 10:56:57 +01:00
dordsor21
7a3d5bd737
Don't trigger async catcher when adding chunk ticket
- Apparently PaperLib#getChunkAtAsync#whenComplete doesn't necessarily run the task on the main thread
2021-08-25 15:24:07 +01:00
NotMyFault
2ab1973668
Handle administrative overrides sanely 2021-08-25 11:49:54 +02:00
NotMyFault
387c6e79ba
Return after invalid plot size 2021-08-25 11:10:02 +02:00
NotMyFault
e3e00d34ef
Improve error message claiming plots with ids 2021-08-25 01:36:19 +02:00
NotMyFault
40e651188e
Improve javadoc linking 2021-08-24 15:34:21 +02:00
SirYwell
b2915d9bd7 add license... 2021-08-23 10:11:43 +02:00
SirYwell
6ec136a03d Make sure lock is free'd even on error (fixes #3116) 2021-08-23 10:05:38 +02:00
dordsor21
a8fc6662e0
Allow visit to work when players are not the owner of the base plot 2021-08-22 16:26:49 +01:00
dordsor21
fb8e749411
Still allow serialisation of PlotTitle flag 2021-08-22 15:58:15 +01:00
dordsor21
4b26a7e300
Allow PlotTitle to have a "null" mode (default plot title flag should be the configured values) 2021-08-22 15:55:09 +01:00
dordsor21
8a53b41b52
Improve ChunkListener class
- Add quicker method for getting chunks (not requiring a slow stream done by CB) but comment it out for now because we shouldn't need to do our own GC for loaded chunks; they're "handled much better by minecraft as of 1.14" (not really) meaning the required methods for testing if a chunk is allowed to be unloaded is not present. We instead must now rely on the ChunkUnloadEvent for setting if a chunk should be saved.
- Optimise the shouldSave method by not requiring access to injected classes frequently. Location#getPlot methods are not optimised for frequent usage in the same task.
2021-08-22 15:54:05 +01:00
NotMyFault
daa8ffc38f
6.0.10 2021-08-19 20:51:51 +02:00
dordsor21
34f0236e9f
Add option to "update" blocks that are altered in P2 queues. (#3200) 2021-08-19 20:30:38 +02:00
Traks
8f0ae7e51d
Clean up chunk coordinators and queue coordinators (#3208) 2021-08-19 12:31:47 +01:00
NotMyFault
2988ad6b11
Address style violations 2021-08-18 11:58:18 +02:00
dordsor21
252d6a2866
Fix nms chunk reference 2021-08-17 22:43:58 +01:00
dordsor21
b8c9ae2b0b
Bump FAWE version 2021-08-17 22:43:47 +01:00
NotMyFault
bfe2dda5b1
Closes #3212 2021-08-17 16:38:24 +02:00
dordsor21
33a79595af
Add TitleFlag (#3202) 2021-08-16 09:02:58 +00:00
dordsor21
eb2848e5d7
Fix bad method names etc for chunk/world listener 2021-08-15 13:58:56 +01:00
dordsor21
da4ae9f4f5
Slightly change how flag permissions are handled (#3201) 2021-08-14 13:13:01 +00:00
NotMyFault
b841a7c03b
Fix javadoc linking of deprecated methods 2021-08-11 17:58:24 +02:00
dordsor21
4ee5e3d134
Invert toggle messages where the toggle disables rather than enables 2021-08-08 16:51:21 +01:00
dordsor21
0e05935ad4
Fix #3166 2021-08-08 14:06:59 +01:00
dordsor21
78a775530a
Merge branch 'v6' of github.com:IntellectualSites/PlotSquared into v6 2021-08-08 12:36:23 +01:00
dordsor21
dd36036334
Allow players to /plot home from non-plot-areas if per-world-teleport is enabled 2021-08-08 12:36:08 +01:00
Hannes Greule
3b2a04e4db
Fix/v6/click event actions (#3178)
Co-authored-by: NotMyFault <mc.cache@web.de>
Co-authored-by: dordsor21 <dordsor21@gmail.com>
2021-08-08 11:28:43 +00:00
SirYwell
5ab8d50b86 Don't keep PlotFlagUpdateHandlers forever
This allows Plots, FlagContainers and its PlotFlagUpdateHandlers being cleaned up by the GC correctly
2021-08-08 12:18:25 +01:00
NotMyFault
391476ba26
6.0.9 2021-08-05 14:08:41 +02:00
NotMyFault
25a69f4ca0
Escalate null entries in the db to the warn level 2021-08-04 23:09:38 +02:00
Patrick "IPat" Hein
c8c946cc10
Fix /p kick msg (#3186)
* Negate mob-place flag debug message

* fixed a little typo :)

* Added check for dragon egg teleportation event
https://github.com/IntellectualSites/PlotSquared/issues/3074

* Basic dragon egg interact bugfix (Left-click interaction)

* Lifted admin if-condition out of roads (out-of-plot) only block (for animals)

* Fix https://github.com/IntellectualSites/PlotSquared/issues/3185
/p kick missing permission feedback format fix

* remove unnecessary import

Co-authored-by: NotMyFault <mc.cache@web.de>
2021-08-04 20:59:19 +02:00
Traks
a405611b3a
Fix emptying buckets in plot border (#3192)
* Fix emptying buckets in plot border

* Note on 1.13 compatibility for bucket-empty event

Co-authored-by: NotMyFault <mc.cache@web.de>
2021-08-03 21:03:53 +00:00
Traks
fd4cec39c4
Fix sponge absorbing water across plot borders (#3191)
* Fix sponge absorbing water across plot borders

* Shorten for-loops by using removeIf

* Use 'Location' instead of 'var'

Co-authored-by: NotMyFault <mc.cache@web.de>
2021-08-03 19:07:02 +00:00
NotMyFault
e7fa057abe
Detach shoulder entities from natural mob spawning 2021-08-03 10:20:59 +02:00
NotMyFault
a86c06bb81
Update a few dependencies 2021-08-01 20:10:06 +02:00
NotMyFault
9afaead81c
Move to security advisory 2021-07-31 18:15:53 +02:00
NotMyFault
6e7bd0a536
Left over from 89e17bb468476d2399576090393a79018e22fd0d 2021-07-31 10:43:11 +02:00
SirYwell
89e17bb468 Properly handle economy initialization (fixes #3189) 2021-07-30 20:29:12 +02:00
NotMyFault
8fc9e0b13f
Be a bit more helpful with deleted plotworlds and invalid db entries 2021-07-28 22:23:55 +02:00
Aurélien
6ad51bba65
Hot-fix for IntellectualSites#3179 (#3188)
Authored by @SirYwell ty!
2021-07-28 12:42:20 +02:00
NotMyFault
9d396fa91f
Fixes #3184 2021-07-27 15:04:22 +02:00
NotMyFault
a8c3ac6cee
Fixes #3181 2021-07-26 22:19:17 +02:00
NotMyFault
9a9365a04d
Fixes #3180 2021-07-26 21:23:59 +02:00
NotMyFault
c9b012ea5b
Leave a note when using deprecated commands 2021-07-24 18:01:26 +02:00
NotMyFault
9dd35e87d6
We're using .editorconfig > code_style.xml 2021-07-23 22:23:49 +02:00
NotMyFault
82f0b4194f
Update Fawe version 2021-07-23 17:36:34 +02:00
dordsor21
3b27b6c850
FAWE-Bukkit shouldn't be in core 2021-07-23 16:24:30 +01:00
Traks
1e41734826 Send usage for '/p v' for too many arguments 2021-07-23 15:34:25 +01:00
Traks
a83a79c17e Error message for '/p v' when page out of range 2021-07-23 15:34:25 +01:00
Traks
8a77d5a450 Fix index out of bounds for '/p h' 2021-07-23 15:33:35 +01:00
dordsor21
2676b76107
6.0.8 2021-07-22 21:46:25 +01:00
dordsor21
51ff043af9
Prevent users defining their own click events in descriptions/farewells/greetings by default 2021-07-22 21:45:51 +01:00
Traks
fbde60fcf9
Handle edge cases of EntityChangeBlockEvent (#3163)
* Handle edge cases of EntityChangeBlockEvent

* Remove excessive plot area existence check

Co-authored-by: NotMyFault <mc.cache@web.de>
2021-07-21 19:57:42 +00:00
NotMyFault
a0557112a1
Handle db command args sanely 2021-07-21 15:55:26 +02:00
NotMyFault
6d71e0f8be
Fixes 3168 2021-07-20 22:21:32 +02:00
NotMyFault
62e17f5fc5
[ci skip] Fix CONTRIBUTING.md link 2021-07-20 11:23:57 +02:00
dordsor21
613a92eeb9
6.0.7 2021-07-17 17:59:41 +01:00
dordsor21
31522b6502
Check plot ownership/event before handling Direction.ALL 2021-07-17 17:51:48 +01:00
Traks
2e64ac6d25
Revert projectile hit on splash (#3162)
* Revert projectile hit on splash

* Notes about potions splashing after hit cancelled
2021-07-15 18:43:05 +02:00
Traks
fe65a0c548
Fix off-by-one error in schematic pasting (#3160) 2021-07-14 17:58:04 +02:00
Traks
cc60d50dd2
Actually cancel projectile hit events (#3154)
Co-authored-by: NotMyFault <mc.cache@web.de>
2021-07-13 08:57:12 +00:00
NotMyFault
a797d748ea
Handle /p f add message properly
- Leave a note if the database connection has been established properly
2021-07-12 22:55:28 +02:00
NotMyFault
2d1e3b8c03
Fixes #3148 2021-07-12 18:12:54 +02:00
NotMyFault
635e18e7ed
Add copper-oxide flag 2021-07-10 15:50:38 +02:00
dordsor21
b9cb6842e2
Add an online check for teleport listener
- Some plugins seem to like teleport players before they're online (e.g. NoCheatPlus)
 - Addresses #3142
2021-07-10 10:40:44 +01:00
Patrick "IPat" Hein
991703914c
Batching task count reset (#3144)
* Negate mob-place flag debug message

* fixed a little typo :)

* Added check for dragon egg teleportation event
https://github.com/IntellectualSites/PlotSquared/issues/3074

* Basic dragon egg interact bugfix (Left-click interaction)

* Lifted admin if-condition out of roads (out-of-plot) only block (for animals)

* See 4514d39bbd

Co-authored-by: NotMyFault <mc.cache@web.de>
2021-07-07 10:10:51 +02:00
NotMyFault
fdb6367351
Remove unneeded maven repos 2021-07-05 15:25:22 +02:00
NotMyFault
bbee330f4f
Don't append color codes to component lore
- Color codes are defined thru the file. Adding these here will clash with any other codes you already use
- Remove prefix from component GUI
2021-07-05 11:08:07 +02:00
renovate[bot]
8b8ac76852
Merge pull request #3136 from IntellectualSites/renovate/gradle-7.x
Update dependency gradle to v7.1.1
2021-07-02 17:58:00 +02:00
NotMyFault
3b5b51b40c
Update link if outdated Fawe version is spotted 2021-07-02 14:22:33 +02:00
NotMyFault
5395ddc6a3
Update build.gradle.kts 2021-06-29 11:50:47 +02:00
NotMyFault
60c701d20b
Don't display plot rating placeholder in scientific notation
Fixes #3091
2021-06-28 18:49:03 +02:00
NotMyFault
eb11d9e3aa
Handle add & trust permission ranges properly 2021-06-28 16:40:01 +02:00
SirYwell
7898313b0b Check super types and interfaces on PlotPlayer#from
fixes https://github.com/IntellectualSites/FastAsyncWorldEdit/issues/1140
2021-06-28 09:53:00 +02:00
NotMyFault
8e23b10f7c
Fix update notification ingame message 2021-06-27 18:11:57 +02:00
NotMyFault
c46647d491
Handle plots.deny.<amount> properly 2021-06-27 16:40:45 +02:00
NotMyFault
013e8fcda5
Leave a note where to get additional translations 2021-06-27 15:23:11 +02:00
dordsor21
f4ff9c0336
6.0.5 2021-06-27 13:21:44 +01:00
dordsor21
7c4d96e176
Fix #3117 2021-06-27 13:06:10 +01:00
dordsor21
2c920bd016
6.0.4 2021-06-26 20:11:15 +01:00
dordsor21
a5452012b5
separate 1.17-only events 2021-06-26 20:08:25 +01:00
dordsor21
43dd35f54b
6.0.3 2021-06-26 19:53:59 +01:00
dordsor21
67bbd64fa1
Update to FAWE 1.17 2021-06-26 16:19:07 +01:00
SirYwell
8f48b83c79 Replace the proper string in expressions 2021-06-24 19:14:59 +02:00
NotMyFault
6a57a5c369
Fixes #3100 2021-06-24 16:40:10 +02:00
NotMyFault
20df062d9f
Back to snapshot for development 2021-06-23 11:50:24 +02:00
NotMyFault
9fa0a8b27b
Update ServerLib & remove Java version check
We now require Java 16 onwards
2021-06-22 23:49:31 +02:00
NotMyFault
9acf9f4f19
Improve documentation of deprecated methods 2021-06-22 18:11:48 +02:00
SirYwell
0e84cf085b Fix compatibility issues with Citizens (fixes #3105) 2021-06-22 10:18:48 +02:00
SirYwell
ca9e371067 Teleport all players from plot on clear and delete (fixes #3102) 2021-06-21 18:20:47 +02:00
SirYwell
56920fe833 Load configs before accessing them (fixes #3099) 2021-06-21 16:38:40 +02:00
NotMyFault
f2e6fd9692
Bump PlotAPI version 2021-06-21 12:05:56 +02:00
NotMyFault
b2966cbc45
Back to snapshot for development 2021-06-21 11:51:20 +02:00
NotMyFault
45c566859e
Don't fail loading on versions prior to 1.17 2021-06-21 10:30:48 +02:00
NotMyFault
654f7ed3ae
Fix arkitektonika backend url 2021-06-20 20:13:37 +02:00
NotMyFault
f1ef07bee0
Merge branch 'v6' of https://github.com/IntellectualSites/PlotSquared into v6 2021-06-20 18:28:29 +02:00
NotMyFault
3e28d39285
We don't need "no-nashorn" config option in v6 2021-06-20 18:28:13 +02:00
NotMyFault
8eb8c24209
Merge branch 'v5' into v6 2021-06-20 18:22:21 +02:00
NotMyFault
4dbbf8f599
1.17 (#3088)
* Minor work for 1.17

* Address TODOs

Introduce `entity-change-block` flag covering blocks affected by `onPeskyMobsChangeTheWorldLikeWTFEvent`. Previously this was covered by the mob-place flag, however, changing the tilt state of big drip leafs and a series of other blocks call `EntityChangeBlockEvent` so this shouldn't be covered by mob flags only.

* Address other TODOs

* Compile against paper 1.17

This will only work if you built paper locally and deployed it to your local maven repo.

* Updated linked javadoc links

* Handle sculk sensor events in a more controllable way

* Update issue forms for 1.17
2021-06-20 18:17:18 +02:00
dordsor21
a3ebabacb8
Fix #3095 2021-06-18 15:45:45 +01:00
NotMyFault
440afcca5d
Fixes #3066 2021-06-18 16:37:25 +02:00
NotMyFault
8220d4aa31
Update licenser & gradle 2021-06-18 01:22:24 +02:00
NotMyFault
b196c9ce8e
Fix place flag message 2021-06-16 01:15:09 +02:00
dordsor21
93568f9f7f
Update pom 2021-06-12 12:09:40 +01:00
dordsor21
b01291c4ff
Add note about PlayerPlotAutoEvent return null plot 2021-06-12 11:36:33 +01:00
dordsor21
a9d896eb45
Add note about PlayerPlotAutoEvent return null plot 2021-06-12 11:35:55 +01:00
dordsor21
3cd9b76805
Implement "off" to PlotWeather flag and make it default
- Players with "player weather" will no longer have their weather reset on plots that do not set the PlotWeather flag
2021-06-10 11:43:12 +01:00
dordsor21
e2700d3b28
Implement "off" to PlotWeather flag and make it default
- Players with "player weather" will no longer have their weather reset on plots that do not set the PlotWeather flag
2021-06-10 11:41:55 +01:00
NotMyFault
942d799c9c
Make "NaN" in placeholders translatable 2021-06-09 21:51:51 +02:00
dordsor21
f0cbc4f23e Add whenDone task to setCuboids and ensure whenDone tasks are added to the queue before FAWE might do something 2021-06-09 13:09:50 +01:00
dordsor21
9bd14b142b Move FAWE detection before guice injection/configuration 2021-06-09 13:09:50 +01:00
dordsor21
4ba1217b84 Fix licences 2021-06-09 13:09:50 +01:00
dordsor21
50d4353045 begin integration with fawe 2021-06-09 13:09:50 +01:00
dordsor21
19e97a7738
Correctly handle coordinates in swapping
Fixes #3030
2021-06-08 20:31:53 +01:00
SirYwell
2ac5fe45e3 Make CaptionLoader namespace-aware 2021-06-08 15:36:03 +02:00
NotMyFault
7f3d3ecb00
Fixes #3018 2021-06-08 14:25:08 +02:00
NotMyFault
331a6ea1b3
Remove "ORE" from setup steps
Touches #3068
Generating a world with just ore is used nowhere and needs to be reimplemented properly at some time.
2021-06-08 13:06:42 +02:00
SirYwell
8f2f673438 👀 2021-06-08 12:24:57 +02:00
SirYwell
66e12e2a0c Make world settings reloadable 2021-06-08 12:10:21 +02:00
SirYwell
2b3ecc178a Fix some inbox issues 2021-06-08 11:56:03 +02:00
NotMyFault
df842c355e
5.13.13 2021-06-08 10:52:51 +02:00
NotMyFault
9b043b7444
Make /plot rate categories translatable 2021-06-08 10:49:26 +02:00
NotMyFault
ce287cf218
Add toggle allowing to opt out nashorn 2021-06-08 00:16:55 +02:00
NotMyFault
24945efc7d
Merge branch 'v5' into v6 2021-06-06 21:41:24 +02:00
NotMyFault
a01ad5aa04
Update wiki location 2021-06-06 21:40:34 +02:00
NotMyFault
fa14c40283
Update wiki links 2021-06-06 21:38:49 +02:00
NotMyFault
d8f19cec66
Adjust improper origin -> target message of plot moving 2021-06-04 19:17:20 +02:00
SirYwell
955341ff9f Move enqueue to the actual end of the code 2021-06-04 18:41:57 +02:00
SirYwell
cb342de934 Check merge status from correct plot 2021-06-04 13:39:03 +02:00
SirYwell
ea0342f100 Enqueue on unlink 2021-06-04 13:39:03 +02:00
NotMyFault
cd57741a51
Fix typo introduced in f4552e358d900968e7c1f09cebb4d118ce055d8b 2021-06-03 12:53:47 +02:00
NotMyFault
f4552e358d
Fixes #3027
- Ditch slf4j in favor of log4j. slf4j is (unfortunately) very much unmaintained at this time and future versions of MC (1.17+) will use log4j version 2.14.1 onwards over some ancient sfl4j version.
- Using log4j reduces our jar size as well, because we don't need to bridge it as the game provides it natively.
2021-06-03 12:40:27 +02:00
NotMyFault
1dc225362d
Bump gh action tasks prevent failing of gradle wrapper validation 2021-06-02 23:29:43 +02:00
Mariell Hoversholm
a6b3e97cda
feat: re-add aggregated javadocs task (#3077)
* feat: re-add aggregated javadocs task

This was removed by IntellectualSites/PlotSquared#2922.
Closes IntellectualSites/PlotSquared#3037.

Signed-off-by: Mariell Hoversholm <proximyst@proximyst.com>

* feat: aggregate javadocs on root build task

Signed-off-by: Mariell Hoversholm <proximyst@proximyst.com>

* Address changes requested

Co-authored-by: NotMyFault <mc.cache@web.de>
2021-06-02 23:26:27 +02:00
Patrick "IPat" Hein
8a244d12fc
Fix if-condition limited to roads for animal attack cancelling on plots (#3079)
* Negate mob-place flag debug message

* fixed a little typo :)

* Added check for dragon egg teleportation event
https://github.com/IntellectualSites/PlotSquared/issues/3074

* Basic dragon egg interact bugfix (Left-click interaction)

* Lifted admin if-condition out of roads (out-of-plot) only block (for animals)

Co-authored-by: NotMyFault <mc.cache@web.de>
2021-06-02 19:55:35 +02:00
NotMyFault
5a5d1f5e62
Fixes #3063 2021-06-01 21:54:00 +02:00
NotMyFault
21214814b7
Fixes #3032 2021-05-31 21:59:15 +02:00
NotMyFault
3ac93dcfca
Enhance /plot target & expiry confirm message 2021-05-28 20:21:41 +02:00
NotMyFault
c509882a18
Enhance alias message with placeholders 2021-05-28 11:37:13 +02:00
Orlaando
c146d6207d
Make /plot pardon an alias of Plot Remove (#3071)
* Make /plot pardon an alias of /plot undeny

* Make Remove state more clearly what it does

* Lazily target v6
2021-05-28 11:01:42 +02:00
Patrick "IPat" Hein
2045a4988d
Prevent dragon eggs from leaving or entering plot bounds (#3075)
* Negate mob-place flag debug message

* fixed a little typo :)

* Added check for dragon egg teleportation event
https://github.com/IntellectualSites/PlotSquared/issues/3074

* Basic dragon egg interact bugfix (Left-click interaction)

Co-authored-by: NotMyFault <mc.cache@web.de>
2021-05-28 10:57:48 +02:00
NotMyFault
dc7e6010cb
Fixes #3073
- Also add new caption if attempting to clear an empty alias
2021-05-27 17:06:04 +02:00
NotMyFault
b1fc17e045
Remove scripting from javadocs 2021-05-25 20:51:26 +02:00
NotMyFault
daf0e6e1ba
Use same creation message for templates like for setup 2021-05-25 11:02:37 +02:00
NotMyFault
6f263735f0
Move notification-as-actionbar into the Chat config block
- Move titles alongside all its new options into its own config block
- Move `titles-as-actionbar` into the new titles block
- Enhance notification about removed config entries
2021-05-24 21:52:27 +02:00
NotMyFault
1d2aa74e51
Add actionbar message for notification flags
- Move title_as_actionbar boolean into enabled_components
2021-05-24 13:49:00 +02:00
Glare
a69b1d895c
Implemented the ability to change titles to actionbar on plot entry (#3060)
* Implemented the ability to change titles to actionbar on plot entry

* Fixed typo in action

* Updated explanation in Javadoc

* Implemented suggestions

* Remove excess import

* Implemented PR suggestions

Co-authored-by: NotMyFault <mc.cache@web.de>
2021-05-23 17:28:03 +02:00
NotMyFault
399d77c60f
Component-ify plot setup wizard
Touches #3068
2021-05-22 19:49:22 +02:00
NotMyFault
b768ee6d41
Don't send teleport message before the teleportation is initiated 2021-05-22 18:15:34 +02:00
NotMyFault
58faffed6d
Remove chat.interactive option
Whether the chat is interactive or not can be declared in the strings.json by using MMs <click:_action_:_value_> type.
2021-05-22 13:22:44 +02:00
NotMyFault
87706d471b
Add option for legacy sign material
Follow up to cde27899dd019e40bb8b6008a456a9477ad246b7
2021-05-22 12:34:04 +02:00
Glare
eb7eb15ee7
Implemented tab completion for /plot help (#3053)
Co-authored-by: NotMyFault <mc.cache@web.de>
2021-05-22 02:23:54 +02:00
NotMyFault
a17085bb18
Remove dead imports 2021-05-21 20:56:44 +02:00
NotMyFault
cde27899dd
Fixes #3064 2021-05-21 19:14:13 +02:00
NotMyFault
93ff778de0
Add administrative override for /plot components 2021-05-21 17:54:26 +02:00
NotMyFault
17f91c8eb9
Make /plot rate GUI items customizable
Bye bye legacy items :)
2021-05-21 16:48:34 +02:00
NotMyFault
7775cd0073
Do not rely on a static file path
Doing so will cause issues with the `--plugins` flag.
E.g. `java -jar server.jar --plugins /path/to/plugins/`
2021-05-21 00:35:19 +02:00
NotMyFault
cc48f273c0
Fixes #3057
Actually execute a kick from server if ordered
2021-05-20 21:59:05 +02:00
NotMyFault
c8406681d7
Notify the kicked person over the actor 2021-05-20 21:22:00 +02:00
NotMyFault
a05dd19986
Fixes #3058
- Anonymize meta data keys
2021-05-20 21:04:07 +02:00
NotMyFault
aae350c1b3
Enhance flag tutorial message 2021-05-20 19:57:06 +02:00
NotMyFault
c48559410f
Provide instruction about the .editorconfig 2021-05-20 00:26:35 +02:00
NotMyFault
9c59bfde52
Rephrase message if user has no access to sub-command help pages 2021-05-19 23:48:32 +02:00
Patrick "IPat" Hein
eb9d7e97d9
Bug through last Economy PR - Withdrawn money for non-affordable plots (#3036)
* Replaced economy supported (Vault) check within cost condition with a pre-eliminating if-guard

* Negate mob-place flag debug message

* Actually prevent purchase of plots if they can't afford it (whoops)

Co-authored-by: NotMyFault <mc.cache@web.de>
2021-05-19 17:44:45 +02:00
NotMyFault
24eebe6711
Update gradle to 7.0.2 2021-05-19 11:51:55 +02:00
SirYwell
a2b8e4493f Fix infinite loop on multi auto (fixes #3022) 2021-05-18 22:30:40 +02:00
Patrick "IPat" Hein
7c4a85325c
Added event handler for cauldron water level modification to prevent untrusted players interacting with a plot (#3035)
* Added check for burning players using non-trusted plots cauldrons to extinguish themselves, causing the cauldron level to decrease

* Cancelling burning of players without downscaling water instead of ignoring their burn status

* Using Java 14 JEP 305 enhanced instanceOf

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

* Players without permissions may not wash banners or armor now either. Rain modification is now permitted.

* Extinguishing is now explicitly handled so that event handling for other plugins has the actual information of the new cauldron water level

* Un-nestified the if-condition :)

* Properly cancelled the event (since it is semantically cancelled)

* (Actually) properly cancelled the event (since it is semantically cancelled)

Co-authored-by: NotMyFault <mc.cache@web.de>
2021-05-18 19:23:22 +00:00
SirYwell
94ba90d694 Always initialize PermissionHandler (fixes #3019) 2021-05-18 21:17:47 +02:00
NotMyFault
e97bc25fb8
Log plot chat to console
- Fix plot music removal template
- Fix debug args
2021-05-17 10:35:09 +02:00
NotMyFault
73936bb10d
Fix licenser issues 2021-05-17 09:31:33 +02:00
NotMyFault
23e65ac5d3
Merge branch 'feature/v6/update-licenser' into v6 2021-05-17 09:29:08 +02:00
NotMyFault
9dc0396411
Fix plot list coloring 2021-05-16 22:47:02 +02:00
NotMyFault
cc6db9ae9e
Merge branch 'v5' into v6 2021-05-15 20:47:01 +02:00
NotMyFault
3748d8e246
Minor cleanup in favor of Java 16
- Addressing a few command deprecations during the major release superseded by toggles
- Don't swallow SQL warnings in loggers behind debug, as it's often set to false
- Deleted JavaVersionCheck, it's part of ServerLib.
2021-05-15 20:39:16 +02:00
NotMyFault
0341111f8f
Add lectern-read-book flag
Fixes https://github.com/IntellectualSites/PlotSquared/issues/2980
2021-05-14 18:22:02 +02:00
NotMyFault
a7c4b40fcc
Add no-portals and deny-portal-travel flag 2021-05-14 15:51:20 +02:00
NotMyFault
e7fb3571ac
Update licenser 2021-05-14 13:36:18 +02:00
NotMyFault
58ad9db5ed
Jump to Java 16 2021-05-14 01:04:09 +02:00
Aurélien
6fd55b47c2 Fix typo 2021-05-13 21:41:10 +01:00
NotMyFault
3d7c191d1c
Make the plot jukebox gui translatable
Fixes https://github.com/IntellectualSites/PlotSquared-Translations/issues/2
2021-05-13 20:21:19 +02:00
NotMyFault
9344e1ca79
Make /plot setup header translatable
- Document a couple of permission nodes
2021-05-13 13:32:34 +02:00
Patrick "IPat" Hein
68eb5cd74f
Replaced economy supported (Vault) check within cost condition with a pre-eliminating if-guard (#3014) 2021-05-12 19:00:14 +02:00
NotMyFault
ca7ac71e76
Update gradle and shadow 2021-05-12 03:00:34 +02:00
NotMyFault
3a280f3b6a
Fix a few typos 2021-05-11 19:26:39 +02:00
NotMyFault
19cea0e129
Un-stringify plot id calls
- PlotId#toString() already stringifies IDs, no need to call String.valueOf()
- Add tab completion to `/plot debugroadregen`
- Add `plots.flag.notify-leave.bypass` permission separating from notify-enter
- Add message notifying the player if the attempt to enter a plot they are denied from
2021-05-11 18:50:37 +02:00
Patrick "IPat" Hein
2c40648a60
Fixed feedback recipient for notify flags (Owner instead of entering / leaving player) (#3011) 2021-05-11 18:26:24 +02:00
NotMyFault
48815649a8
Clarify native dependency versions 2021-05-07 22:12:14 +02:00
NotMyFault
f690e14a14
Exchange EssentialsX maven repo 2021-05-07 11:08:07 +02:00
NotMyFault
b37ad79e50
Beautify empty /plot caps output
Also strip prefix from empty plot description
2021-05-07 09:59:17 +02:00
NotMyFault
a990205d41
Fix empty templates when vault not found 2021-05-07 01:53:18 +02:00
NotMyFault
891230c78e
Fix /plot sethome returning usage message & working on unclaimed plots 2021-05-07 01:27:11 +02:00
NotMyFault
8bfdf8ecf2
Fix /plot cluster sethome triggering usage message
Enhance cluster messages a bit
2021-05-07 01:18:33 +02:00
NotMyFault
78655102b9
Fix flag exception coloring 2021-05-06 19:06:50 +02:00
NotMyFault
491a171409
Fix invalid backup messages & component prefix & update minimessage 2021-05-06 10:30:04 +02:00
NotMyFault
b3aec8f839
Fix empty default flag message 2021-05-02 20:31:23 +02:00
NotMyFault
0106a4222d
Address a few deprecations 2021-05-01 18:33:02 +02:00
NotMyFault
11af33f2d5
Fixup inbox javadocs 2021-04-30 19:04:44 +02:00
NotMyFault
812442fbbc
Don't double color the inbox 2021-04-30 13:22:00 +02:00
NotMyFault
1750dd3b97
Opt in future proof gradle features 🚀 (#2950)
* Opt in future proof gradle features

* Resolve merge conflicts
2021-04-30 09:50:22 +02:00
NotMyFault
ffe298710d
Lazy merge v5/v6 2021-04-28 20:17:10 +02:00
NotMyFault
5cdb7e76fd
Update wiki and issue links 2021-04-28 20:06:19 +02:00
NotMyFault
361b936aa0
Update ServerLib 2021-04-27 11:58:49 +02:00
NotMyFault
9503b0bfc4
Merge branch 'v5' into v6 2021-04-27 11:52:44 +02:00
NotMyFault
823beaf268
Update a few dependencies 2021-04-27 11:46:14 +02:00
NotMyFault
3ada55989f
[ci skip] Setup new issue templates (#2951)
* Setup issue templates

* Exchange issue url
2021-04-26 16:25:15 +02:00
NotMyFault
de597391dc
Fix keep-inventory flag & adjust disallowed-blocks translation 2021-04-21 11:03:14 +02:00
NotMyFault
59599261ff
Fixes https://issues.intellectualsites.com/issue/PS-237 2021-04-12 16:08:31 +02:00
NotMyFault
e1fb8c1ae5
Take building min height also into consideration 2021-04-11 10:12:37 +02:00
NotMyFault
ba4146f82c
Update to gradle 7 2021-04-10 16:52:46 +02:00
Hannes Greule
a5c43bb823 Suggest flag name instead of value 2021-04-10 09:34:53 +02:00
NotMyFault
050cf3edb3
Update a few dependencies 2021-04-04 13:30:09 +02:00
NotMyFault
84d5ebfa41
Make use of because args 2021-04-03 23:15:40 +02:00
NotMyFault
6bc4e5b45c
Re add per-world-teleport 2021-04-03 22:34:43 +02:00
NotMyFault
496fe09f78
Merge branch 'v5' into v6 2021-04-03 22:31:54 +02:00
NotMyFault
19daf1bd52
5.13.12 2021-04-03 22:18:03 +02:00
Hannes Greule
74a9c2f6b4 Reimplement per-world-visit 2021-04-03 21:48:21 +02:00
NotMyFault
dd9edb68b2
Fixes https://github.com/IntellectualSites/PlotSquaredSuggestions/issues/23 2021-04-02 23:48:16 +02:00
NotMyFault
b02177e1d0
Add tab completion for gamemode flag 2021-04-02 23:20:39 +02:00
NotMyFault
600d38d3e2
Add flag placeholders to flag commands 2021-04-02 17:50:37 +02:00
NotMyFault
07fd7e497f
Strip commands from translation files 2021-04-02 14:04:17 +02:00
NotMyFault
932873ba02
Do not access nms for older versions on newer ones 2021-03-31 12:42:32 +02:00
NotMyFault
567f1d4247
Fix backup captions and add placeholders to copy/move/swap 2021-03-30 13:44:04 +02:00
Hannes Greule
3f05dfe4bf
Sort plots for /plot home the same as for /plot visit, fixes PS-188 2021-03-30 11:19:43 +02:00
NotMyFault
fbebcf57c1
Fix exporting all plots 2021-03-29 17:07:58 +02:00
NotMyFault
30d3a458e2
Addressing more issues 2021-03-28 17:39:02 +02:00
NotMyFault
7591d88d00
Fixes PS-229
Closes #2948

Co-Authored-By: Benjamin Govaerts <17101059+BenjaminGoGurts@users.noreply.github.com>
2021-03-23 23:44:27 +01:00
NotMyFault
22baabf751
Don't fail on Java 17 (and higher) 2021-03-23 10:39:17 +01:00
NotMyFault
0cdda8b0ae
Fix a few issues with debugexec 2021-03-12 15:05:25 +01:00
NotMyFault
295a63087f
Strip lesser used debug commands 2021-03-12 14:45:43 +01:00
NotMyFault
797d3ed362
Don't invert the debug status message 2021-03-04 21:43:16 +01:00
NotMyFault
31de7de385
Cover a couple of NPEs 2021-03-01 16:21:12 +01:00
NotMyFault
5780ad370a
Strip Java 15 note 2021-03-01 10:58:27 +01:00
NotMyFault
3833d2cd83
Restrict a few more commands from plot world plots
And add missing tab completion for debug commands
2021-02-24 23:21:54 +01:00
Hannes Greule
38b60205e8 Use javax for Nullable + guice, hope I didn't miss anything 2021-02-24 20:35:38 +01:00
NotMyFault
027456fd77
Add crop-grow flag 2021-02-24 18:41:36 +01:00
Hannes Greule
10e2d65221
Remove scripting-related stuff (#2947)
* Remove scripting-related stuff

* Cleanup

Co-authored-by: NotMyFault <mc.cache@web.de>
2021-02-24 09:53:55 +01:00
Hannes Greule
d9b5dc5dd7 Sort plots for /plot home the same as for /plot visit, fixes PS-188 2021-02-24 08:46:16 +01:00
NotMyFault
c7e6564667 Add new metrics pies 2021-02-22 15:22:38 +01:00
NotMyFault
da45813a06 Add new metrics pies 2021-02-22 15:18:20 +01:00
NotMyFault
6cc9b5c62b
Remove eol config entries 2021-02-22 13:24:46 +01:00
Hannes Greule
1172e02f1b Fix several issues with debug command 2021-02-21 12:34:14 +01:00
Hannes Greule
46fbc05040 Don't fail to load when moving components file 2021-02-20 19:41:58 +01:00
NotMyFault
fee1ffa2e9
Switch to vanity url 2021-02-17 00:50:50 +01:00
NotMyFault
22be81b5cb
Switch to vanity url 2021-02-16 23:50:53 +01:00
NotMyFault
12d260ca82
Fixes https://issues.intellectualsites.com/issue/PS-23 2021-02-09 18:20:50 +01:00
NotMyFault
82e90553bc Enhance continue message 2021-02-03 15:44:18 +01:00
NotMyFault
18c1a0e4f6
Remove duplicated translation strings 2021-02-02 16:48:01 +01:00
NotMyFault
c42102d1c4
Don't shade without relocation 2021-02-01 15:31:25 +01:00
NotMyFault
aca2d2e510
Fixes https://issues.intellectualsites.com/issue/PS-186 2021-01-31 11:44:22 +01:00
NotMyFault
666938b738
Update ServerLib 2021-01-30 13:17:36 +01:00
NotMyFault
a75db92007
Update ServerLib 2021-01-30 13:16:36 +01:00
NotMyFault
aaf2fa8807
Update bStats to 2.1.0 2021-01-24 10:39:03 +01:00
NotMyFault
e549235d83
Switch to ServerLib 2021-01-22 23:42:45 +01:00
NotMyFault
86e8457574
Move to ServerLib 2021-01-22 23:34:47 +01:00
Alexander Söderberg
8292ed9e31
More annotation work 2021-01-10 00:01:48 +01:00
Alexander Söderberg
57fc51d013 Initial annotation usage cleanup + EditorConfig 2021-01-09 22:28:41 +01:00
dordsor21
8b332adbe7 Address comments 2021-01-09 21:34:42 +01:00
dordsor21
ae0ee1ebdd fix teleport to "*" 2021-01-09 21:34:42 +01:00
dordsor21
3cea734b9b Fix singleworlds 2021-01-09 21:34:42 +01:00
dordsor21
7ac3f7ca03 Fix sync tasks not being sync 2021-01-09 20:39:25 +01:00
N0tMyFaultOG
0a5c73478d
Fix improper missing permission message on /plot list world 2021-01-08 17:16:38 +01:00
N0tMyFaultOG
495952acb0
Fixes https://github.com/IntellectualSites/PlotSquaredSuggestions/issues/129 2021-01-08 16:46:57 +01:00
N0tMyFaultOG
25a8f1522a
Move creation date up in plot header 2021-01-08 16:08:42 +01:00
N0tMyFaultOG
f13f7ce129
Disable destructive operations for plot world plots 2021-01-08 16:06:15 +01:00
dordsor21
cc90127af9
fix two <> errors in lang 2021-01-07 13:45:01 +00:00
dordsor21
98e8476a88
Bring v5 entity spawn changes to v6 2021-01-06 21:56:26 +00:00
dordsor21
ec8bdc9af6
Actually place the debugroadregen blocks 2021-01-04 19:23:31 +00:00
dordsor21
9598416932
handle cancellation properly in DefaultProgressSubscriber 2021-01-04 18:23:45 +00:00
dordsor21
4c0bc79e49
Allow over/undersizes schematics to be saved and pasted (#2944)
Co-authored-by: NotMyFault <mc.cache@web.de>
2021-01-03 23:46:53 +01:00
Hannes Greule
01dd2d8097 Should be code, not link
Co-authored-by: Alexander Söderberg <4096670+Citymonstret@users.noreply.github.com>
2021-01-03 23:42:32 +01:00
Hannes Greule
e09444d94f code style 2021-01-03 23:42:32 +01:00
Hannes Greule
0c76833997 Implement CaptionLoader API to be used by third party plugins/addons
This allows to load resources from other classloaders than the P2 one. Therefore, we can use this in addons too to manage messages the same way.
2021-01-03 23:42:32 +01:00
Hannes Greule
ad99ca1723
Use WE Expressions instead of js evaluation (#2941)
* Implement thread-safe expression evaluation

* Update `{args}` to `plot` automatically

* Stringify more money/balance/price occurrences with EconHandler#format
2021-01-02 16:32:07 +00:00
N0tMyFaultOG
f47561b580
Invert leaf-decay message 2021-01-01 21:51:28 +01:00
N0tMyFaultOG
4f60da292a
Add leaf-decay flag
Stop leaves from decaying.
2021-01-01 21:47:09 +01:00
N0tMyFaultOG
70fb86a1c3
Remove redundant legacy version check
"api-version" backs us up here.
2021-01-01 14:09:59 +01:00
N0tMyFaultOG
bf79639d07
Update license to 2021
Happy new year 🎆
2021-01-01 00:46:30 +01:00
N0tMyFaultOG
e8642df674
Update licenses to 2021
Happy new year 🎆
2021-01-01 00:19:45 +01:00
N0tMyFaultOG
b648717079
5.13.11 2020-12-29 15:14:00 +01:00
N0tMyFaultOG
3702caa25f
Replace toggle permission with plots.toggle 2020-12-28 16:06:24 +01:00
N0tMyFaultOG
4200bbfd0a
Update permission range declaration 2020-12-28 15:38:42 +01:00
N0tMyFaultOG
0fcca4c141
Use hasPermissionRange to check for trust and add limits 2020-12-28 15:36:00 +01:00
Hannes Greule
fafdae9ba9
Only check ice-form for ice (#2940)
Co-authored-by: NotMyFault <mc.cache@web.de>
2020-12-28 14:11:30 +00:00
dordsor21
ef215b1b0c
fix debugpaste with multiverse 2020-12-28 12:31:51 +00:00
dordsor21
1d0721034d
fix debugpaste with multiverse 2020-12-28 12:30:53 +00:00
dordsor21
3cfbe9585a
Merge branch 'v6' of github.com:IntellectualSites/PlotSquared into v6 2020-12-28 12:27:12 +00:00
dordsor21
71305e636c
cache bukkitworld 2020-12-28 12:10:27 +00:00
Hannes Greule
ce23c153ee Fix added_list and denied_list placeholders 2020-12-28 12:15:34 +01:00
Hannes Greule
019da4d2f4 Expose legacy serializer for placeholders 2020-12-28 11:21:35 +01:00
Hannes Greule
ffc31f565b Use builder for flags component 2020-12-28 00:05:33 +01:00
N0tMyFaultOG
7f01f2d716
Rename placeholders matching more appropriately 2020-12-27 19:37:09 +01:00
N0tMyFaultOG
bf20b0dd79
Beautify placeholder output for '*' permission 2020-12-27 19:16:26 +01:00
N0tMyFaultOG
867826759b
Make placeholders translatable 2020-12-26 13:50:00 +01:00
dordsor21
3be370071c
fix purge <owner> 2020-12-23 14:13:50 +00:00
dordsor21
2b9a194244
5.13.10 2020-12-23 14:07:42 +00:00
dordsor21
67a928b1ae
Merge branch 'v5' of github.com:IntellectualSites/PlotSquared into v5 2020-12-23 13:54:35 +00:00
dordsor21
67a7211b77
use correct UUID pipeline methods in purge command 2020-12-23 13:52:47 +00:00
N0tMyFaultOG
1d4fe01db0
Rename database chart id 2020-12-22 20:54:22 +01:00
N0tMyFaultOG
07491d8028
Rename database chart id 2020-12-22 20:53:13 +01:00
N0tMyFaultOG
7f1baca872
Add database type to debugpaste 2020-12-22 17:55:37 +01:00
N0tMyFaultOG
8c3a0a8275
Fix compiling 2020-12-21 20:33:49 +01:00
N0tMyFaultOG
eba6043d26
Update paster 2020-12-21 15:59:12 +01:00
N0tMyFaultOG
397692d113
Update Paster 2020-12-21 15:58:34 +01:00
NotMyFault
035ecc1517
Delete dependabot.yml 2020-12-21 10:58:30 +01:00
N0tMyFaultOG
bb52301200
Merge remote-tracking branch 'origin/renovate/configure' into v6 2020-12-20 22:38:35 +01:00
Renovate Bot
f4adf5d7e7
Add renovate.json 2020-12-20 21:24:38 +00:00
dordsor21
e4a8459798
Switch to IncendoPaster "library" 2020-12-19 16:20:44 +00:00
dordsor21
14fa738fbe
switch to InvendoPaster "library" 2020-12-19 16:00:13 +00:00
N0tMyFaultOG
4da7aa38ea
@Sauilitired can't spell properly 2020-12-16 13:23:14 +01:00
N0tMyFaultOG
5147d67318
Add charts for complex plot components 2020-12-16 13:20:23 +01:00
dordsor21
cbc599cb20
don't double-up schematic x/z offsets 2020-12-16 12:13:39 +00:00
dordsor21
09c84e25bf
don't double-up schematic x/z offsets 2020-12-16 12:07:36 +00:00
dordsor21
224e3b6ad4
Fix publishing. I am an author. 2020-12-14 18:09:09 +00:00
dordsor21
992a683ba2
another annoying cache thing 2020-12-14 15:22:10 +00:00
dordsor21
e8e116312a
Merge branch 'v5' into v6
# Conflicts:
#	Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java
#	Core/src/main/java/com/plotsquared/core/command/Deny.java
#	Core/src/main/java/com/plotsquared/core/util/SchematicHandler.java
2020-12-14 15:15:27 +00:00
dordsor21
de3ba9a25c
re-send block change for blocks with gravity if they're physicsed
fixes PS-159
2020-12-14 14:53:53 +00:00
dordsor21
5e88cabb4b
compare UUID to UUID, not UUIDMapping
fix PS-182
2020-12-14 14:32:34 +00:00
dordsor21
6d71177394
Don't save corrupt schematics so that when they load, they work. 2020-12-13 21:09:05 +00:00
N0tMyFaultOG
edd9ae5118
Fix more flag message issues. 2020-12-12 22:46:37 +01:00
Hannes Greule
23ae3b5830 Use builder for flag list message 2020-12-12 21:19:28 +01:00
Hannes Greule
6746aab7ef Improve /plot info formatting 2020-12-12 18:56:19 +01:00
NotMyFault
c85ff7ddda
Update README.md 2020-12-12 17:52:24 +01:00
dordsor21
cf70efabb0
we want throwable to be null 2020-12-11 16:51:13 +00:00
dordsor21
6eb2958afc
Fix merge issue 2020-12-11 11:42:19 +00:00
dordsor21
18f13b7d15
Merge branch 'v5' into v6 2020-12-10 21:28:28 +00:00
dordsor21
0bb959d26a
Merge branch 'v6' of github.com:IntellectualSites/PlotSquared into v6 2020-12-10 21:15:51 +00:00
dordsor21
b4f3e85001
allow "owned" road mobs to be killed as well
(those that are leashed, being ridden, etc)
2020-12-10 21:14:32 +00:00
Hannes Greule
25100c46f7 Don't unclaim claimed plots with /p claim 2020-12-10 22:13:13 +01:00
dordsor21
540f4c0958
fix info for server-plots 2020-12-10 21:05:50 +00:00
dordsor21
8930ebe572
Relight command is pointless as we'd just use FAWE for it anyway. 2020-12-10 18:06:32 +00:00
dordsor21
8f93f2b6d2
Revert "Allow "Server" owner" as that has its own UUID
This reverts commit 9ba91889e0e1662164911cc9b89196a3cd244590.
2020-12-10 18:02:38 +00:00
dordsor21
9ba91889e0
Allow "Server" owner 2020-12-10 17:58:00 +00:00
dordsor21
67683fbddb
Ensure not to parse null parameters into templates for titles 2020-12-10 17:56:22 +00:00
Hannes Greule
824f9d7ad0 Add missing returns to /plot cluster 2020-12-09 23:14:52 +01:00
Hannes Greule
3e99f90eb1 Don't spit NPEs on NonNull values 2020-12-09 22:45:47 +01:00
N0tMyFaultOG
3ca8a94419
Update java 8 notice 2020-12-08 00:18:40 +01:00
N0tMyFaultOG
714837dd00
Add charts for complex components 2020-12-07 23:05:25 +01:00
N0tMyFaultOG
bc1d3ddd5d
Fix spelling 2020-12-07 21:25:32 +01:00
N0tMyFaultOG
bf7b75b619
Make titles duration configurable 2020-12-07 21:23:38 +01:00
N0tMyFaultOG
469d6ab907
Fixes https://github.com/IntellectualSites/PlotSquaredSuggestions/issues/77 2020-12-07 14:46:16 +01:00
N0tMyFaultOG
a4dd5bb62f
Add tab completion to like/dislike and fix more messages 2020-12-07 12:51:14 +01:00
N0tMyFaultOG
60859de0bd
Add an option to teleport the player on plot clearing or deletion 2020-12-07 10:55:34 +01:00
Hannes Greule
ff70d5db14
Feature/v6/arkitektonika (#2916)
* Start working on Arkitektonika support

* Progress on Arkitektonika

* Add license headers

* Some QoL and javadocs

* Fix maximum calculation

* Fix minor formatting

* Reimplement legacy webinterface support

* Add documentation and fix deletion link

* Resolve conflicts/gradle stuff

* Fix links

* Make message readable

* Do not allow download of merged plots
2020-12-05 19:50:41 +01:00
Alexander Söderberg
c8ad936d26
Clean up PlotPlatform a bit and make the placeholder registry injectible 2020-12-05 18:41:41 +01:00
N0tMyFaultOG
60b5f5fe48
Add note about Nashorn 2020-12-05 18:38:10 +01:00
Hannes Greule
14ec7fb816 Fix PlotRangeIterator 2020-12-05 18:03:24 +01:00
N0tMyFaultOG
b4ea230ff1
Minor translation changes 2020-12-05 15:35:33 +01:00
N0tMyFaultOG
410879d154
Fixes https://github.com/IntellectualSites/PlotSquaredSuggestions/issues/141 2020-12-05 15:20:19 +01:00
N0tMyFaultOG
f14121e99c
Initiate placeholder registry 2020-12-05 15:08:27 +01:00
N0tMyFaultOG
19d7444946
Fix flag description 2020-12-04 19:27:34 +01:00
N0tMyFaultOG
d9aaed0035
Update dependencies 2020-12-04 18:07:59 +01:00
N0tMyFaultOG
cfd3c159f9
Follow up to 4ff50525ed83c1d6103ee9a60b715968719bb77f
Skipping deprecation here, this exists for so long and and has been superseded by permissions now.
2020-12-04 17:33:41 +01:00
N0tMyFaultOG
4ff50525ed
Fixes https://github.com/IntellectualSites/PlotSquaredSuggestions/issues/110 2020-12-04 17:30:11 +01:00
N0tMyFaultOG
34e02e9f3a
Make JavaVersionCheck private 2020-12-04 16:00:18 +01:00
N0tMyFaultOG
62690c2a53
Postpone java version during startup 2020-12-04 12:25:53 +01:00
N0tMyFaultOG
5d30e0854f
Add java version checker 2020-12-04 12:15:56 +01:00
NotMyFault
ec683cdf88
Update ClassicPlotWorld.java 2020-11-29 17:48:59 +01:00
N0tMyFaultOG
39feed6fac
Improve wording of generation steps 2020-11-29 17:35:41 +01:00
dordsor21
ee7f683b76
Bump paperlib, fix single worlds. 2020-11-26 16:54:38 +00:00
N0tMyFaultOG
209d52e920
Update adventure 2020-11-26 11:35:46 +01:00
Traks
585111ca38
Cancel boat placement on interactable blocks, fixes PS-175 (#2934)
* Cancel boat placement on interactable blocks, fixes PS-175

* Keep boat protection for old game versions

Co-authored-by: NotMyFault <mc.cache@web.de>
2020-11-24 16:32:35 +01:00
N0tMyFaultOG
ef95334fe6
Update actions worflow 2020-11-23 18:35:44 +01:00
N0tMyFaultOG
4595534a6f
Update actions workflow 2020-11-23 18:32:28 +01:00
N0tMyFaultOG
be9d9264ae Make use of Permission class in tab completion
Plus document a few more permission nodes
2020-11-19 22:29:44 +01:00
N0tMyFaultOG
a8495c67d4 Update gradle to 6.7.1 2020-11-19 22:05:45 +01:00
N0tMyFaultOG
eec369ea4f Improve tab completion, adjust permissions and more v6 changes 2020-11-19 21:53:27 +01:00
N0tMyFaultOG
abed07b613 Add tab completion for /plot area 2020-11-19 21:24:23 +01:00
N0tMyFaultOG
6cfdedb823 Don't collapse imports 2020-11-19 21:13:35 +01:00
N0tMyFaultOG
db903ebb0a Revert "Update gradle.yml"
This reverts commit e12c83fd830491569e7ad4a2b97daac7ab69543b.
2020-11-19 21:05:48 +01:00
N0tMyFaultOG
e12c83fd83 Update gradle.yml 2020-11-19 17:44:57 +01:00
N0tMyFaultOG
12861f6c07 Add tab completion for /plot setowner 2020-11-19 17:39:58 +01:00
N0tMyFaultOG
52065b8313 Add tab completion for /plot schematic 2020-11-19 17:36:14 +01:00
N0tMyFaultOG
f6ff843cfb Send message when attempting to leave an own plot
This is a temporary workaround for the todo addressed below.
2020-11-19 17:30:26 +01:00
N0tMyFaultOG
aedf402c17 Fix /plot leave requiring an arg when none is needed 2020-11-19 17:10:01 +01:00
N0tMyFaultOG
0745b03271 Add tab completion for /plot cluster 2020-11-19 17:00:21 +01:00
N0tMyFaultOG
bb5c0de367 Fix /plot download world not being clickable 2020-11-19 16:39:44 +01:00
N0tMyFaultOG
9478251d44 Fix /plot buy message and enhance it with player balance 2020-11-19 16:32:30 +01:00
NotMyFault
47cb85d3db
Merge pull request #2932 from IntellectualSites/feature/v6/generify-perms
Generify permissions thru Permission class
2020-11-16 10:34:29 +01:00
N0tMyFaultOG
ce7ceccc1c Merge branch 'v6' into feature/v6/generify-perms 2020-11-16 10:25:48 +01:00
dordsor21
5d4cf3b705
setowner should allow null UUIDs 2020-11-10 17:24:37 +00:00
NotMyFault
f33fc092e3
Add java 11 to actions test 2020-11-08 21:48:23 +01:00
N0tMyFaultOG
0ff8abcd6f Update town template for schem 2 v2 2020-11-08 15:22:31 +01:00
NotMyFault
b0d55d434d
5.13.9 2020-11-03 21:14:07 +01:00
N0tMyFaultOG
092690e9f0 Update permission in regards of https://github.com/IntellectualSites/PlotSquared/pull/2932 2020-11-03 15:44:07 +00:00
N0tMyFaultOG
5b11175cf3 Add plots.visit.denied permission 2020-11-03 15:44:07 +00:00
N0tMyFaultOG
7a203a12a3 Merge branch 'v6' of https://github.com/IntellectualSites/PlotSquared into v6 2020-11-03 16:43:48 +01:00
N0tMyFaultOG
f7dd8af35e Enhance plot claim message 2020-11-03 15:43:28 +00:00
N0tMyFaultOG
7a9b3442d2 1.16.4 2020-11-03 16:43:18 +01:00
N0tMyFaultOG
b66e2359d1 Update to 1.16.4
- Bump WorldEdit to 7.2.0 release
2020-11-03 15:58:17 +01:00
N0tMyFaultOG
81c72ee5d9 Finish up permissions 2020-11-02 21:03:46 +01:00
N0tMyFaultOG
fed7f89f96 Fix compiling 2020-11-02 11:58:07 +01:00
N0tMyFaultOG
aefa629509 Generify permissions thru Permission class
- Fixed a few improper permissions
- Fixed a couple of typos
2020-11-02 00:55:58 +01:00
N0tMyFaultOG
bc32581cbd Improve empty global flag list message 2020-11-02 00:00:38 +01:00
NotMyFault
3f7f6af051
Merge pull request #2913 from IntellectualSites/features/v6/queue-features
Features/v6/queue features
2020-11-01 21:16:32 +01:00
dordsor21
ee9b2e8bf8
Just merge the whole thing. Merge branch 'v6' into features/v6/queue-features
# Conflicts:
#	Core/src/main/resources/lang/messages_en.json
2020-11-01 18:58:24 +00:00
dordsor21
0b968abfe4
fix merging conflicts 2020-11-01 17:45:38 +00:00
N0tMyFaultOG
7e7ecd6a0f Update paperlib 2020-11-01 17:17:12 +01:00
dordsor21
7e9a9e14c7 Fix various instances where Adventure is being used incorrectly 2020-10-25 22:38:00 +00:00
Mariell Hoversholm
333493f351 adventure v4.1.0; project now compiles 2020-10-17 21:10:02 +01:00
Mariell Hoversholm
38333a6d11 Update to Gradle 6.7 2020-10-17 21:10:02 +01:00
NotMyFault
4213957d76
Delete dependabot.yml 2020-10-12 12:21:32 +02:00
dordsor21
565f9e3e29
5.13.8 2020-10-11 19:27:01 +01:00
dordsor21
a1bfc1cb26
correctly handle road flags 2020-10-11 19:24:50 +01:00
dordsor21
cfd432886d
Correctly handle road flags 2020-10-11 19:19:17 +01:00
N0tMyFaultOG
191666a2f2 Fix logo 2020-10-11 13:03:22 +02:00
N0tMyFaultOG
aeeae7c167 Fix links not being clickable 2020-10-11 12:47:49 +02:00
N0tMyFaultOG
08c7d4d15e Remove dead imports 2020-10-09 21:03:23 +02:00
N0tMyFaultOG
29b92659c7 Fix typos 2020-10-09 20:50:12 +02:00
N0tMyFaultOG
209f25a5cf Update default branch 2020-10-09 20:21:57 +02:00
N0tMyFaultOG
4622f4b51d Fix plot leave 2020-10-09 20:21:02 +02:00
dordsor21
4d51dc9b6c
Switch to translateable captions 2020-10-09 17:47:51 +01:00
dordsor21
76b992509b
use format not silly round stuff 2020-10-09 17:29:05 +01:00
dordsor21
925978db8f
change default lighting to 1 2020-10-09 17:26:52 +01:00
dordsor21
c0e90ddb33
increase interval of progress notify 2020-10-09 17:25:48 +01:00
dordsor21
a7a29eaf97
Correctly cancel notify tasks and add notifications to commands 2020-10-09 17:24:59 +01:00
dordsor21
a451d2d6f2
Fix the injection 2020-10-09 16:34:59 +01:00
dordsor21
914429ab4f
Merge branch 'v6' into features/v6/queue-features
# Conflicts:
#	Core/src/main/java/com/plotsquared/core/generator/SquarePlotManager.java
#	Core/src/main/java/com/plotsquared/core/plot/world/SinglePlotManager.java
#	Core/src/main/java/com/plotsquared/core/util/SchematicHandler.java
2020-10-09 15:23:09 +01:00
N0tMyFaultOG
f721a7c66c Update build.gradle.kts 2020-10-08 21:25:09 +02:00
N0tMyFaultOG
bba499649b No need to point if PAPI is not in use 2020-10-08 20:56:33 +02:00
N0tMyFaultOG
f9cd54c445 Shift logger.info -> error when running in an outdated environment 2020-10-08 20:54:06 +02:00
N0tMyFaultOG
0d89125a8e Replace sys out with logger factory 2020-10-08 20:52:02 +02:00
N0tMyFaultOG
6b37d678df Fix plot template tab completion 2020-10-08 20:47:43 +02:00
N0tMyFaultOG
02698b3a0e Fix plot grant tab completion 2020-10-08 20:42:17 +02:00
N0tMyFaultOG
6f0512c18c Fix plot set tab completions 2020-10-08 20:16:29 +02:00
N0tMyFaultOG
e46b38b301 Fix plot set values 2020-10-08 19:51:42 +02:00
N0tMyFaultOG
5841817fb5 Missing space 2020-10-08 19:29:09 +02:00
N0tMyFaultOG
e28fb49015 Add override permission for /plot music 2020-10-08 19:27:05 +02:00
N0tMyFaultOG
841eef6a52 Fix done message on backup and add done message to grant 2020-10-08 18:57:11 +02:00
Mariell Hoversholm
2eee1ef203 Fix log4j 2020-10-08 14:33:48 +02:00
Mariell Hoversholm
cd605f4996 Relocate log4j, move slf4j declaration 2020-10-08 14:02:08 +02:00
Mariell Hoversholm
54a8482a88 Minecraft does not always provide slf4j 2020-10-08 14:02:08 +02:00
Mariell Hoversholm
e15b5a07fb It runs! And it's small! 2020-10-08 14:02:08 +02:00
Mariell Hoversholm
c198305b5e Add missing relocations 2020-10-08 14:02:08 +02:00
Mariell Hoversholm
a637a8970b Add maven publishing 2020-10-08 14:02:08 +02:00
Mariell Hoversholm
d97f68eec0 Address review issues 2020-10-08 14:02:08 +02:00
Mariell Hoversholm
c3069a425d Format licence headers 2020-10-08 14:02:08 +02:00
Mariell Hoversholm
9b1dc7d42e She compiles! 2020-10-08 14:02:08 +02:00
N0tMyFaultOG
ec23fcdd75 Rewrite build scripts
Co-Authored By: Mariell Hoversholm <proximyst@proximyst.com>
2020-10-08 14:02:08 +02:00
dordsor21
544d57c720
Merge branch 'v5' into v6
# Conflicts:
#	Bukkit/build.gradle
#	Bukkit/pom.xml
#	Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEventListener.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/uuid/BungeePermsUUIDService.java
#	Core/src/main/java/com/plotsquared/core/PlotPlatform.java
#	Core/src/main/java/com/plotsquared/core/command/DebugPaste.java
#	Core/src/main/java/com/plotsquared/core/command/Grant.java
#	build.gradle
2020-10-07 12:20:32 +01:00
dordsor21
b55d836871
5.13.7 2020-10-07 11:59:44 +01:00
N0tMyFaultOG
a210f523a5 Add more information to debugpaste 2020-10-04 18:19:29 +02:00
Aurora
e6237d68d0 Also remove BungeePerms from the config 2020-10-04 13:26:56 +02:00
Aurora
56e6922279 Remove BungeePerms UUID fetcher 2020-10-04 13:26:56 +02:00
Alexander Söderberg
6e2f738d86 Stop relying on maxim's repo as it's very unreliable. 2020-10-04 12:24:37 +01:00
Hannes Greule
81d0bf6f04 Prevent blocks from getting waterlogged
In some cases, the PlayerInteractEvent doesn't cancel right clicks on blocks that can be waterlogged
2020-10-03 21:54:14 +02:00
dordsor21
95f509d337
Stop forcing loiwercase world names 2020-10-02 15:08:14 +01:00
dordsor21
2f5ce67154
add back setShouldAbortSpawn 2020-09-29 15:55:08 +01:00
dordsor21
89318be5f4
Apply e2f9b4245b9f7168fc38d9cb10cd05efcb42fe05 to paper listener too 2020-09-29 15:53:23 +01:00
dordsor21
f80e8c8d11
For sake of allowing v5 -> v6 2020-09-25 20:08:28 +01:00
dordsor21
8c4bb4140a
5.13.6 2020-09-20 19:51:54 +01:00
dordsor21
ff83931a3f
Fix plot grant 2020-09-20 19:42:13 +01:00
N0tMyFaultOG
2468be4736 Merge branch 'v6' of https://github.com/IntellectualSites/PlotSquared into v6 2020-09-20 17:36:35 +02:00
Hannes Greule
4e835ed3ff Add missing command description 2020-09-20 00:51:54 +02:00
dordsor21
41f494fbff
Remove jetbrains annotations 2020-09-18 12:45:26 +01:00
dordsor21
e974fe5dc7
Merge branch 'v6' into features/v6/queue-features 2020-09-18 12:22:32 +01:00
dordsor21
85a23442cc
bump minimessage version to fix build 2020-09-18 12:22:01 +01:00
dordsor21
a822a70f00
bump minimessage so it compiles 2020-09-18 12:11:34 +01:00
dordsor21
819902c24e
Fix licenses 2020-09-14 22:00:09 +01:00
dordsor21
554efbb057
Merge branch 'v5' into v6
# Conflicts:
#	.github/CODEOWNERS
#	Bukkit/pom.xml
#	Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayer.java
#	Core/src/main/java/com/plotsquared/core/command/Alias.java
#	Core/src/main/java/com/plotsquared/core/command/HomeCommand.java
#	Core/src/main/java/com/plotsquared/core/command/Music.java
#	Core/src/main/java/com/plotsquared/core/listener/PlotListener.java
#	Core/src/main/java/com/plotsquared/core/player/ConsolePlayer.java
#	Core/src/main/java/com/plotsquared/core/player/PlotPlayer.java
#	Core/src/main/java/com/plotsquared/core/plot/flag/types/BlockTypeWrapper.java
#	build.gradle
2020-09-11 15:44:04 +01:00
dordsor21
8547533210
update pom 2020-09-11 15:04:09 +01:00
dordsor21
d843d1715d
Allow /plot home [area|world] 2020-09-11 15:03:48 +01:00
dordsor21
1552a8e74b
Add option to change lighting behaviour in queues 2020-09-11 14:18:50 +01:00
dordsor21
f0e9a8c5fe
Implement progress subscribers 2020-09-11 12:59:40 +01:00
NotMyFault
648953ec1f
5.13.5 2020-09-11 12:27:23 +02:00
dordsor21
9e85748b2e
Merge branch 'features/v6/queue-features' of github.com:IntellectualSites/PlotSquared into features/v6/queue-features 2020-09-11 11:21:23 +01:00
dordsor21
a98b23af02
progress subscriber 2020-09-11 11:20:38 +01:00
NotMyFault
5463f15633
Add pigstep music disc 2020-09-11 01:16:57 +02:00
NotMyFault
0c6113b0d1
5.13.4 2020-09-09 23:31:30 +02:00
Hannes Greule
c5906e780a
Merge pull request #2912 from IntellectualSites/fix/v5/blocktypewrapper
Add default namespace when wrapping block categories by their ids
2020-09-08 18:50:08 +02:00
Hannes Greule
f2355a76d6 Add default namespace when wrapping block categories by their ids 2020-09-06 23:36:36 +02:00
Alexander Söderberg
0aeca40137
Take player visibility into account when sending notify-enter and notify-leave messages. Fixes PS-103. 2020-09-05 18:48:58 +02:00
Hannes Greule
5c48e4ad19 Add missing license header 2020-09-05 18:39:56 +02:00
Hannes Greule
f6d1e2b3b8 Check TileState manually on 1.13.2, fixes PS-122 2020-09-05 18:39:56 +02:00
NotMyFault
37010d92ee
Create CODEOWNERS 2020-09-05 13:42:11 +02:00
Hannes Greule
babad3ab6d Don't validate plot aliases with offline players (Fixes PS-126) 2020-09-04 14:49:02 +02:00
N0tMyFaultOG
b12e9832c9 Update pom.xml 2020-09-02 17:20:54 +02:00
N0tMyFaultOG
0f9554c717 Merge branch 'v5' into v6 2020-09-02 17:19:12 +02:00
N0tMyFaultOG
d19dde2f85 Add more debugs 2020-09-02 17:18:41 +02:00
N0tMyFaultOG
7a529e156d Add deb for onBlockIgnite event 2020-09-02 17:03:56 +02:00
N0tMyFaultOG
cba2474df7 Merge v5/v6 2020-09-02 16:44:18 +02:00
NotMyFault
03c889383b
Merge pull request #2908 from IntellectualSites/dependabot/gradle/v5/org.yaml-snakeyaml-1.26
Bump snakeyaml from 1.25 to 1.26
2020-09-02 16:15:26 +02:00
NotMyFault
da54478767
Merge pull request #2907 from IntellectualSites/dependabot/gradle/v5/org.jetbrains-annotations-20.1.0
Bump annotations from 20.0.0 to 20.1.0
2020-09-02 16:14:26 +02:00
NotMyFault
acf9c2554f
Merge pull request #2904 from IntellectualSites/dependabot/gradle/v5/org.ajoberstar.grgit-4.0.2
Bump org.ajoberstar.grgit from 4.0.1 to 4.0.2
2020-09-02 16:12:56 +02:00
dependabot[bot]
7c53bfc870
Bump snakeyaml from 1.25 to 1.26
Bumps [snakeyaml](https://bitbucket.org/asomov/snakeyaml) from 1.25 to 1.26.
- [Commits](https://bitbucket.org/asomov/snakeyaml/branches/compare/snakeyaml-1.26..snakeyaml-1.25)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-02 14:10:44 +00:00
dependabot[bot]
32a8dcd411
Bump annotations from 20.0.0 to 20.1.0
Bumps [annotations](https://github.com/JetBrains/java-annotations) from 20.0.0 to 20.1.0.
- [Release notes](https://github.com/JetBrains/java-annotations/releases)
- [Changelog](https://github.com/JetBrains/java-annotations/blob/master/CHANGELOG.md)
- [Commits](https://github.com/JetBrains/java-annotations/compare/20.0.0...20.1.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-02 14:10:44 +00:00
dependabot[bot]
20b4cec0ca
Bump org.ajoberstar.grgit from 4.0.1 to 4.0.2
Bumps org.ajoberstar.grgit from 4.0.1 to 4.0.2.

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-02 14:10:39 +00:00
NotMyFault
c51c938e8d
Merge pull request #2903 from IntellectualSites/dependabot/add-v2-config-file
Create Dependabot config file
2020-09-02 16:10:14 +02:00
dependabot-preview[bot]
49984f2560
Create Dependabot config file 2020-09-02 13:55:15 +00:00
N0tMyFaultOG
b3c77ef099 Merge branch 'dependabot/gradle/v5/org.jetbrains.kotlin-kotlin-stdlib-1.4.0' into v5 2020-09-02 12:57:05 +02:00
N0tMyFaultOG
97e34844b4 Add option to opt-out MvDW Placeholder API 2020-09-02 12:13:23 +02:00
N0tMyFaultOG
e924a1920e Add message to rgar 2020-09-01 00:02:56 +02:00
NotMyFault
1441cc293c
5.13.3 2020-08-26 13:57:20 +02:00
Hannes Greule
311a2ddc75 Replace null checks with NullEconHandler 2020-08-25 12:41:03 +02:00
Hannes Greule
551d1d9f1a Add NullEconHandler to avoid verbose null checks 2020-08-25 12:41:03 +02:00
N0tMyFaultOG
a5dea9e7f6 Permission cleanup 2020-08-24 20:51:23 +02:00
N0tMyFaultOG
02bd83bd90 Merge v5 into v6 2020-08-24 14:33:53 +02:00
Hannes Greule
c42d5390a4 Allow teleporting to merged plots with multiple owners using /p home 2020-08-24 13:37:12 +02:00
Hannes Greule
31ea7297c2 Generate signs by default 2020-08-24 13:30:50 +02:00
Hannes Greule
c53cffb745 Generate signs by default 2020-08-24 13:17:15 +02:00
N0tMyFaultOG
26a99a122a Minor permission fix 2020-08-23 19:34:22 +02:00
dependabot-preview[bot]
acb0bd95f2
Bump kotlin-stdlib from 1.3.72 to 1.4.0
Bumps [kotlin-stdlib](https://github.com/JetBrains/kotlin) from 1.3.72 to 1.4.0.
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v1.4.0/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v1.3.72...v1.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-22 23:05:56 +00:00
NotMyFault
5d73b17415
Merge pull request #2899 from IntellectualSites/dependabot/gradle/v5/org.jetbrains-annotations-20.0.0
Bump annotations from 19.0.0 to 20.0.0
2020-08-23 01:04:40 +02:00
N0tMyFaultOG
3a8fa9f5b6 Update WorldEdit version
That doesn't appear to break stuff 👀
2020-08-22 13:18:00 +02:00
N0tMyFaultOG
e93d7feb2c Fixes PS-114 2020-08-22 11:48:03 +02:00
N0tMyFaultOG
116b870152 Apply missing license header 2020-08-22 11:44:34 +02:00
Alexander Söderberg
667c7b07b6
Merge pull request #2897 from IntellectualSites/features/v6/services 2020-08-21 23:03:29 +02:00
Alexander Söderberg
45e75cc06e
Merge branch 'v6' into features/v6/services 2020-08-21 23:02:52 +02:00
N0tMyFaultOG
5c08db2f44 Merge branch 'feature/v5/1.16.2-support' into v5 2020-08-21 19:02:23 +02:00
NotMyFault
28fc29c3ab
Merge pull request #2890 from MeFisto94/fix-1-16-worldserver-regression
Fixes an OfflinePlayerUtil breakaged caused by NMS Changes
2020-08-21 18:29:03 +02:00
NotMyFault
b2ac67692e
Merge pull request #2892 from TimonMi/v5
[Bugfix] No chat message confirmation on /p add /p trust, etc.
2020-08-21 18:28:05 +02:00
Hannes Greule
1064d777c2 Clean up unused code 2020-08-21 00:02:07 +02:00
Hannes Greule
62f675adbe Allow visiting all owners of merged plots 2020-08-21 00:01:53 +02:00
Hannes Greule
cee0bbb805 Revert target usage 2020-08-20 23:29:51 +02:00
Hannes Greule
77eb75fcc6 Adapt adventure changes 2020-08-20 23:28:42 +02:00
Hannes Greule
55211907f2 Use command descriptions from translations 2020-08-20 23:16:15 +02:00
Alexander Söderberg
e1e7cd1479
Add missing license headers 2020-08-20 17:11:12 +02:00
Alexander Söderberg
2d3c729215
Extract plot modifications to external class 2020-08-20 17:10:50 +02:00
Alexander Söderberg
f391cfd432
Extract comment logic from the plot class 2020-08-20 16:03:06 +02:00
N0tMyFaultOG
352136f0c6 Cleanup logging system 2020-08-18 15:50:28 +02:00
N0tMyFaultOG
b6e7f90f6a Fix logger.info format 2020-08-18 15:34:43 +02:00
N0tMyFaultOG
86cfeb76b6 More json stuff 2020-08-18 12:22:26 +02:00
NotMyFault
d91357a807
Update messages_en.json 2020-08-18 10:59:44 +02:00
N0tMyFaultOG
3c8d7a808b Prefix changes and others 2020-08-17 23:21:18 +02:00
N0tMyFaultOG
d6a80c7ea5 More json stuff, fixes and enhancements 2020-08-17 22:26:01 +02:00
N0tMyFaultOG
05a15ac689 Fix a few typos and spaces 2020-08-17 19:39:43 +02:00
N0tMyFaultOG
580cc359e5 fabb9b6fd7 (r41530745) 2020-08-17 18:56:27 +02:00
N0tMyFaultOG
630284e7ae More json fixes 2020-08-17 18:42:42 +02:00
N0tMyFaultOG
cc562033e7 Fix console requirement 2020-08-17 18:29:51 +02:00
N0tMyFaultOG
fabb9b6fd7 More json stuff 2020-08-17 18:15:29 +02:00
dordsor21
e8ffcaae46
progress subscriber 2020-08-17 16:21:11 +01:00
Hannes Greule
47d9895077 Fix ms to ticks conversion on Paper 2020-08-17 16:37:27 +02:00
Hannes Greule
aacf15757f Use less confusing variable name 2020-08-17 15:32:17 +02:00
Hannes Greule
914b44069b Convert item display name 2020-08-17 15:22:41 +02:00
Hannes Greule
4789327378 Encapsulate fields 2020-08-17 15:17:40 +02:00
Hannes Greule
c55f2945ac Fix sign text 2020-08-17 15:08:21 +02:00
N0tMyFaultOG
c6a368d6f2 More json fixes 2020-08-17 13:24:15 +02:00
dependabot-preview[bot]
869a579655
Bump annotations from 19.0.0 to 20.0.0
Bumps [annotations](https://github.com/JetBrains/java-annotations) from 19.0.0 to 20.0.0.
- [Release notes](https://github.com/JetBrains/java-annotations/releases)
- [Changelog](https://github.com/JetBrains/java-annotations/blob/master/CHANGELOG.md)
- [Commits](https://github.com/JetBrains/java-annotations/compare/19.0.0...20.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-17 09:08:30 +00:00
Alexander Söderberg
7cd1e8ea76
Fix command registration 2020-08-17 04:39:59 +02:00
Alexander Söderberg
351ae1b2c7
Synchronize auto queries 2020-08-17 01:27:45 +02:00
Hannes Greule
457f3e25cc resolve rebase issue 2020-08-17 01:10:46 +02:00
Hannes Greule
41c670450b Remove PlotFilter 2020-08-17 01:10:46 +02:00
Hannes Greule
f636db49f7 Remove SetupObject 2020-08-17 01:10:46 +02:00
Hannes Greule
505bba7612 Fix recursive call 2020-08-17 00:53:39 +02:00
Hannes Greule
72507aba4b Change player locale on event 2020-08-17 00:29:53 +02:00
Hannes Greule
9b086b3f2a Insert missing keys into message files 2020-08-17 00:29:53 +02:00
N0tMyFaultOG
f9d7d2d1dd Fix clickable messages 2020-08-16 19:43:27 +02:00
N0tMyFaultOG
e9efa3f2d3 Fix some translation issues 2020-08-16 18:24:54 +02:00
dordsor21
665a72a08f
Fill out a lot more JavaDoc.
I've left DB stuff alone
2020-08-16 13:22:49 +01:00
MeFisto94
61d1dcc231 Ignore Events if they are not caused by real players (i.e. citizens) 2020-08-16 14:09:32 +02:00
MeFisto94
6c9b73b100 Apply patch by @SirYwell to construct the ResourceKey without consulting the DimensionManager 2020-08-16 14:02:03 +02:00
Alexander Söderberg
a4c9ed90b7
Fix startup issues and make messages send properly 2020-08-16 13:49:16 +02:00
Alexander Söderberg
28d6d4db92
Fix shading mess and make the plugin start 2020-08-16 12:44:10 +02:00
dordsor21
12def37194
clean up some javadoc stuff 2020-08-16 11:34:08 +01:00
Alexander Söderberg
ed2302e545
Remove illegal import 2020-08-16 12:10:19 +02:00
N0tMyFaultOG
618adb913d Update license and remove dead module entries 2020-08-15 19:17:29 +02:00
N0tMyFaultOG
4a220f9bfb Update license header 2020-08-15 14:59:29 +02:00
NotMyFault
300abd868a
Merge pull request #2888 from IntellectualSites/fix-conversion
Fix problem with config creation
2020-08-14 18:36:57 +02:00
Alexander Söderberg
87f0b1fc97
Add service system and rewrite Auto to use the service system 2020-08-14 17:24:34 +02:00
NotMyFault
78a6e72fe1
5.13.2 2020-08-14 15:26:32 +02:00
dordsor21
8f1b2a9d2a
fix pve against animals on other plots and roads 2020-08-14 14:21:45 +01:00
NotMyFault
5b27b652e7
Fix color tag 2020-08-14 12:52:00 +02:00
NotMyFault
556ff0baf4
Fix line break 2020-08-14 12:27:38 +02:00
NotMyFault
8cc536b20f
Fix spelling 2020-08-14 11:57:37 +02:00
N0tMyFaultOG
5e20c871a5 Fix metrics setting 2020-08-14 11:36:17 +02:00
NotMyFault
56fb892818
Fix brackets 2020-08-14 00:37:06 +02:00
N0tMyFaultOG
7f104c249a Permission cleanup
- Removed plotme perms
- Fixed incorrect permission for "/plot flag remove"
- Fixed incorrect administrative unlink node
- Removed compat alias from "/plot set alias" command

I've documented all removed permission packages and fixed permissions in detail on the v6 page. So it's easy to go-by when updating.
2020-08-13 23:32:13 +02:00
N0tMyFaultOG
0eeface374 Remove old translations 2020-08-13 21:37:28 +02:00
N0tMyFaultOG
ffe1e1e40d Core is Core 2020-08-13 21:25:17 +02:00
N0tMyFaultOG
5efdef19cf Remove dead asset setting 2020-08-13 21:16:30 +02:00
N0tMyFaultOG
c9fae6a070 Remove old translation setup and move commands to templates 2020-08-13 21:11:07 +02:00
N0tMyFaultOG
2b17f730d4 Merge v5 into v6 2020-08-12 18:20:37 +02:00
NotMyFault
808bddbfbb
Apply scaling to image 2020-08-12 10:30:05 +02:00
N0tMyFaultOG
d6dfa9a0b9 https 2020-08-11 20:12:31 +02:00
NotMyFault
924b73f070
Merge pull request #2896 from luca-gg/patch-1
Update de-DE.yml
2020-08-11 19:33:41 +02:00
Luca
64181c6ab8
Update de-DE.yml
adjusted grammar
2020-08-11 19:29:40 +02:00
N0tMyFaultOG
a1b10a2900 Remove dead files 2020-08-11 17:49:04 +02:00
N0tMyFaultOG
6315b9ea52 gradle 6.6 2020-08-11 17:43:24 +02:00
N0tMyFaultOG
7c756304b5 1.16.2 support
- Bump EssentialsX version to the latest release
2020-08-11 16:20:33 +02:00
NotMyFault
9fd11fbe13
Merge pull request #2893 from JunTVDE/de-translation-edit
added german translation for flag-descriptions to de-DE.yml
2020-08-09 13:21:31 +02:00
NotMyFault
7cd9a03b0f
Merge pull request #2894 from TimonMi/patch-1
Update link for contributing
2020-08-09 13:20:17 +02:00
EinDev
f8bd844c6c
Update link for contributing 2020-08-09 13:18:35 +02:00
JunTVDE
987d9a267c added german translation for flag-descriptions to de-DE.yml 2020-08-09 13:05:40 +02:00
EinDev
98d1bb9264 Merge remote-tracking branch 'upstream/v5' into v5 2020-08-08 18:39:47 +02:00
EinDev
b46a19f5ca Keep player names, so they don't have to be looked up again.
That way the lookup function MainUtil#getName won't get called which would throw an exception if called in the Bukkit Thread.
As the player enters the Name, we don't have to look it up again.

Fixes PS-96
2020-08-08 18:07:49 +02:00
dordsor21
6e16ef1246
remove PllayerEvents 2020-08-08 13:21:46 +01:00
dordsor21
7bad242944
Merge branch 'v6' into feature/v6/json. It builds!
# Conflicts:
#	Bukkit/build.gradle
#	Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/generator/DelegatePlotGenerator.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/inject/BukkitModule.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEvents.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/queue/ChunkCoordinator.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/queue/GenChunk.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java
#	Core/src/main/java/com/plotsquared/core/PlotSquared.java
#	Core/src/main/java/com/plotsquared/core/command/Area.java
#	Core/src/main/java/com/plotsquared/core/command/Clear.java
#	Core/src/main/java/com/plotsquared/core/command/Debug.java
#	Core/src/main/java/com/plotsquared/core/command/DebugRoadRegen.java
#	Core/src/main/java/com/plotsquared/core/command/Relight.java
#	Core/src/main/java/com/plotsquared/core/command/Set.java
#	Core/src/main/java/com/plotsquared/core/command/Template.java
#	Core/src/main/java/com/plotsquared/core/command/Trim.java
#	Core/src/main/java/com/plotsquared/core/components/ComponentPresetManager.java
#	Core/src/main/java/com/plotsquared/core/generator/ClassicPlotManager.java
#	Core/src/main/java/com/plotsquared/core/generator/HybridPlotManager.java
#	Core/src/main/java/com/plotsquared/core/plot/Plot.java
#	Core/src/main/java/com/plotsquared/core/plot/flag/GlobalFlagContainer.java
#	Core/src/main/java/com/plotsquared/core/queue/AreaBoundDelegateQueueCoordinator.java
#	Core/src/main/java/com/plotsquared/core/queue/ChunkQueueCoordinator.java
#	Core/src/main/java/com/plotsquared/core/queue/LocalBlockQueue.java
#	Core/src/main/java/com/plotsquared/core/util/ChunkUtil.java
#	Core/src/main/java/com/plotsquared/core/util/EntityUtil.java
#	Core/src/main/java/com/plotsquared/core/util/RegionManager.java
#	Core/src/main/java/com/plotsquared/core/util/WorldUtil.java
#	Core/src/main/java/com/plotsquared/core/uuid/UUIDPipeline.java
#	build.gradle
2020-08-08 13:20:30 +01:00
dordsor21
74a5c48214
Finish up core and bukkit json 2020-08-08 12:16:48 +01:00
N0tMyFaultOG
11af906c79 Fix a little oopsie 2020-08-07 18:55:22 +02:00
N0tMyFaultOG
c31c4b4286 More work 2020-08-07 18:52:45 +02:00
dordsor21
7f29b5d1e8
ComponentPreset inventory to json 2020-08-07 13:22:10 +01:00
dordsor21
6012705e95
Implement Permission#format to replace the CaptionUtility#format method 2020-08-07 12:12:16 +01:00
dordsor21
21a97863ac
Refactor Captions to Permission, reimplement message list in debug command 2020-08-07 11:53:32 +01:00
dordsor21
50cfecb3fd
Several minor progress. Couple of bigger (inboxes and help) 2020-08-07 11:08:03 +01:00
dordsor21
1461804039
Remove last reference to PlotMessage in Core 2020-08-07 10:20:11 +01:00
Timon
dc3f45acd4 Added UseFlag check at Roads 2020-08-07 09:57:02 +01:00
Hannes Greule
6970dfa5f8 More json progress 2020-08-07 02:53:05 +02:00
MeFisto94
48d3c2105d Fixes an OfflinePlayerUtil breakage caused by NMS Changes 2020-08-06 15:23:36 +02:00
dordsor21
18f630ba15
Bit more json 2020-08-06 14:06:19 +01:00
dordsor21
f68eb9c778
update plot list 2020-08-06 13:36:15 +01:00
dordsor21
4a960d9f2c
update pagination to new json 2020-08-06 12:23:47 +01:00
Timon
c745b99922 Added UseFlag check at Roads 2020-08-06 12:01:43 +02:00
dordsor21
f1e3902fea
Several more progress 2020-08-05 11:48:10 +01:00
N0tMyFaultOG
41a623a643 More work towards json 2020-08-04 19:01:25 +02:00
dordsor21
d3fe1d3b2b
Fix plot info, sign usage in Plot.class 2020-08-04 15:07:07 +01:00
Hannes Greule
3fd3baaa47 Making progress on messages 2020-08-03 23:59:16 +02:00
N0tMyFaultOG
01d2b0024f Add more information to the debugpaste 2020-07-31 20:33:17 +02:00
N0tMyFaultOG
01e66f8833 Readd skyblock template 2020-07-29 14:53:09 +02:00
dordsor21
afd9b56e71
Merge branch 'v5' of github.com:IntellectualSites/PlotSquared into v5 2020-07-28 13:58:37 +01:00
dordsor21
e2f9b4245b
Fixes https://issues.intellectualsites.com/issue/PS-81
- Add break statements to switches to prevent bleed from normal spawning to breeding
 - Separate misc spawning from mob spawning
2020-07-28 13:56:37 +01:00
N0tMyFaultOG
22a007b514 Revert "Update zh-CN.yml"
This reverts commit 240362a16d1ee37228ea95672360417034a19af3.
2020-07-28 12:33:04 +02:00
dordsor21
38988b4819
A little spring cleaning
- Add Javadoc comments for where QueueCoordinator can be given or nulled
 - Add some more Javadoc comments in general
 - Squash methods into one where QueueCoordinator can be given
 - Only use one queue in some places where it makes sense
2020-07-28 10:18:49 +01:00
dordsor21
704e92c3d0
Use placeholder 2020-07-28 09:38:27 +01:00
dordsor21
97b1a60ae8
Move comments to ChunkCoordinator, remove Range annotations 2020-07-28 08:44:16 +01:00
dordsor21
3288721259
Better constructor error handling in QueueProvider.
Add back default constructor requiring world to QueueCoordinator to indicate extents require this constructor
2020-07-28 08:34:14 +01:00
N0tMyFaultOG
ab121c7eee Fixes https://github.com/IntellectualSites/PlotSquaredSuggestions/issues/133 2020-07-26 21:12:32 +02:00
NotMyFault
240362a16d
Update zh-CN.yml 2020-07-26 17:08:58 +02:00
Alexander Söderberg
f2dcbce490
Fix problem where servers created in v5 (not converted from v4) would fail to start properly.
This is a quite major issue and I hope this fix resolves it. Although, it should be tested with migration from v4 to v5 and then a fresh v5 server.
2020-07-25 03:16:36 +02:00
Alexander Söderberg
88df434404
Create CODE_OF_CONDUCT.md 2020-07-25 03:11:07 +02:00
dordsor21
b3ddabda29
Fix DelegateQueueCoordinator 2020-07-24 18:20:26 +01:00
dordsor21
b8b3e1e72a
Merge branch 'v6' into feature/v6/pipeline-queue
# Conflicts:
#	Bukkit/build.gradle
#	Core/src/main/java/com/plotsquared/core/generator/ClassicPlotManager.java
2020-07-24 18:18:42 +01:00
dordsor21
615a5212bf
update bukkit pom 2020-07-24 17:57:16 +01:00
dordsor21
221d299052
Fix a few remaining merge issues (+1 squashed commits)
Squashed commits:

[8c6b55dd4] Fix a few remaining merge issues
2020-07-24 17:57:16 +01:00
dordsor21
3180d2ddf2
Merge branch 'v5' into v6
# Conflicts:
#	Bukkit/build.gradle
#	Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEvents.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/placeholder/Placeholders.java
#	Core/src/main/java/com/plotsquared/core/PlotPlatform.java
#	Core/src/main/java/com/plotsquared/core/PlotSquared.java
#	Core/src/main/java/com/plotsquared/core/generator/ClassicPlotManager.java
#	Core/src/main/java/com/plotsquared/core/util/EventDispatcher.java
#	Core/src/main/java/com/plotsquared/core/uuid/UUIDPipeline.java
#	build.gradle
2020-07-24 17:15:58 +01:00
dordsor21
7aaa075ba8
Javadoc, some cleanup 2020-07-24 17:00:08 +01:00
Alexander Söderberg
4fb590889a
Remove all permission related errors 2020-07-24 17:44:47 +02:00
Alexander Söderberg
115ca903b2
Remove unused stuff 2020-07-24 17:36:48 +02:00
Alexander Söderberg
e90170a384
Merge remote-tracking branch 'origin/v6' into feature/v6/json
# Conflicts:
#	Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEvents.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitOfflinePlayer.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayer.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/queue/BukkitLocalQueue.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitEconHandler.java
#	Core/pom.xml
#	Core/src/main/java/com/plotsquared/core/PlotAPI.java
#	Core/src/main/java/com/plotsquared/core/PlotPlatform.java
#	Core/src/main/java/com/plotsquared/core/PlotSquared.java
#	Core/src/main/java/com/plotsquared/core/command/Area.java
#	Core/src/main/java/com/plotsquared/core/command/Auto.java
#	Core/src/main/java/com/plotsquared/core/command/Claim.java
#	Core/src/main/java/com/plotsquared/core/command/CmdConfirm.java
#	Core/src/main/java/com/plotsquared/core/command/Command.java
#	Core/src/main/java/com/plotsquared/core/command/CommandCaller.java
#	Core/src/main/java/com/plotsquared/core/command/DebugExec.java
#	Core/src/main/java/com/plotsquared/core/command/Grant.java
#	Core/src/main/java/com/plotsquared/core/command/Inbox.java
#	Core/src/main/java/com/plotsquared/core/command/Load.java
#	Core/src/main/java/com/plotsquared/core/command/Save.java
#	Core/src/main/java/com/plotsquared/core/command/Setup.java
#	Core/src/main/java/com/plotsquared/core/listener/PlotListener.java
#	Core/src/main/java/com/plotsquared/core/player/ConsolePlayer.java
#	Core/src/main/java/com/plotsquared/core/player/PlotPlayer.java
#	Core/src/main/java/com/plotsquared/core/plot/Plot.java
#	Core/src/main/java/com/plotsquared/core/plot/comment/CommentManager.java
#	Core/src/main/java/com/plotsquared/core/util/BlockUtil.java
#	Core/src/main/java/com/plotsquared/core/util/Permissions.java
2020-07-24 17:28:52 +02:00
dordsor21
1d0760c630
Formatting, mark nonnull, nullable etc 2020-07-24 16:24:53 +01:00
Alexander Söderberg
af44fe74ff
Add namespaces for translations 2020-07-24 17:19:25 +02:00
dordsor21
72c0021306
A couple of reworks
- Redo how regeneration works a little to also take a cuboid region for regeneration off-chunk plots
 - Fix a couple of cases where we were writing to the queue instead of the world in the ChunkConsumer (dum)
 - this seems to be working.
2020-07-24 15:17:42 +01:00
dordsor21
18918eb3a3
Fix a couple more Guice issues. Refactor read chunks to be a list of chunks rather than CuboidRegion 2020-07-24 14:36:50 +01:00
dordsor21
416e181992
Merge branch 'v6' into feature/v6/pipeline-queue 2020-07-24 13:10:11 +01:00
Alexander Söderberg
d7a49e3316
This is not my fault 2020-07-24 14:08:40 +02:00
dordsor21
cf13f13fbf
Merge branch 'v6' into feature/v6/pipeline-queue 2020-07-24 13:03:42 +01:00
Alexander Söderberg
f53a8d3b06
Fix permissionprofile initialisation order 2020-07-24 14:02:49 +02:00
dordsor21
8c5c1922c9
Merge branch 'v6' into feature/v6/pipeline-queue 2020-07-24 12:34:41 +01:00
Alexander Söderberg
707559e023 Merge remote-tracking branch 'origin/v6' into v6 2020-07-24 13:33:00 +02:00
Alexander Söderberg
97a2ccbfe0 make sure the PlayerMetaDataKeys keys are loaded 2020-07-24 13:32:46 +02:00
dordsor21
95f2a7a908
fix version 2020-07-24 12:22:13 +01:00
dordsor21
e53c53bb4a
Merge branch 'v6' into feature/v6/pipeline-queue
# Conflicts:
#	Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/inject/BukkitModule.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java
#	Core/src/main/java/com/plotsquared/core/queue/BasicLocalBlockQueue.java
2020-07-24 12:21:40 +01:00
dordsor21
d906a85095
Fix some issues I caused with Guice 2020-07-24 12:18:36 +01:00
Alexander Söderberg
dc1f669a1f Remove permission caching 2020-07-24 13:01:38 +02:00
Alexander Söderberg
0ea862b572
Merge pull request #2886 from IntellectualSites/features/v6/permissions
Permission system fixup
2020-07-24 12:49:37 +02:00
Alexander Söderberg
fe7a57b2b7 Remove mainutil cache workaround 2020-07-24 12:48:45 +02:00
Alexander Söderberg
c9c62a1083 Remove dumb permission mess. 2020-07-24 12:44:04 +02:00
Alexander Söderberg
5608c5a901 Merge branch 'v6' into features/v6/permissions
# Conflicts:
#	Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayer.java
#	Core/src/main/java/com/plotsquared/core/command/Auto.java
#	Core/src/main/java/com/plotsquared/core/player/ConsolePlayer.java
#	Core/src/main/java/com/plotsquared/core/util/Permissions.java
2020-07-24 12:20:45 +02:00
Alexander Söderberg
722361aedb Implement suggestions from PR comments 2020-07-24 12:15:25 +02:00
Alexander Söderberg
d2f40612f4 Switch from Class<T> to TypeLiteral, and implement managed meta access for temporary meta 2020-07-24 12:15:25 +02:00
Alexander Söderberg
6a63e5bb51 Expose the player's lock repository 2020-07-24 12:15:25 +02:00
Alexander Söderberg
ad40ab7e1e Grant plots to the correct player 2020-07-24 12:15:25 +02:00
Alexander Söderberg
05ce67fbfe Trick the compiler 2020-07-24 12:15:25 +02:00
Alexander Söderberg
555860cf83 Add managed persistent meta data access 2020-07-24 12:15:25 +02:00
Alexander Söderberg
2575787bd0 Add LockRepository 2020-07-24 12:15:25 +02:00
dordsor21
2cfb646065
Javadoc no fun 2020-07-23 18:11:52 +01:00
dordsor21
a1da452c41
Fix build properly 2020-07-23 18:09:37 +01:00
dordsor21
420e38bead
idek? 2020-07-23 18:07:23 +01:00
dordsor21
41c4018a27
Merge branch 'v6' into feature/v6/pipeline-queue 2020-07-23 18:06:45 +01:00
dordsor21
4d4f755607
6.0.0-SUPER-SNAPSHOT 2020-07-23 18:06:14 +01:00
dordsor21
d8e5daf12b
Fix missing Main->Chunk Util change 2020-07-23 18:04:01 +01:00
dordsor21
c3322021d0
mavenLocal, poms 2020-07-23 18:02:29 +01:00
dordsor21
45cc88091e
Merge branch 'v6' into feature/v6/pipeline-queue
# Conflicts:
#	Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java
2020-07-23 17:33:05 +01:00
dordsor21
27498f68fb
Many Much
- Add readregions to queues for when we're setting our own consumer (usually meaning the queue writes its own blocks, so it doesn't know which chunks to actually load)
 - Finish removing chunk/regionTasks
 - Allow the queue to not remove tickets from chunks (useful for swapping chunks so they don't unload needlessly)
 - Remove a lot of unused methods
 - Implement entities to queues
 - Remove chunk unloading (the server should really handle it)
2020-07-23 17:30:23 +01:00
Alexander Söderberg
d8e80daa93 Fix annoying guice injection issue 2020-07-23 15:40:43 +02:00
Alexander Söderberg
384a6730a4 Merge remote-tracking branch 'origin/features/v6/permissions' into features/v6/permissions
# Conflicts:
#	Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java
2020-07-23 15:06:00 +02:00
N0tMyFaultOG
a7de76d150 Fix dependencies 2020-07-23 15:03:57 +02:00
Alexander Söderberg
2154e237ff Remove construction of fake player entities for offline players. 2020-07-23 15:03:57 +02:00
Alexander Söderberg
5fda3e9765 Get rid of PermHandler 2020-07-23 15:03:57 +02:00
Alexander Söderberg
b302bb9379 Make VaultPermissionHandler extent BukkitPermissionHandler 2020-07-23 15:03:57 +02:00
Alexander Söderberg
bfbb81030f Start working on the new permission system 2020-07-23 15:03:57 +02:00
Alexander Söderberg
63ce3292aa Fix PlayerManager injection 2020-07-23 15:03:27 +02:00
Alexander Söderberg
b9a8846ee9 Fix WorldManager injection 2020-07-23 14:56:53 +02:00
Alexander Söderberg
6ae1d28f80 Fix WorldManager injection 2020-07-23 14:56:06 +02:00
Alexander Söderberg
17d358f8fe Fix plot ID issues 2020-07-23 14:14:15 +02:00
Alexander Söderberg
cfd71457d2 Clean up BlockUtil 2020-07-23 14:14:15 +02:00
Alexander Söderberg
87285e08dc Fix plot ID issues 2020-07-23 14:11:34 +02:00
N0tMyFaultOG
b3a63123fd Fix dependencies 2020-07-23 14:03:56 +02:00
Alexander Söderberg
7fc8238fb0 Remove construction of fake player entities for offline players. 2020-07-23 12:47:00 +02:00
Alexander Söderberg
32a0765484 Force more compilation errors 2020-07-22 21:09:38 +02:00
Alexander Söderberg
c5e1b87c61 Fix small issues 2020-07-22 21:06:23 +02:00
N0tMyFaultOG
603d1ee9bb Even more
Ok seriously, I stop here
2020-07-22 20:38:46 +02:00
Alexander Söderberg
86a0816b26 Merge remote-tracking branch 'origin/feature/v6/json' into feature/v6/json 2020-07-22 19:55:03 +02:00
Alexander Söderberg
287cb0f5ad Fix minor issues 2020-07-22 19:54:35 +02:00
N0tMyFaultOG
3009db3aa7 Update FlagCommand.java 2020-07-22 19:47:58 +02:00
N0tMyFaultOG
32e095ce15 More progress
I need a break, if something is missing, feel free to exchange that. K thx 🙏
2020-07-22 19:42:22 +02:00
Alexander Söderberg
9d6744ec15 Get rid of PermHandler 2020-07-22 12:35:48 +02:00
Alexander Söderberg
532f2caa37 Make VaultPermissionHandler extent BukkitPermissionHandler 2020-07-22 12:06:56 +02:00
Alexander Söderberg
da2fa24e74 Merge remote-tracking branch 'origin/v6' into v6 2020-07-22 12:05:50 +02:00
N0tMyFaultOG
8d04728ebc More work 2020-07-22 00:08:51 +02:00
N0tMyFaultOG
2aa5c276c9 Some more work done towards json 2020-07-21 21:39:52 +02:00
Alexander Söderberg
6dba31b257
Start working on the new permission system 2020-07-21 14:28:54 +02:00
Alexander Söderberg
6040e1bb5e
remove mainutil 2020-07-21 13:14:55 +02:00
Alexander Söderberg
20e9d13f60
Merge branch 'v6' into feature/v6/json
# Conflicts:
#	Core/src/main/java/com/plotsquared/core/util/MainUtil.java
#	Core/src/main/java/com/plotsquared/core/util/OperationUtil.java
2020-07-21 13:13:10 +02:00
Alexander Söderberg
73e3572c72
Fix the redstone flag on roads 2020-07-21 13:11:28 +02:00
Alexander Söderberg
5f76cc4f7b
Give ConsolePlayer the same treatment 2020-07-21 13:07:33 +02:00
Alexander Söderberg
186a810bf6
Bring back PAPI placeholders and raw colour formatting 2020-07-21 13:05:40 +02:00
dordsor21
207e56969b
Remove ChunkManager#chunkTask 2020-07-19 16:03:40 +01:00
dordsor21
94b6a27cf3
add missing license headers 2020-07-19 16:02:30 +01:00
dordsor21
21693e344c
Switch from MainUtil 2020-07-19 14:37:42 +01:00
dordsor21
d2443f6de8
Merge branch 'v6' into feature/v6/pipeline-queue
# Conflicts:
#	Bukkit/src/main/java/com/plotsquared/bukkit/queue/GenChunk.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitRegionManager.java
#	Core/src/main/java/com/plotsquared/core/generator/HybridPlotManager.java
#	Core/src/main/java/com/plotsquared/core/generator/SquarePlotManager.java
#	Core/src/main/java/com/plotsquared/core/plot/Plot.java
#	Core/src/main/java/com/plotsquared/core/plot/PlotArea.java
#	Core/src/main/java/com/plotsquared/core/plot/world/SinglePlotManager.java
#	Core/src/main/java/com/plotsquared/core/util/SchematicHandler.java
2020-07-19 14:29:08 +01:00
dordsor21
ed27422e69
Move IJ/xyz cache out of MainUItil to its own class 2020-07-19 14:21:52 +01:00
dordsor21
d24c89405a
Switch to using a Clipboard for regen in preparation for WE changes 2020-07-19 14:17:38 +01:00
Alexander Söderberg
2d518dfe2b Clean up BlockUtil 2020-07-19 14:49:26 +02:00
Alexander Söderberg
f357fa74f3 Remove unused files 2020-07-19 14:37:53 +02:00
Alexander Söderberg
335cf5d2e9 Fix issues 2020-07-19 14:34:42 +02:00
Alexander Söderberg
ed3eedd238 Merge branch 'v6' into feature/v6/json
# Conflicts:
#	Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java
#	Core/src/main/java/com/plotsquared/core/PlotSquared.java
#	Core/src/main/java/com/plotsquared/core/command/Add.java
#	Core/src/main/java/com/plotsquared/core/command/Auto.java
#	Core/src/main/java/com/plotsquared/core/command/Buy.java
#	Core/src/main/java/com/plotsquared/core/command/Template.java
#	Core/src/main/java/com/plotsquared/core/generator/HybridPlotManager.java
#	Core/src/main/java/com/plotsquared/core/generator/HybridPlotWorld.java
#	Core/src/main/java/com/plotsquared/core/listener/PlotListener.java
#	Core/src/main/java/com/plotsquared/core/location/Location.java
#	Core/src/main/java/com/plotsquared/core/plot/Plot.java
#	Core/src/main/java/com/plotsquared/core/plot/PlotArea.java
#	Core/src/main/java/com/plotsquared/core/plot/PlotCluster.java
#	Core/src/main/java/com/plotsquared/core/plot/PlotId.java
#	Core/src/main/java/com/plotsquared/core/plot/expiration/ExpireManager.java
#	Core/src/main/java/com/plotsquared/core/plot/flag/implementations/KeepFlag.java
#	Core/src/main/java/com/plotsquared/core/util/MainUtil.java
#	Core/src/main/java/com/plotsquared/core/util/PlayerManager.java
#	Core/src/main/java/com/plotsquared/core/util/SchematicHandler.java
#	Core/src/main/java/com/plotsquared/core/util/query/PlotQuery.java
#	Core/src/main/java/com/plotsquared/core/util/query/SearchPlotProvider.java
2020-07-19 14:32:31 +02:00
Alexander Söderberg
23783b8b0b add deprecations 2020-07-19 14:24:42 +02:00
Alexander Söderberg
193054f1fc Move shit out of MainUtil into more appropriate classes 2020-07-19 14:23:55 +02:00
N0tMyFaultOG
87a8ff742f 5.13.1 2020-07-19 14:16:13 +02:00
dordsor21
656700b5be
Start reimplementing chunk generation.
This would either need to be one WorldEdit operation or (preferable) WorldEdit allows Extents (including EditSessions) into the regenerate adapter method
2020-07-19 13:12:27 +01:00
dordsor21
3e84f3b3a4
Merge branch 'v6' into feature/v6/pipeline-queue
# Conflicts:
#	Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java
#	Core/src/main/java/com/plotsquared/core/plot/Plot.java
#	Core/src/main/java/com/plotsquared/core/util/WorldUtil.java
2020-07-18 15:27:52 +01:00
Alexander Söderberg
5360df6012 Add PlotRangeIterator for the many places where it'll be used. All one of them, in fact. This was not a waste of time. I am very happy I did this. This was worthwhile. Yup. 2020-07-18 16:19:12 +02:00
Alexander Söderberg
39fdaa367c Make PlotQuery iterable 2020-07-18 16:18:23 +02:00
Hannes Greule
7e0cdb12d7 Replace some common messages 2020-07-18 15:06:51 +02:00
dordsor21
03983e8886
Allow forcing of queues down pipelines to ensure whenDone runnables are called correctly
Also remove autoQueue since it's never used and would be a bad idea
2020-07-18 13:55:54 +01:00
dordsor21
57af50ed49
Continue implementation of new queue system
- Move ChunkCoordinatorBuild to Core
- Add core ChunkCoordinator
- Add Factories for ChunkCoordinator and its Builder
- Reimplement refreshChunk but in WorldUtil
- Allow custom Consumers to be used by the Queue when sent to the ChunkCoordinator
- Start switching ChunkTasks to use the new ChunkCoordinator system
- Replace GlobalBlockQueue's "empty task" system with normal sync TaskManager
- Remove lombok from the queue system
- Add back forceSync and chunkObject from LocalBlockQueue
2020-07-18 12:07:56 +01:00
Alexander Söderberg
e80ade65c7 Clean up PlotId 2020-07-18 11:05:16 +02:00
Alexander Söderberg
4d24112ec7 Fix merge issues 2020-07-17 23:06:40 +02:00
Alexander Söderberg
1a269a1227 Merge branch 'v6' into feature/v6/json
# Conflicts:
#	Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java
#	Core/src/main/java/com/plotsquared/core/util/WorldUtil.java
2020-07-17 23:05:45 +02:00
Alexander Söderberg
d077fafd29 Some random bukkitutil/worldutil improvements 2020-07-17 23:00:09 +02:00
Alexander Söderberg
5478e70576 Fix some more captions 2020-07-17 21:46:15 +02:00
dordsor21
66b94ab9f1
Start switching to WorldEdit Worlds 2020-07-17 17:21:32 +01:00
dordsor21
74c6fc954e
Merge branch 'v6' into feature/v6/pipeline-queue
# Conflicts:
#	Core/src/main/java/com/plotsquared/core/command/Trim.java
#	Core/src/main/java/com/plotsquared/core/queue/BasicLocalBlockQueue.java
#	Core/src/main/java/com/plotsquared/core/queue/GlobalBlockQueue.java
2020-07-17 17:16:49 +01:00
Alexander Söderberg
22bd2eb238 Super minor issues from previous merges 2020-07-17 18:06:38 +02:00
Alexander Söderberg
2a72f274c9 Fix failed merge 2020-07-17 18:00:08 +02:00
Alexander Söderberg
3a1b56494a Merge branch 'v6' into feature/v6/json
# Conflicts:
#	Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java
#	Core/src/main/java/com/plotsquared/core/command/Claim.java
#	Core/src/main/java/com/plotsquared/core/command/Condense.java
#	Core/src/main/java/com/plotsquared/core/plot/comment/CommentManager.java
#	Core/src/main/java/com/plotsquared/core/util/task/AutoClaimFinishTask.java
#	Core/src/main/java/com/plotsquared/core/util/task/ObjectTaskRunnable.java
#	Core/src/main/java/com/plotsquared/core/util/task/TaskManager.java
2020-07-17 17:58:14 +02:00
Alexander Söderberg
932052772c Fix edge cases for time conversion 2020-07-17 17:53:30 +02:00
Alexander Söderberg
43d058d3db Address comments 2020-07-17 17:53:30 +02:00
Alexander Söderberg
020b030667 More fixes 2020-07-17 17:53:30 +02:00
Alexander Söderberg
5a3eacde0b Replace method synchronization logic 2020-07-17 17:53:30 +02:00
Alexander Söderberg
7f412f5472 Begin work on the task system 2020-07-17 17:53:30 +02:00
Alexander Söderberg
33b6ef66d6 Delombok + import organisation 2020-07-17 17:24:45 +02:00
dordsor21
9fefe57c90
Switch to using QueueCoordinators everywhere 2020-07-17 15:41:06 +01:00
dordsor21
ed77522c08
Add wna block setting, use WorldEdit worlds rather than Strings. 2020-07-17 14:38:50 +01:00
dordsor21
09aca839a8
Add back changes to ChunkCoordinator 2020-07-17 14:00:01 +01:00
dordsor21
def9a1bcf8
begin new block setting/chunk pipeline
This will ultimately replace both the GlobalBlockQueue and the ChunkTask stuff
2020-07-17 13:22:33 +01:00
dordsor21
57435fdf34
verbosely ensure items cannot be duplicated when keeping inventory on death
Seemingly there's duplication issues on some servers (and apparently even when only PlotSquared is installed). Likely a Spigot issue, but there's nothing to be done for Spigot on 1.13/14/15
2020-07-16 23:24:11 +01:00
N0tMyFaultOG
01ff9a34c2 Merge branch 'features/v5/placeholders' into v5 2020-07-16 18:48:45 +02:00
N0tMyFaultOG
ff3a94933a Bump version 2020-07-16 18:43:52 +02:00
Hannes Greule
97a356c4a0 Very attentive reviewers, can recommend 2020-07-16 18:13:02 +02:00
Hannes Greule
10ab28c1ec Add missing license headers 2020-07-16 18:08:00 +02:00
Hannes Greule
2d9cf8b759 Get placeholders working 2020-07-16 18:04:17 +02:00
Alexander Söderberg
32b28a4ca5
Turn all UUID messages into debug messages 2020-07-15 22:42:58 +02:00
N0tMyFaultOG
4996d8bcd1 Remove left over debugs 2020-07-15 14:05:15 +02:00
NotMyFault
e5963a8590
Merge pull request #2877 from IntellectualSites/features/v5/split-bukkit-listeners
Clean up bukkit listeners by splitting them up
2020-07-15 13:35:38 +02:00
N0tMyFaultOG
e8c155763b Register placeholders 2020-07-15 12:44:07 +02:00
N0tMyFaultOG
a52249513e Update MVdW version 2020-07-15 12:05:42 +02:00
Alexander Söderberg
5d2d4ac12b
fix language issue 2020-07-14 20:47:15 +02:00
Alexander Söderberg
64f5580edd
Fix code styling issue 2020-07-14 20:46:52 +02:00
Alexander Söderberg
b989531a60
Merge branch 'v5' into features/v5/placeholders 2020-07-14 20:41:17 +02:00
Alexander Söderberg
34655b8d41
Add (untested) MVdWPlaceholderAPI support 2020-07-14 20:41:08 +02:00
dordsor21
30327d2fa3
update bukkit pom 2020-07-14 19:11:46 +01:00
dordsor21
2e4c43c251
Add config option to disable placing top wall blocks 2020-07-14 19:10:53 +01:00
Alexander Söderberg
c0a0d36e5d
Remove remaining jetbrains imports 2020-07-14 19:40:47 +02:00
Alexander Söderberg
b68d7150f1
Manually fix some merge conflicts 2020-07-14 19:34:44 +02:00
Alexander Söderberg
198bcfdf4d
Merge branch 'v6' into feature/v6/json
# Conflicts:
#	Bukkit/build.gradle
#	Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayer.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java
#	Core/build.gradle
#	Core/src/main/java/com/plotsquared/core/PlotPlatform.java
#	Core/src/main/java/com/plotsquared/core/PlotSquared.java
#	Core/src/main/java/com/plotsquared/core/command/Add.java
#	Core/src/main/java/com/plotsquared/core/command/Area.java
#	Core/src/main/java/com/plotsquared/core/command/Auto.java
#	Core/src/main/java/com/plotsquared/core/command/Command.java
#	Core/src/main/java/com/plotsquared/core/command/ListCmd.java
#	Core/src/main/java/com/plotsquared/core/configuration/Caption.java
#	Core/src/main/java/com/plotsquared/core/listener/PlotListener.java
#	Core/src/main/java/com/plotsquared/core/player/ConsolePlayer.java
#	Core/src/main/java/com/plotsquared/core/player/PlotPlayer.java
#	Core/src/main/java/com/plotsquared/core/plot/message/PlotMessage.java
#	Core/src/main/java/com/plotsquared/core/setup/CommonSetupSteps.java
#	Core/src/main/java/com/plotsquared/core/util/MainUtil.java
#	Core/src/main/java/com/plotsquared/core/util/WorldUtil.java
2020-07-14 19:25:14 +02:00
Alexander Söderberg
8eb903ad72
Merge branch 'v5' into v6
# Conflicts:
#	Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java
2020-07-14 19:18:08 +02:00
Alexander Söderberg
c853147635
Merge pull request #2870 from IntellectualSites/feature/v6/platform 2020-07-14 19:13:00 +02:00
Alexander Söderberg
0294397021
Manually resolve a bunch of merge issues 2020-07-14 19:10:52 +02:00
Alexander Söderberg
97fed21811
Merge branch 'v6' into feature/v6/platform
# Conflicts:
#	Bukkit/build.gradle
#	Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/listener/ChunkListener.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitRegionManager.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/uuid/SquirrelIdUUIDService.java
#	Core/build.gradle
#	Core/src/main/java/com/plotsquared/core/PlotSquared.java
#	Core/src/main/java/com/plotsquared/core/command/Claim.java
#	Core/src/main/java/com/plotsquared/core/command/Debug.java
#	Core/src/main/java/com/plotsquared/core/command/DebugExec.java
#	Core/src/main/java/com/plotsquared/core/command/Purge.java
#	Core/src/main/java/com/plotsquared/core/command/Trim.java
#	Core/src/main/java/com/plotsquared/core/components/ComponentPresetManager.java
#	Core/src/main/java/com/plotsquared/core/database/SQLManager.java
#	Core/src/main/java/com/plotsquared/core/generator/HybridPlotWorld.java
#	Core/src/main/java/com/plotsquared/core/generator/HybridUtils.java
#	Core/src/main/java/com/plotsquared/core/generator/SquarePlotManager.java
#	Core/src/main/java/com/plotsquared/core/generator/SquarePlotWorld.java
#	Core/src/main/java/com/plotsquared/core/listener/ProcessedWEExtent.java
#	Core/src/main/java/com/plotsquared/core/player/ConsolePlayer.java
#	Core/src/main/java/com/plotsquared/core/player/PlotPlayer.java
#	Core/src/main/java/com/plotsquared/core/plot/Plot.java
#	Core/src/main/java/com/plotsquared/core/plot/PlotArea.java
#	Core/src/main/java/com/plotsquared/core/plot/PlotInventory.java
#	Core/src/main/java/com/plotsquared/core/plot/expiration/ExpireManager.java
#	Core/src/main/java/com/plotsquared/core/plot/expiration/PlotAnalysis.java
#	Core/src/main/java/com/plotsquared/core/plot/flag/FlagContainer.java
#	Core/src/main/java/com/plotsquared/core/plot/flag/types/BlockTypeWrapper.java
#	Core/src/main/java/com/plotsquared/core/plot/message/PlotMessage.java
#	Core/src/main/java/com/plotsquared/core/util/LegacyConverter.java
#	Core/src/main/java/com/plotsquared/core/util/MainUtil.java
#	Core/src/main/java/com/plotsquared/core/util/RegionManager.java
#	Core/src/main/java/com/plotsquared/core/util/SchematicHandler.java
#	Core/src/main/java/com/plotsquared/core/uuid/UUIDPipeline.java
2020-07-14 19:05:05 +02:00
Alexander Söderberg
510ea56431
Finalize DI stuff 2020-07-14 18:49:40 +02:00
Alexander Söderberg
7897d78f0d
Merge pull request #2868 from IntellectualSites/feature/v6/slf4j 2020-07-14 18:49:34 +02:00
Alexander Söderberg
25a58a5c46
Merge branch 'v6' into feature/v6/platform 2020-07-14 17:45:33 +02:00
Alexander Söderberg
f9e5fd714d
Merge remote-tracking branch 'origin/feature/v6/platform' into feature/v6/platform 2020-07-14 17:07:03 +02:00
Alexander Söderberg
55eefd09da
Merge branch 'v6' into feature/v6/json 2020-07-14 16:52:40 +02:00
Alexander Söderberg
0ce1f3e0f6
Send special message when caption cannot be found 2020-07-14 16:36:13 +02:00
Alexander Söderberg
99be181aea
Migrate some more captions 2020-07-14 16:31:58 +02:00
Alexander Söderberg
fbf6a3517d
Add back title method that somehow went missing and add a template utility class to make templates less annoying to work with 2020-07-14 15:04:31 +02:00
Alexander Söderberg
1dc4da8beb
Fix issues from previous merge 2020-07-14 13:21:59 +02:00
Alexander Söderberg
1908588fcb
Change expansion author and version 2020-07-14 13:17:21 +02:00
Alexander Söderberg
af7db08036
Add new placeholder system 2020-07-14 13:14:02 +02:00
NotMyFault
e72ce9c90e
Update gradle.yml 2020-07-14 12:44:11 +02:00
NotMyFault
32264ae5e3
Update gradle.yml 2020-07-14 12:43:45 +02:00
Alexander Söderberg
33f2ff7e6d
Merge branch 'v6' into feature/v6/slf4j 2020-07-13 23:11:40 +02:00
Alexander Söderberg
6664d49928
Prefix all log messages 2020-07-13 23:04:27 +02:00
Alexander Söderberg
d648a6d3db
Merge remote-tracking branch 'origin/feature/v6/slf4j' into feature/v6/slf4j
# Conflicts:
#	Bukkit/pom.xml
#	Core/pom.xml
2020-07-13 22:52:10 +02:00
Alexander Söderberg
a1f262b5b2
Fix gradle setup and replace all debug calls 2020-07-13 22:51:57 +02:00
Alexander Söderberg
b109b76120
Nevermind, it doesn't allow for relocations 2020-07-13 20:50:49 +02:00
N0tMyFaultOG
1388f280e6 Update module poms 2020-07-13 20:46:34 +02:00
Alexander Söderberg
d141b040d6
Fix relocations 2020-07-13 20:45:04 +02:00
Alexander Söderberg
e84d82315c Add log4j config (this might work :p) 2020-07-13 20:39:52 +02:00
N0tMyFaultOG
c6962ef4d2 Shift a few more messages to debug 2020-07-13 19:56:34 +02:00
N0tMyFaultOG
f93714a44e Properly add prefixes to messages 2020-07-13 13:01:13 +02:00
Hannes Greule
564efd77f7 Fix some messages 2020-07-12 22:11:23 +02:00
Hannes Greule
5442c7cc2e Start moving commands to new message system 2020-07-12 22:06:07 +02:00
Alexander Söderberg
0fa5a16cd0 replace remaining debug calls 2020-07-12 21:49:05 +02:00
N0tMyFaultOG
1881cdc9ab Revert "Add prefix"
This reverts commit fb2aa44f78cdb6f2548671b78f22c8c78b86b31a.
2020-07-12 21:28:38 +02:00
N0tMyFaultOG
fb2aa44f78 Add prefix 2020-07-12 21:25:22 +02:00
Alexander Söderberg
e88da3cea9 Add chunk coordinator 2020-07-12 20:58:48 +02:00
dordsor21
14b6f84816
fix typos that were c/p over 2020-07-12 18:50:04 +01:00
N0tMyFaultOG
ac8841447c 6cf2c0ad97 (r40542418) 2020-07-12 17:11:25 +02:00
Alexander Söderberg
6cf2c0ad97
Disable the paper uuid service for offline mode servers and add toggles for all third party uuid services 2020-07-12 17:04:30 +02:00
dordsor21
c045ef698c
Add license headers and fix method change in PlotSquared.java 2020-07-12 11:42:45 +01:00
Alexander Söderberg
5cdb3f4fd5 Add missing injection points 2020-07-12 12:25:44 +02:00
Alexander Söderberg
5a5c5721cc
fix compiler crashing 2020-07-12 07:38:57 +02:00
dordsor21
3a11ffc77a
Clean up bukkit listeners by splitting them up 2020-07-11 19:03:55 +01:00
Alexander Söderberg
916675fb08
Guice progress 2020-07-11 17:19:19 +02:00
dordsor21
a2ec404014
Fix /plot target nearest 2020-07-11 13:40:22 +01:00
Alexander Söderberg
6f6cb4b630 More DI progress 2020-07-11 05:29:41 +02:00
Alexander Söderberg
c0f69f321d
Guice progress 2020-07-10 22:12:37 +02:00
Alexander Söderberg
55bf41d2da
Remove dumdum static access 2020-07-10 19:25:05 +02:00
Alexander Söderberg
7687d7705b
Fix merge issue 2020-07-10 18:38:14 +02:00
Alexander Söderberg
21ad9a36c8
Merge branch 'v6' into feature/v6/platform
# Conflicts:
#	Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEvents.java
#	Core/src/main/java/com/plotsquared/core/PlotSquared.java
#	Core/src/main/java/com/plotsquared/core/generator/HybridUtils.java
#	Core/src/main/java/com/plotsquared/core/location/Location.java
2020-07-10 18:37:18 +02:00
dordsor21
afb72aa102
Don't include eggs with spawn*_eggs* 2020-07-10 17:31:46 +01:00
Alexander Söderberg
d00dc658df Inject EventDispatcher and PlotListener 2020-07-10 18:17:44 +02:00
Alexander Söderberg
2dab7c8dda Inject PlotAreaManager 2020-07-10 17:32:07 +02:00
Alexander Söderberg
c37cc40ad9 Move annotation in BukkitWorld 2020-07-10 12:27:26 +02:00
Alexander Söderberg
5341015cb1 Finalize immutable locations and add a platform world implementation 2020-07-10 12:21:29 +02:00
dordsor21
2fb76e6636
Split road and plot paste-on-top settings 2020-07-09 22:39:06 +01:00
dordsor21
5b260ea8da
update bukkit pom 2020-07-09 22:33:01 +01:00
dordsor21
55139eb134
Do not respect paste on top for road schematics. 2020-07-09 22:19:23 +01:00
dordsor21
5e44bb60c6
Merge branch 'v5' of github.com:IntellectualSites/PlotSquared into v5 2020-07-09 22:14:38 +01:00
dordsor21
96740fd282
Couple of fixes to road flag logic 2020-07-09 21:52:51 +01:00
Alexander Söderberg
cf1b027db9
Start making locations immutable 2020-07-09 22:28:46 +02:00
NotMyFault
fb050ac3da
5.12.5 2020-07-09 21:15:28 +02:00
Alexander Söderberg
b36c6427d1 Split failed UUID batches into individual requests in order to identify the invalid UUIDs 2020-07-09 20:37:14 +02:00
Traks
63c308971b Update location block vector on add and subtract 2020-07-09 20:14:06 +02:00
Traks
cfd389883b Improve piston interaction with area border 2020-07-09 20:14:06 +02:00
Traks
4576cfd961 Improve piston interaction with plot border
Fixes retracting pistons being able to modify plot borders. Prevents
piston heads from sticking outside plots.
2020-07-09 20:14:06 +02:00
Alexander Söderberg
89cb6450fb
Fix issue where PlotPlayer#getLocation returns a mutable location 2020-07-09 20:04:00 +02:00
Alexander Söderberg
699eb71e2a
Fix kill-road-mobs. Fixes PS-73 2020-07-09 19:46:17 +02:00
Alexander Söderberg
6b07f38cff
Send teleportation cancellation message immediately on movement, rather than after the timer has finished. This fixes PS-33. 2020-07-09 16:45:25 +02:00
Alexander Söderberg
904f5485ab
Merge remote-tracking branch 'origin/v5' into v5 2020-07-09 16:38:53 +02:00
Alexander Söderberg
e05d817482
Fix plot owner placeholder. Fixes PS-62. 2020-07-09 16:38:46 +02:00
Alexander Söderberg
db37077af7
Make signs able to use captions 2020-07-09 12:58:28 +02:00
Traks
61de18190f More dispense blocking on roads 2020-07-09 12:33:23 +02:00
dordsor21
1310f9470e
5.12.4 2020-07-08 19:34:08 +01:00
Hannes Greule
d652225f36 Let players teleport to their merged plots 2020-07-08 19:33:58 +02:00
dordsor21
2936b806f3
Allow players to interact on their own plot 2020-07-08 17:10:09 +01:00
Alexander Söderberg
3fa532a3c0
Move message sending into PlotPlayer to make it platform independent 2020-07-08 15:35:58 +02:00
dordsor21
d267d1bb98
Start expiry tasks 2020-07-08 14:35:46 +01:00
Alexander Söderberg
9792d4cc4b
Remove style.yml 2020-07-08 15:23:33 +02:00
Alexander Söderberg
090bd69be5
Merge branch 'v6' into feature/v6/json
# Conflicts:
#	Bukkit/src/main/java/com/plotsquared/bukkit/chat/FancyMessage.java
2020-07-08 15:22:02 +02:00
Alexander Söderberg
c36e311520
Continue cleaning up PlotSquared.java 2020-07-08 15:09:25 +02:00
Alexander Söderberg
f2191cb731 Save style.yml again 2020-07-08 13:59:31 +02:00
Alexander Söderberg
265c10ec1c Remove commands.yml 2020-07-08 13:59:31 +02:00
Alexander Söderberg
51bd21a464
Merge branch 'v6' into feature/v6/platform
# Conflicts:
#	Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEvents.java
2020-07-08 13:57:33 +02:00
N0tMyFaultOG
5004005c5a Fixes PS-65
EssentialsX uses paperlib 1.0.4 where we compile explicitly against 1.0.2
2020-07-08 12:21:31 +02:00
N0tMyFaultOG
67a49a2ca7 5.12.3 2020-07-07 21:03:30 +02:00
Hannes Greule
57127537f7 Add permission check for /plot home 2020-07-07 20:45:52 +02:00
Hannes Greule
3476522c00 Allow /p v <alias> 2020-07-07 20:45:52 +02:00
Hannes Greule
3d087b1bbe Fix tab completion and usage 2020-07-07 20:45:52 +02:00
Hannes Greule
c058614fcc Split visit command into home and visit 2020-07-07 20:45:52 +02:00
dordsor21
9e9db0f1df
Merge branch 'features/v5/road-respect-flags' into v5 2020-07-07 17:49:32 +01:00
dordsor21
e826836c36
Merge branch 'v5' into features/v5/road-respect-flags 2020-07-07 17:48:46 +01:00
Alexander Söderberg
196df855ac
Clean up PlotAreaManager and move a bunch of plot area related logic out of PlotSquared 2020-07-07 13:37:03 +02:00
Alexander Söderberg
d76c9dad52
Remove access to PlotSquared#IMP and rename IPlotMain to PlotPlatform, then rename PlotSquared#imp() to PlotSquared#platform() 2020-07-07 12:56:43 +02:00
Alexander Söderberg
298e65a394
Replace remaining references to PlotSquared#log 2020-07-06 17:17:46 +02:00
Alexander Söderberg
078b776f60
Implement console messages 2020-07-05 18:14:29 +02:00
Alexander Söderberg
4d61a345c6
Small documentation fixes 2020-07-05 18:06:10 +02:00
Alexander Söderberg
dc0358957e
Add prefix replacement to messages and skip sending empty messages 2020-07-05 18:02:43 +02:00
Alexander Söderberg
42d648e338
Use adventure for titles 2020-07-05 17:57:58 +02:00
Alexander Söderberg
1c254984c1
Replace logging references in Bukkitmain 2020-07-05 13:56:54 +02:00
Alexander Söderberg
f287cc34e7
Remove json message stuff 2020-07-05 13:46:25 +02:00
Alexander Söderberg
c8a8806e7d
Component progress. The plugin is **very** broken right now. 2020-07-05 13:41:40 +02:00
Alexander Söderberg
d061f728bd
Merge remote-tracking branch 'origin/feature/v5/json' into feature/v5/json 2020-07-05 12:44:25 +02:00
Hannes Greule
b5818bfefc Lazy fix for FancyMessage 1.16 2020-07-04 20:25:49 +02:00
Hannes Greule
6bf5bc60d1 Update messages_en.json with new placeholders 2020-07-04 18:57:56 +02:00
Alexander Söderberg
c784c69eb3
progress 2020-07-04 18:53:03 +02:00
Alexander Söderberg
e3759d059a
Fixing missing license headers. 2020-07-04 18:03:47 +02:00
Alexander Söderberg
429f5e55c3
Add option to disable background caching 2020-07-03 13:50:12 +02:00
Alexander Söderberg
0e7a6d7a62
Fix typo 2020-07-03 13:47:50 +02:00
dordsor21
ad1ec42b12
Add new clear pipeline to hpw and make some stuff read access as required. 2020-07-02 14:33:22 +01:00
dordsor21
580212d66d fix build 2020-07-01 21:49:53 +01:00
dordsor21
b71de856a8 allow plugins extending and replacing RegionManager to be notified of, and "accept" plot clear "requests".
.
.
.
.
.
FAWE
2020-07-01 21:49:53 +01:00
Hannes Greule
35cff29917 Add license header 2020-07-01 17:24:47 +02:00
dordsor21
2910176b97
Add road flag container 2020-07-01 14:53:57 +01:00
dordsor21
c5ec8e1931
actually fix all conflicts 2020-07-01 14:21:18 +01:00
dordsor21
82a887fd3b
Merge branch 'v5' into features/v5/road-respect-flags
# Conflicts:
#	Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEvents.java
2020-07-01 14:12:16 +01:00
NotMyFault
eff410d1da
Merge pull request #2862 from IntellectualSites/bukkit/1.16.1
Update to 1.16.1
2020-07-01 12:02:57 +02:00
N0tMyFaultOG
cbe8875b94 Bump gradle version 2020-07-01 11:59:28 +02:00
MattBDev
49c35ec084 Resolve NMF's concerns 2020-06-29 22:05:32 -04:00
Hannes Greule
f80cadcd7f Draft of Caption resolving 2020-06-29 21:33:57 +02:00
Hannes Greule
fa2ad8ab22 Improve plot alias command (tab complete, admin permission) fixes PS-63 2020-06-29 13:48:37 +02:00
N0tMyFaultOG
600f757046 Finish messages 2020-06-29 12:34:09 +02:00
MattBDev
3a2e932d17 Add missing mobs from 1.13.2+ 2020-06-28 18:45:40 -04:00
N0tMyFaultOG
a2aaa3633a More work 2020-06-28 16:56:42 +02:00
MeFisto94
bd9bdc9e03 Separate the Vault Permission Handling from the Economy Handling 2020-06-28 14:28:11 +02:00
N0tMyFaultOG
3b793929d8 Initialize messages_en.json 2020-06-28 13:51:57 +02:00
Hannes Greule
e139550949 Make cache expiration configurable 2020-06-27 23:07:20 +02:00
NotMyFault
181c5b134f
Update old links 2020-06-27 21:48:15 +02:00
Carter
74876f9e64 Get biome data from correct schematic for intersections (Fixes PS-50) 2020-06-27 20:44:46 +01:00
dordsor21
02f3c3ef50
Fix my stupid mistake of using lamdas not creating nested classes when creating schematics. "this" doesn't work like that. Cheers Java. 2020-06-27 20:38:55 +01:00
MeFisto94
9c3d2cfb02 Move the caching and static accessors from EconHandler to PlotMain 2020-06-27 06:26:00 +02:00
MattBDev
9d609c2dfe Merge remote-tracking branch 'remotes/origin/v5' into bukkit/1.16.1 2020-06-26 20:40:50 -04:00
MattBDev
cb04c183a8 Update to 1.16.1 2020-06-26 20:38:30 -04:00
Hannes Greule
38425a1eae Update world border on Plot#claim (Fixes PS-13) 2020-06-26 13:49:17 +02:00
Alexander Söderberg
4b997d42df
Some slf4j progress 2020-06-26 11:03:42 +02:00
Hannes Greule
d1ecf9232e
Merge pull request #2859 from FreebuildFR/feature/flag_placeholder
Add placeholders to get the value of a plot flag
2020-06-26 02:22:59 +02:00
EpiCanard
e833403e3c Replace split with substring for placeholders 2020-06-25 14:08:44 +02:00
Alexander Söderberg
f64026af1a Only initialise EconHandler when economy is enabled and stop accessing the static instance directly. 2020-06-24 15:26:06 +02:00
Alexander Söderberg
efab6e92f7
Lower tab completion cache time and fix "Invalid player" message for /plot kick 2020-06-24 13:44:06 +02:00
Alexander Söderberg
f69cc5cc98
Merge remote-tracking branch 'origin/v5' into v5 2020-06-24 08:32:14 +02:00
Alexander Söderberg
f6f26c6102
Fix issue where numbers were sometimes parsed as usernames when they shouldn't be. This commit also fixes an issue where "Not a valid plot ID" was sent twice. 2020-06-24 08:31:23 +02:00
Alexander Söderberg
159b35c717
Fix OfflinePlayerUUIDService breaking when no worlds have been loaded. 2020-06-24 08:05:06 +02:00
EpiCanard
7fbac4f286 Add a second placeholder to support only local flag of current plot 2020-06-24 00:51:27 +02:00
NotMyFault
29080de860
5.12.2 2020-06-23 23:57:27 +02:00
Alexander Söderberg
e17222dd19
Merge remote-tracking branch 'origin/v5' into v5 2020-06-23 18:37:00 +02:00
Alexander Söderberg
55cf34508a
Fix issue where old player objects were not cleaned up properly.
This is caused by an issue with the event order in Spigot (and Spigot derivatives), so the fix is rather hacky.
2020-06-23 18:36:53 +02:00
NotMyFault
c52603921d
Bump version 2020-06-23 13:13:01 +02:00
Alexander Söderberg
f4724a3c87
Fix expiration flag commands 2020-06-23 11:45:04 +02:00
Alexander Söderberg
2b4e2fc793
Add plot debugging and make tab completable aliases configurable 2020-06-23 11:39:45 +02:00
EpiCanard
14baead342 Add placeholder to get the value of a plot flag 2020-06-23 01:20:17 +02:00
Alexander Söderberg
2d6e6ceaeb
Improve documentation of BukkitMain#wrapPlayer and improve generic types 2020-06-22 15:45:57 +02:00
Alexander Söderberg
1dcf8d3995
Progress on the debug logging API 2020-06-21 15:50:49 +02:00
Hannes Greule
d07d32e28b Generate plot blocks on correct height when removing intersection
Fixes PS-46
2020-06-20 00:14:04 +02:00
PureGero
cb969e37a6 Don't teleport players; Fixes PS-14 2020-06-19 11:36:35 +02:00
Hannes Greule
6259287dff Add tab completion for /plot <deny|kick|remove> 2020-06-13 15:54:38 +02:00
Hannes Greule
3e2e61d2be Re-introduce online mode 2020-06-13 15:53:03 +02:00
Hannes Greule
a3586791b5 Remove unused code and use less aggressive colors 2020-06-11 01:01:00 +02:00
Hannes Greule
bb298ab660 Remove leftover TODO 2020-06-11 01:01:00 +02:00
Hannes Greule
8c0f581ff0 Add missing license headers to new files 2020-06-11 01:01:00 +02:00
Hannes Greule
033b87deb5 Resolve TODOs 2020-06-11 01:01:00 +02:00
Hannes Greule
b6f1610a7e Provide no suggestions instead of player names for commands 2020-06-11 01:01:00 +02:00
Hannes Greule
e3fbb32399 Formatting and documentation 2020-06-11 01:01:00 +02:00
Hannes Greule
67b80bb8e8 Fix /plot setup back 2020-06-11 01:01:00 +02:00
Hannes Greule
ae1427b189 Remove usage of SetupObject 2020-06-11 01:01:00 +02:00
Hannes Greule
5165c439fc Add tab completion and fix minor bugs 2020-06-11 01:01:00 +02:00
Hannes Greule
b15c48e074 Implement setup steps 2020-06-11 01:01:00 +02:00
Hannes Greule
c5bfde330f First draft of redesigned setup processing 2020-06-11 01:01:00 +02:00
N0tMyFaultOG
d12ecc8616 Softdepend on new complementary UUID services 2020-06-04 11:41:20 +02:00
N0tMyFaultOG
950640a557 Revert "Don't send chat spy to message sender"
This reverts commit a37ab10414e529d79d213d5adb66c49fe91abb71.
Let's not break plotchat when plotspy is enabled
2020-06-04 11:29:02 +02:00
N0tMyFaultOG
86746e7843 Fixed https://issues.intellectualsites.com/issue/PS-26 2020-06-03 21:18:46 +02:00
NotMyFault
2c74d2479f
Exchange website url 2020-06-02 17:06:33 +02:00
N0tMyFaultOG
f1b79a3b0d Add more documentation to the settings.yml
Apparently gradle wants to update the poms so here we go
2020-05-27 22:20:13 +02:00
Alexander Söderberg
6442922d86 Implement some more generic types to make the player objects easier to work with and also create wrapper objects for fake players (NPCs). Potentially fixes PS-27 2020-05-27 14:08:48 +02:00
Alexander Söderberg
edbacb8e47
Bump dependency version 2020-05-25 20:11:57 +02:00
dependabot-preview[bot]
71e22f41b1 Bump json from 20190722 to 20200518
Bumps [json](https://github.com/douglascrockford/JSON-java) from 20190722 to 20200518.
- [Release notes](https://github.com/douglascrockford/JSON-java/releases)
- [Commits](https://github.com/douglascrockford/JSON-java/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-25 17:29:36 +02:00
Alexander Söderberg
b9b0d89b5f
Replace the R-tree library with PRTree. Fix SquirrelID shading issues. Bump the version to 5.12.0 2020-05-25 15:13:31 +02:00
NotMyFault
fdf82d0d1e
Merge pull request #2852 from aurorasmiles/features/v5/uuid
Add BungeePerms UUID service
2020-05-25 13:15:41 +02:00
NotMyFault
09327b0128
Merge branch 'v5' into features/v5/uuid 2020-05-25 13:13:29 +02:00
NotMyFault
8a3ee4cdc2
Merge pull request #2853 from darbyjack/v5
Updated PAPI & EssX dependency to ensure compatibility
2020-05-25 13:02:10 +02:00
NotMyFault
8d1033f725
Merge branch 'v5' into v5 2020-05-25 12:58:32 +02:00
NotMyFault
1d8bad3a80
Merge pull request #2855 from IntellectualSites/dependabot/gradle/v5/net.luckperms-api-5.1
Bump luckperms from 5.0 to 5.1
2020-05-25 12:51:01 +02:00
dependabot-preview[bot]
67fbfb0f2d
Bump api from 5.0 to 5.1
Bumps [api](https://github.com/lucko/LuckPerms) from 5.0 to 5.1.
- [Release notes](https://github.com/lucko/LuckPerms/releases)
- [Commits](https://github.com/lucko/LuckPerms/compare/v5.0...v5.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-25 09:13:10 +00:00
darbyjack
4b0df80878
Updated PAPI & EssX dependency to ensure compatibility 2020-05-25 00:09:28 -05:00
Alexander Söderberg
52b90b6757
Merge pull request #2841 from IntellectualSites/features/v5/uuid 2020-05-25 01:40:35 +02:00
dordsor21
31b71ade69 * :D 2020-05-24 23:43:15 +01:00
dordsor21
0021b114de Revert "Slow down queue a bit because 1.13+ performance is bad"
This reverts commit bbde2f5e069379a6bb09cca70747dcc7d3c88c4f.
2020-05-24 23:24:27 +01:00
Alexander Söderberg
28a7d027f6
Merge branch 'v5' into features/v5/uuid 2020-05-24 21:14:56 +02:00
Alexander Söderberg
e32a2e2723
Merge pull request #2847 from IntellectualSites/features/v5/single-area 2020-05-24 21:13:51 +02:00
Alexander Söderberg
46b68e489d
Tab complete /p list 2020-05-24 21:08:11 +02:00
Alexander Söderberg
2436a6a402
remove debug, whoops 2020-05-24 20:54:10 +02:00
Alexander Söderberg
862467c0fa
Tab complete /plot visit 2020-05-24 20:53:16 +02:00
Alexander Söderberg
69cfb431b1
Unstupidify Visit 2020-05-24 20:18:02 +02:00
Alexander Söderberg
172bd6f0f2
This should hopefully fix that broken merge. Maybe. Possibly. Idk. 2020-05-24 19:05:09 +02:00
Alexander Söderberg
a882555d1b
Merge branch 'v5' into features/v5/uuid
# Conflicts:
#	Bukkit/build.gradle
#	Core/src/main/java/com/plotsquared/core/PlotSquared.java
#	Core/src/main/java/com/plotsquared/core/command/ListCmd.java
#	Core/src/main/java/com/plotsquared/core/command/Visit.java
2020-05-24 19:00:21 +02:00
NotMyFault
0b12c4e5b2
Update issue link 2020-05-24 18:48:15 +02:00
Alexander Söderberg
0ac6383c2c Use PlotQuery in Visit 2020-05-24 18:35:32 +02:00
Alexander Söderberg
76913d4a78 immutable -> mutable 2020-05-24 18:35:32 +02:00
Alexander Söderberg
a0d1da3274 fix dum typo 2020-05-24 18:35:32 +02:00
Alexander Söderberg
1aa144e47d Deprecate old PlotFilter class 2020-05-24 18:35:32 +02:00
Alexander Söderberg
6b31743fb3 add missing javadoc 2020-05-24 18:35:32 +02:00
Alexander Söderberg
508fdce704 Add missing methods to PlotQuery and use PlotQuery in ListCmd 2020-05-24 18:35:32 +02:00
Alexander Söderberg
e912909aad Add plot query system 2020-05-24 18:35:32 +02:00
Aurora
98322d5d11 Add BungeePerms UUID service. This should probably work. 2020-05-24 14:32:34 +02:00
Alexander Söderberg
7b97130af7
Add option to disable legacy cache, also add an option to return "Unknown" when a request cannot be fulfilled (old behaviour)
This should fix issues where lowercase offline mode UUIDs don't have access to their old cache.
2020-05-24 05:00:36 +02:00
Alexander Söderberg
cc168d5ae9
Fix SQLite table creation statement and add legacy SQLite uuids as a provider 2020-05-24 04:48:19 +02:00
Alexander Söderberg
d19df3b6eb
Fix offline mode UUIDs 2020-05-24 04:28:29 +02:00
Alexander Söderberg
75dbc2db98
Fix offline mode UUIDs 2020-05-24 04:27:20 +02:00
Alexander Söderberg
2875b050c5
Add plugin UUID services. They probably work. 2020-05-23 19:43:32 +02:00
Alexander Söderberg
6c6c2b57a1
Add options to disable tab completion and extend username completion, also limit the total number of username suggestions to 200 per request 2020-05-23 17:20:09 +02:00
Alexander Söderberg
113da81f29
Actually save the schematic 2020-05-23 16:15:48 +02:00
Alexander Söderberg
4dd2613f2f
Add missing caption 2020-05-23 15:02:53 +02:00
Alexander Söderberg
8c37cc5340
Fix minor issues 2020-05-23 15:02:31 +02:00
Alexander Söderberg
47c74cfa6d
Set correct region height 2020-05-23 14:39:28 +02:00
Alexander Söderberg
32a55127f1
Fix partial area regeneration when using PlotSquared generation.
Also fix issues with region height and road width.
2020-05-23 14:32:02 +02:00
Alexander Söderberg
6d0458281b Merge remote-tracking branch 'origin/v5' into features/v5/single-area 2020-05-23 02:30:45 +02:00
N0tMyFaultOG
6090c7ccac Link issues to new issue tracker for legacy reasons 2020-05-23 01:25:18 +02:00
Alexander Söderberg
5e6b27e21f
Update README.md 2020-05-23 00:33:30 +02:00
Alexander Söderberg
eee04ab87d Shade guava-mini into the bukkot module 2020-05-22 22:04:46 +02:00
Alexander Söderberg
a833803bdf Shade rx into the bukkot module 2020-05-22 22:04:46 +02:00
Alexander Söderberg
d2af342a5d Shade r-tree into the bukkit module 2020-05-22 22:04:46 +02:00
Alexander Söderberg
93619b3988 Don't access tree until it has been created 2020-05-22 22:04:46 +02:00
Alexander Söderberg
dd4c5014fc Get rid of unused field 2020-05-22 22:04:46 +02:00
Alexander Söderberg
1e3379b00a Fix up the plot area nightmare 2020-05-22 22:04:46 +02:00
dordsor21
bbde2f5e06 Slow down queue a bit because 1.13+ performance is bad 2020-05-22 10:44:51 +01:00
Alexander Söderberg
b61dfd6f97
Single plot area progress 2020-05-22 03:20:11 +02:00
Alexander Söderberg
f16fa0a3ed
Merge branch 'features/v5/worlds' into features/v5/single-area 2020-05-22 02:56:36 +02:00
Alexander Söderberg
d4bd08415a
Shade guava-mini into the bukkot module 2020-05-22 02:56:23 +02:00
Alexander Söderberg
9ad276eeae
Merge branch 'features/v5/worlds' into features/v5/single-area 2020-05-22 02:54:24 +02:00
Alexander Söderberg
a3179bf114
Shade rx into the bukkot module 2020-05-22 02:54:10 +02:00
Alexander Söderberg
0d20dad2a3
Merge branch 'features/v5/worlds' into features/v5/single-area 2020-05-22 02:52:05 +02:00
Alexander Söderberg
7c080770f0
Shade r-tree into the bukkit module 2020-05-22 02:51:40 +02:00
Alexander Söderberg
9752e5f62b
Start working on single plot areas 2020-05-22 02:48:32 +02:00
Alexander Söderberg
3b7057ad4f
do a second attempt at fetching uuid batches even if it errors 2020-05-21 21:24:55 +02:00
Alexander Söderberg
38a7c771be
Don't access tree until it has been created 2020-05-21 20:23:36 +02:00
Alexander Söderberg
1c6075df2b
Get rid of unused field 2020-05-21 20:06:37 +02:00
Alexander Söderberg
3ede0447b0
Fix up the plot area nightmare 2020-05-21 20:06:04 +02:00
Alexander Söderberg
f01b242e4a
For sign updating to be scheduled asynchronously.
It then forces it back on the main thread, so it's fine, but this way we can safely wait for the UUID mapping to be fetched.
2020-05-20 15:26:20 +02:00
Alexander Söderberg
2417dace2d
Add UUID caching 2020-05-20 15:12:09 +02:00
Alexander Söderberg
f82a111518
Merge branch 'v5' into features/v5/uuid
# Conflicts:
#	Bukkit/pom.xml
#	Core/src/main/java/com/plotsquared/core/util/SchematicHandler.java
2020-05-20 11:27:11 +02:00
dordsor21
525ba648ae ignore build/ and update bukkit pom.xml apparently 2020-05-20 09:44:45 +01:00
dordsor21
0160c2bb55 Add setCuboids method to RegionManager
- Allow FAWE to take charge of big operations like /plot set all
2020-05-20 08:43:58 +01:00
Alexander Söderberg
ea41c842bc
Fix a bunch of minor issues 2020-05-20 00:31:59 +02:00
Alexander Söderberg
8efc78e1c9
IT COMPILES! 2020-05-19 23:05:36 +02:00
Alexander Söderberg
973c18623f
Port more commands and add more tab completion utilities 2020-05-19 19:34:33 +02:00
dordsor21
7aba70ea65 Make plot clears/sets less crashy.
There's still the issue of Spigot's (or paper's) terrible GC that does nothing and stores everything in PS old gen memory so the server just numpties itself though.
2020-05-19 16:54:12 +01:00
Alexander Söderberg
123ca8efe9
Update more commands and add proper request timeouts 2020-05-19 17:33:59 +02:00
dordsor21
22c26fe962 Add PlotArea#getFlag 2020-05-19 13:07:50 +01:00
dordsor21
761803f777 Add option for roads to respect a plot area's flags and implement to PlayerEvents 2020-05-19 12:41:51 +01:00
dordsor21
d5d18a60fb Fix #2836
getCompoundTag can also be in Core since we're using WorldEdit.
2020-05-19 11:53:18 +01:00
Alexander Söderberg
37b065a097
Progress. 2020-05-19 00:28:52 +02:00
Alexander Söderberg
fdfc61cf97
Update username on async pre login event 2020-05-18 20:45:51 +02:00
Alexander Söderberg
31c84ab18f Basic pipeline setup 2020-05-18 00:22:34 +02:00
Alexander Söderberg
a47527857c Fix wonky annotation placement in SQLiteUUIDService 2020-05-17 23:58:39 +02:00
Alexander Söderberg
12f2cb0d58 Add a cache uuid service 2020-05-17 23:57:40 +02:00
Alexander Söderberg
67bf90e92f Create the SQLite UUID service and cache 2020-05-17 23:41:59 +02:00
Alexander Söderberg
b5f92f5003 Add sync catcher to the blocking pipeline methods 2020-05-17 23:26:19 +02:00
Alexander Söderberg
58989c9311 Add some missing methods to the pipeline 2020-05-17 23:20:36 +02:00
Alexander Söderberg
736004d88b
Don't fill in stacktrace for ServiceError 2020-05-17 18:03:04 +02:00
Alexander Söderberg
49f51f24f7
Don't loop services when all mappings have been found 2020-05-17 18:02:26 +02:00
Alexander Söderberg
95df62e59b
Add missing consumer API methods 2020-05-17 17:48:42 +02:00
Alexander Söderberg
64cfe240f9
Port OfflinePlayerUUIDService to the new system 2020-05-17 17:36:12 +02:00
Alexander Söderberg
29f2863cf4
Progress 2020-05-17 17:26:48 +02:00
Alexander Söderberg
792fa1f11d Improve design 2020-05-17 12:55:07 +02:00
Alexander Söderberg
7591c440c2 Begin working on the new UUID service API 2020-05-17 12:40:25 +02:00
Alexander Söderberg
c58309b385 Add { transitive = false } to HV 2020-05-16 21:37:14 +02:00
Alexander Söderberg
5ae70743b1 Always set the generator 2020-05-16 21:37:14 +02:00
Alexander Söderberg
29e0479081 Fix preset initialization 2020-05-16 21:37:14 +02:00
Alexander Söderberg
441a73839e Add /plot components 2020-05-16 21:37:14 +02:00
Alexander Söderberg
ff8f7a0867 Actually create the world managers 2020-05-16 21:37:14 +02:00
Alexander Söderberg
31edffcb63 Begin working on a platform specific world management system
This should make world management a fair bit cleaner
2020-05-16 21:37:14 +02:00
NotMyFault
5442d43918
Update bug-issue-report-for-plotsquared.md 2020-05-15 16:46:47 +02:00
NotMyFault
25d4d23958
5.11.2 2020-05-14 23:15:08 +02:00
Alexander Söderberg
86edb20c15
Add a FAWE/WE chart 2020-05-14 16:33:26 +02:00
Alexander Söderberg
3d30885daf
No PlotSquared-Core-Core 2020-05-14 15:47:25 +02:00
dordsor21
194c5aa27b Merge branch 'v5' of https://github.com/IntellectualSites/PlotSquared into v5 2020-05-14 14:45:33 +01:00
dordsor21
20c487238a PlotSquared-Core please 2020-05-14 14:45:27 +01:00
Alexander Söderberg
6814b4bef2
Fix Core archive name 2020-05-14 15:24:43 +02:00
dordsor21
e1a25907f2 Merge branch 'v5' of https://github.com/IntellectualSites/PlotSquared into v5 2020-05-14 14:19:37 +01:00
dordsor21
5f896dd39a Properly copy NBT data in containers 2020-05-14 14:19:33 +01:00
Alexander Söderberg
f4729310fa
Include the core dependency in the Bukkit module 2020-05-14 14:52:43 +02:00
Alexander Söderberg
2f02f4392a
Fix names of shaded jars 2020-05-14 14:51:23 +02:00
Alexander Söderberg
b7f708dcd6
Fix gradle config 2020-05-14 14:32:20 +02:00
Alexander Söderberg
501fd9c8e6
Merge remote-tracking branch 'origin/v5' into v5 2020-05-14 14:16:17 +02:00
Alexander Söderberg
7ba7df5cb2
Make the upload task work 2020-05-14 14:16:10 +02:00
dordsor21
9dd9201b67 Allow plot auto from non-plot areas if the server has only one plot area 2020-05-14 13:10:53 +01:00
dordsor21
8fb9f29ab7 Fixes #2827
If existing blocks are an instance of container, clear the inventory.
2020-05-14 12:57:26 +01:00
Alexander Söderberg
dd852801cc
Merge pull request #2825 from IntellectualSites/tile-entity-cap
Fix chunk processing
2020-05-14 13:18:19 +02:00
Alexander Söderberg
1fa41e6209
Merge branch 'v5' into tile-entity-cap 2020-05-14 13:17:41 +02:00
dordsor21
a2db2e8268 Add return 2020-05-14 11:27:35 +01:00
dordsor21
617abf89e6 Split ChunkManager to Chunk and Region Managers
- Having not chunk-specific code in ChunkManager felt wrong.
- Also allow FAWE to replace setbiome code
- Also improve performance (proper usage of chunk loading) for setbiome
2020-05-14 11:27:35 +01:00
dordsor21
98b4ceab7d Fix style.yml 2020-05-13 16:29:10 +01:00
Alexander Söderberg
86a996b2ff
Make the tile entity check true by default, as it only applies when the chunk processor is enabled (and it's disabled by default) 2020-05-13 15:09:00 +02:00
Alexander Söderberg
e6a9daf31a
Make the tile entity limit in ProcessedWEExtent apply per chunk rather than per edit 2020-05-13 14:54:54 +02:00
Alexander Söderberg
8c0f7b207e
Make the chunk listener NOT delete all tile entities in the chunk 2020-05-13 14:39:58 +02:00
Alexander Söderberg
ec347f8738
Add missing blocks and block tile entities from /plot set if the chunk processor is enabled 2020-05-13 14:24:04 +02:00
Alexander Söderberg
19fe2efb6e
Fix the WE extent and add our own tile entity list 2020-05-13 14:11:17 +02:00
Alexander Söderberg
e6878d7804
clean up ProcessedWEExtent 2020-05-13 12:47:52 +02:00
Alexander Söderberg
435d877262
Make the tile entity check respect the chunk processor status 2020-05-13 12:25:48 +02:00
Alexander Söderberg
3deff629b0
Add paper specific listener for limiting the amount of tile entities in a chunk during build, instead of just doing it during chunk unloading 2020-05-12 23:01:14 +02:00
dordsor21
a038cb6d1b Merge branch 'v5' of https://github.com/IntellectualSites/PlotSquared into v5 2020-05-12 18:53:57 +01:00
dordsor21
637dd7d0c2 correct update messaging 2020-05-12 18:53:26 +01:00
Alexander Söderberg
d20fa39cf5
Add flag that prevents people from copying NBT data in the plot unless they're added as members 2020-05-12 19:25:06 +02:00
Aurélien
be6910d5d9 Reformated and update French translation
Some of my translations used '' to represent ' but it's not needed. Also splited some long lines and translated new backup system and keep-inventory flag.
2020-05-12 17:29:32 +02:00
Hannes Greule
2d6a5a3804
Update download link 2020-05-12 15:16:51 +02:00
NotMyFault
630e81fbfb
5.11.1 2020-05-12 13:42:24 +02:00
Alexander Söderberg
6488aafd9d
Version bump 2020-05-12 12:56:18 +02:00
Alexander Söderberg
4ad90d423d
Fix timeout comment 2020-05-12 12:52:45 +02:00
Alexander Söderberg
d2dae45082
Add leaves to the blacklist 2020-05-12 12:49:39 +02:00
Alexander Söderberg
85c9bd7ceb
Add all sign type to blacklist 2020-05-12 12:24:36 +02:00
dordsor21
d0ee579069 Move backup config section to a more appropriate place 2020-05-12 10:44:34 +01:00
Alexander Söderberg
10dbcbcdbd Prevent NPE in entityDamage
This is done by creating a fake (WE) entity type in the case that the entity type name is null. In these cases, WE has no equivalent.

By doing this, all entity category contains check will fail, and it will default to the PVE check at the bottom of the if-else if chain.
2020-05-12 10:05:47 +02:00
Alexander Söderberg
e8dd5fe903
Merge pull request #2816 from IntellectualSites/backups
Plot backup system
2020-05-12 09:40:25 +02:00
Alexander Söderberg
32c23e6ced
Merge branch 'v5' into backups 2020-05-11 22:27:16 +02:00
Alexander Söderberg
81aaba328a
ENGLISH > ROOT 2020-05-11 22:21:37 +02:00
Alexander Söderberg
3c5dd3d0d2
Merge remote-tracking branch 'origin/v5' into v5 2020-05-11 22:11:29 +02:00
Alexander Söderberg
2dc07d9321
Add a looooot of default disallowed blocks 2020-05-11 22:11:21 +02:00
N0tMyFaultOG
841dd5e189 Update wiki links 2020-05-11 20:27:06 +02:00
Alexander Söderberg
b2bc2887d2
Fix dumdum merge 2020-05-11 20:17:41 +02:00
Alexander Söderberg
e20319f4e1
Merge branch 'v5' into backups
# Conflicts:
#	Core/src/main/java/com/plotsquared/core/configuration/Captions.java
2020-05-11 20:15:48 +02:00
Alexander Söderberg
d40160d205
Fix javadoc 2020-05-11 20:04:22 +02:00
Alexander Söderberg
f7167d5e83
Fix typo 2020-05-11 20:03:26 +02:00
Alexander Söderberg
282773a43f
Replace Guava methods with stdlib equivalents 2020-05-11 20:02:33 +02:00
Alexander Söderberg
8944be5319
(Complex) command suggestions for /plot set 2020-05-11 19:37:25 +02:00
Alexander Söderberg
df01f9bea7
Add a list of blocks that cannot be used in /plot set <component> 2020-05-11 18:35:06 +02:00
Alexander Söderberg
3c17b76b1c
Remove dum-dum line break 2020-05-11 11:21:32 +02:00
Alexander Söderberg
7a6909dab1
Merge branch 'v5' into backups 2020-05-11 11:19:59 +02:00
Alexander Söderberg
3064ae80d1
Add a keep-inventory flag 2020-05-11 11:19:36 +02:00
dordsor21
06bb6856a8 Fix bad getApplicablePlotArea(Location) code
- Fixes #2815 alongside 667098268f2ce78e79c9f0dd3c7f27c41e8bf462
2020-05-11 09:48:18 +01:00
Alexander Söderberg
702caa6feb
Remove rogue line break 2020-05-10 22:09:56 +02:00
Alexander Söderberg
fc74c582bf
Add option to disable deletion of plot backups when the plot is unclaimed 2020-05-10 21:52:57 +02:00
Alexander Söderberg
658361f825
Destroy backups when the plot is uncalimed 2020-05-10 21:31:16 +02:00
Alexander Söderberg
e0c9a802d8
Add automatic backups and implement them /plot clear and /plot set <component>. 2020-05-10 20:31:07 +02:00
Alexander Söderberg
c4a70c0945
Fix tab completion for the backup command 2020-05-10 19:42:42 +02:00
Alexander Söderberg
f7d6ac00e4
Make the backup commands work 2020-05-10 19:20:11 +02:00
Alexander Söderberg
8ed5a21b36
Merge branch 'v5' into backups 2020-05-10 17:03:36 +02:00
N0tMyFaultOG
773a993ee1 Merge branch 'remove-eol-translation-strings' into v5 2020-05-10 17:02:13 +02:00
Alexander Söderberg
6fb63c9609
Implement backup restoration command. This might work, idk, we'll see. 2020-05-10 16:53:19 +02:00
Alexander Söderberg
079289eb74
Use #getTranslated on GENERIC_UNOWNED 2020-05-10 16:40:12 +02:00
Alexander Söderberg
59f96d4455
Translate all backup failure reasons 2020-05-10 16:39:14 +02:00
Alexander Söderberg
cdab52fcbe
dumdum space go bye bye 2020-05-10 16:04:33 +02:00
Alexander Söderberg
63c9037b10
Fix typo 2020-05-10 16:00:20 +02:00
Alexander Söderberg
bbc86eba39
/plot debug progress 2020-05-10 15:51:27 +02:00
Alexander Söderberg
e0fb6f5440
/plot debug structure 2020-05-10 15:36:20 +02:00
Alexander Söderberg
2bd30af361
Cache both backup profiles and backup objects 2020-05-10 15:12:17 +02:00
NotMyFault
b136f44f12
Merge branch 'v5' into remove-eol-translation-strings 2020-05-10 15:05:58 +02:00
Alexander Söderberg
d0dbb495b0
Add BackupProfile#restoreBackup 2020-05-10 14:58:45 +02:00
Alexander Söderberg
8715a27a93
No backups for merged plots 🐮 2020-05-10 14:41:02 +02:00
Aurélien
503fc44208 Updated according to new translations and old removed 2020-05-10 14:12:56 +02:00
Aurélien
d3bfaeb5a4 Ready for merging !
Removed useless space at the end of the file + precision of the date (latest edition)
2020-05-10 14:12:56 +02:00
Aurélien
7adecd0808 Last fix (removed unused translation + added the missing) 2020-05-10 14:12:56 +02:00
Aurélien
c99e081ae0 Fiexed issues reported by CodeFactor 2020-05-10 14:12:56 +02:00
Aurélien
285b6bf62d Updated and corrected French translation
Old translation has been reviewed and new v5 flags' translations has been added.
Some mistakes could now remain, I will fix them if needed ;)
Enjoy !
2020-05-10 14:12:56 +02:00
Alexander Söderberg
723e29cdd0
Continue working on the backup system 2020-05-10 14:02:25 +02:00
dordsor21
667098268f Almost fix slime pathing?
This almost works, there's no real way to do it gracefully because you can't set where the slime should be travelling to nicely, nor can you set rotation etc. Seems to be a fairly large part of the event capability missing from paper.
2020-05-10 12:18:55 +01:00
dordsor21
e6408b35a2 fix merge auto 2020-05-10 10:44:14 +01:00
Alexander Söderberg
3eb0de68c4
Begin working on the structure for the backup system 2020-05-09 20:05:39 +02:00
N0tMyFaultOG
dd1b944205 Update gradle and remove license header from gradle 2020-05-09 16:47:49 +02:00
N0tMyFaultOG
ae11f0610e Add a few more translation strings for setup wizard 2020-05-09 16:45:32 +02:00
dordsor21
55fc963673 5.10.6 2020-05-09 13:19:29 +01:00
N0tMyFaultOG
198c7ca58d Remove dead translations 2020-05-09 14:04:08 +02:00
Hannes Greule
5a2f70238a Typo 2020-05-06 12:53:27 +01:00
Hannes Greule
8257b0b563 No lazy init when calling toString,equals or hashCode
That prevents premature initialization as NullBlockCategory
2020-05-06 12:53:27 +01:00
Hannes Greule
9b997d2195 Make constructor private 2020-05-06 12:53:27 +01:00
Hannes Greule
a19fa1b92c Send a debug message if category not found 2020-05-06 12:53:27 +01:00
Hannes Greule
2c060db9c0 Lazily initialize block tags 2020-05-06 12:53:27 +01:00
dordsor21
a8621a15ad Override setblock setting Pattern in ChunkBlockQueue
> Should stop NPE during plot analysis
> Without overriding this method, DelegateLocalBlockQueue setblock Pattern is called
> DelegateLocalBlockQueue's setblocks use parent.setBlock, but we set that to null in ChunkBlockQueue
> ChunkBlockQueue is simply just to cache the values from generation to use in analysis
> Therefore there is no need to setblocks in any other Queue implementation
2020-05-06 12:53:16 +01:00
dordsor21
179e9e1e74 Clean up plot grants and plot auto
- Correct maths for calculating granted plots, etc etc
- Don't check if the player has the correct number of plots AGAIN on AutoClaimFinishTask. That's dumb.
2020-05-06 11:39:34 +01:00
dordsor21
df5feff9ec Display the correct number of grants used in auto 2020-05-05 13:50:29 +01:00
dordsor21
9226aaff1f In the interest of debug should show everything, add debug when registering an unknown flag. 2020-05-05 12:57:14 +01:00
dordsor21
afe874a59b try-catch for NPE in purge and fail gracefully if the world is null
Plausible scenario since purge is often run to remove plots in the DB from removed worlds
Shouls fix #2806
2020-05-05 11:12:39 +01:00
N0tMyFaultOG
4ad9f12d5d Move plot version to debugpaste top 2020-05-04 23:58:01 +02:00
dordsor21
228c37815a Fix merge all
Fixes #2804
2020-05-04 17:15:53 +01:00
Alexander Söderberg
a37ab10414
Don't send chat spy to message sender 2020-05-03 18:13:54 +02:00
dordsor21
d73dbf0c81 5.10.5 2020-05-02 13:34:04 +01:00
dordsor21
daee26681a use strings for spawn reasons to be safe 2020-05-02 12:13:00 +01:00
dordsor21
729469e030 Add config options for all paper events. 2020-05-02 11:58:32 +01:00
dordsor21
c6dc9ee189 Add some more listeners
- Also use setShouldAbortSpawn so it doesn't just try forever
 - Add config to enable or disable all paper listeners
2020-05-02 11:58:32 +01:00
dordsor21
85a75ad868 Yeet that PaperSPiGoT out of here 2020-05-02 11:58:32 +01:00
dordsor21
8ec8b8d803 Add some paper-specific listeners 2020-05-02 11:58:32 +01:00
MeFisto94
d864792d09 Fixes #2800 Allow to wrap OfflinePlayers in 1.15.2 2020-05-02 11:28:06 +01:00
dordsor21
ed2e9a80ed Fix rare bug where if the plot size was less than 15 and the chunk contained an entire plot, it would generate incorrectly 2020-05-01 20:30:59 +01:00
dordsor21
36948ed351 Move world settings dump to a better location (where all of the fields will actually have been set) 2020-05-01 20:29:35 +01:00
dordsor21
e06429f3b0 Correct world types given to player 2020-05-01 19:18:11 +01:00
MattBDev
fd4a9a16de Execute commands when clicked for expire messages 2020-05-01 13:34:43 -04:00
NotMyFault
acba10ac09
Fix broken url 2020-05-01 17:00:55 +02:00
dordsor21
d6d49e0912 Show suffix in versionString() too 2020-05-01 15:56:35 +01:00
dordsor21
b5de5f30ac Allow suffixes to the version
- Useful for "PlotSquared-5.10.4-SNAPSHOT" etc
2020-05-01 15:53:40 +01:00
dordsor21
17698065a0 Add extra SpawnReasons to spawn listener 2020-04-30 17:00:35 +01:00
Alexander Söderberg
135c6f2c15 Send a less obnoxious message if the flag name length exceeds the maximum allowed length 2020-04-30 13:36:03 +02:00
dordsor21
a263fe2f2d Apparently we need to recover from bad flags 2020-04-30 12:15:42 +01:00
dordsor21
cbe46539ca Pick up the rest of the reformating 2020-04-30 11:53:07 +01:00
dordsor21
5e842f1572 Force flag names to be 64 characters or less
- A few people seem to be on interesting SQL installs. This should fix the issues they have with 767 bytes,
2020-04-30 11:52:39 +01:00
dordsor21
b56d4d0fea Merge branch 'reformat' into v5 2020-04-30 11:39:02 +01:00
dordsor21
42106bb97a I didn't get everything first time 2020-04-30 11:33:59 +01:00
dordsor21
e7216d4aef Merge branch 'v5' into reformat 2020-04-30 11:33:31 +01:00
dordsor21
0751e9cea3 Make LiquidFlowFlag an enum 2020-04-30 11:18:28 +01:00
dordsor21
0091580ae0 Reformat it all. 2020-04-30 11:01:52 +01:00
dordsor21
4a16f9c1a7 LiquidFlow true will override BlockPhysics false 2020-04-30 10:59:43 +01:00
N0tMyFaultOG
894d673c90 Fix tests 2020-04-30 11:32:50 +02:00
dordsor21
577fe3037f Update checker improvements and 5.10.4
- Add config option to disable poll once it's found an update (true by default)
 - Better PlotVersion stuff can now detect if you're using a later version than the spigot API, and not tell you about it
2020-04-30 10:17:19 +01:00
NotMyFault
53ca62e8fc
Bump version 2020-04-29 22:06:23 +02:00
NotMyFault
670f6d9f8b
Fix coral-dry flag not respecting horn coral blocks 2020-04-29 21:55:55 +02:00
dordsor21
8a21334e66 Merge branch 'v5' of https://github.com/IntellectualSites/PlotSquared into v5 2020-04-28 11:21:51 +01:00
dordsor21
a130d801d5 schem.intellectualsites.com (just forwards to athion.net but cnamed) 2020-04-28 11:21:30 +01:00
N0tMyFaultOG
51b6f41eff Update papi hook message 2020-04-25 23:54:30 +02:00
N0tMyFaultOG
a829799b36 Update scripting message 2020-04-25 23:53:46 +02:00
dordsor21
ccb43d0661 Do placeholders better.
- Still allow parsing of placeholder if no plot is required and plot is null.
- Properly check if the player is null before getting the plot, and if the plot is null
- These were still issues before my initial "fix" city
2020-04-23 14:16:06 +01:00
Hannes Greule
5bd53436df Prevent NPE for report comments 2020-04-23 13:44:34 +01:00
dordsor21
caa4a08b26 getOfflinePlayer once 2020-04-23 09:21:52 +01:00
dordsor21
0fa99d7940 Never return null in Placeholder. Also slight cleanup. 2020-04-23 09:06:37 +01:00
dordsor21
73dae7842d Only poll for updates every 30 mins.
- Don't do GET requests on player join (bad idea, it was sync...)
 - If there's an update it will notify the player still, it just caches the update status
2020-04-22 12:09:00 +01:00
dordsor21
92a18d810c Correct usage of Json.
I'm dumb and forgot toString doesn't work. Repalce with getAsString
2020-04-22 09:57:46 +01:00
dordsor21
591eb60a71 5.10.2
*bump version after resource update
2020-04-22 08:24:55 +01:00
dordsor21
9081a5aff6 Fix incorrectly formatted biomes in worlds.yml automagically 2020-04-22 08:22:14 +01:00
NotMyFault
8ff4566905
Change misleading information 2020-04-21 23:42:31 +02:00
N0tMyFaultOG
c8d8fb6aff Reformat premium information 2020-04-21 23:38:56 +02:00
N0tMyFaultOG
6da4994955 Enhance premium verification 2020-04-21 23:06:11 +02:00
N0tMyFaultOG
4780fcd534 Fixes #2782
Thanks for the contribution :)
2020-04-21 15:53:38 +02:00
dordsor21
5b30711470 Cant use bar chart 2020-04-21 12:39:48 +01:00
dordsor21
336f27f078 Only check update if premium. Add bstats bars for premium vs not. 2020-04-21 12:39:48 +01:00
dordsor21
92ef0d723b 5.10.1 2020-04-21 11:59:10 +01:00
dordsor21
ffee7a518e update default biome to match format WorldEdit accepts. 2020-04-21 09:16:02 +01:00
dordsor21
8d61e6f111 Fix update checker
- No more NPEs
 - Use the better spigot API
 - No obnoxious tooltip displaying the link without being clickable
2020-04-21 08:56:23 +01:00
dordsor21
67736bfbca git object is actually needed in Core build 2020-04-21 08:28:22 +01:00
dordsor21
84108b60c2 force version 2020-04-21 08:16:06 +01:00
Alexander Söderberg
59f8f2fdff
Fix biome setting in 1.13 and 1.14 2020-04-20 23:40:04 +02:00
Alexander Söderberg
5c6175badb
Merge remote-tracking branch 'origin/v5' into v5 2020-04-20 23:37:02 +02:00
Alexander Söderberg
8db8a30455
Fix biome setting 2020-04-20 23:36:56 +02:00
NotMyFault
cbe8fda1df
Fix update notification 2020-04-20 23:24:28 +02:00
N0tMyFaultOG
558df450b5 Update spigot updater 2020-04-20 21:04:30 +02:00
Cheezybo99
f1d10c96bc Added PERMISSIONS_ADMIN_CHAT_BYPASS enum for the permission plots.admin.chat.bypass allowing users to bypass the plot chat security feature. 2020-04-20 18:55:28 +02:00
Cheezybo99
4d1b08a628 Updated to properly use the permissions system from com.plotsquared.core.util.Permissions and com.plotsquared.core.configuration.Captions 2020-04-20 18:55:28 +02:00
Cheezybo99
2eda56bc1f If all players are denied from a plot, this will allow administrators with permission to see chatspy, talk in plots they have been denied from. 2020-04-20 18:55:28 +02:00
Alexander Söderberg
c391fee100
Merge pull request #2779 from lenis0012/v5
Use primite int type for setBiome 1.13 workaround
2020-04-20 18:53:55 +02:00
Alexander Söderberg
06d255ccc2
Create FUNDING.yml 2020-04-20 18:48:22 +02:00
Lennart ten Wolde
bb291b947f Use primite int type for setBiome 1.13 workaround 2020-04-20 17:27:46 +02:00
Alexander Söderberg
3c8b22688a
I'm dumb. 2020-04-19 21:24:45 +02:00
Alexander Söderberg
cdd1fad85c
Fix github link in debugpaste 2020-04-19 21:22:45 +02:00
Alexander Söderberg
ab6fd06657
Link to bStats 2020-04-18 23:22:05 +02:00
Alexander Söderberg
3bb32a5630
Add bStats stats to README 2020-04-18 23:21:01 +02:00
Alexander Söderberg
bf5862942a
Disable prefixes for flag info headers and footers and suppress NPE in the update utility 2020-04-18 22:26:13 +02:00
Alexander Söderberg
cbea595fa0
Don't relocate json-simple. 2020-04-18 21:14:44 +02:00
dordsor21
952ea0b090 Fix setowner none (unclaim) 2020-04-18 17:59:45 +01:00
dordsor21
af951ac11c Update upload to debug the content if incorrect properly. 2020-04-18 17:53:45 +01:00
dordsor21
165614efe9 make sure never to have unclaim be an alias of delete. Even if it doesn't work. 2020-04-18 17:44:01 +01:00
dordsor21
95335df84d Merge branch 'v5' of https://github.com/IntellectualSites/PlotSquared into v5 2020-04-18 17:22:58 +01:00
dordsor21
100861484a Fix plot claim. 2020-04-18 17:22:51 +01:00
N0tMyFaultOG
70eb588f1f Update issue template for v5/v3 support 2020-04-18 17:04:16 +02:00
Alexander Söderberg
c206de263b
Merge remote-tracking branch 'origin/v5' into v5 2020-04-18 02:28:29 +02:00
Alexander Söderberg
0c12972c03
Register misc-flags. 2020-04-18 02:28:11 +02:00
N0tMyFaultOG
546c4defb7 Add SirYwell to authors list
Thanks for all your hard work regarding v5 ❤️
2020-04-16 23:49:08 +02:00
N0tMyFaultOG
814fca3832 Update flag description 2020-04-16 19:15:40 +02:00
dordsor21
3ee29297e0 Add option to force plot chat in plot areas. 2020-04-16 16:55:14 +01:00
dordsor21
6d9d0fff10 Add description caption for chat flag 2020-04-16 12:49:00 +01:00
dordsor21
714b8dad87 Implement IntellectualSites/PlotSquaredSuggestions/96
Also make Plot Chat work properly. Not sure what was going on there before...
2020-04-16 11:54:32 +01:00
dordsor21
a44807d47b Don't dump biome array on /ps reload. Gradle also seems to want to change the Core pom. 2020-04-16 11:43:13 +01:00
Alexander Söderberg
4aac3bf7e4
Merge pull request #2757 from IntellectualSites/api/v5/packages
Package Restructure
2020-04-16 10:58:13 +02:00
Alexander Söderberg
ee2ed8222d
Merge config packages 2020-04-16 06:14:33 +02:00
Alexander Söderberg
edaf396894
Merge features/v5/internal-updates into api/v5/packages 2020-04-16 06:11:03 +02:00
Alexander Söderberg
6f052f0001
Remove extra line from HEADER 2020-04-16 05:05:58 +02:00
Alexander Söderberg
ba40a56c32
Add GPLv3 License headers to all source files. 2020-04-16 04:52:39 +02:00
MattBDev
780be3776a Addressed some comments 2020-04-15 15:26:54 -04:00
NotMyFault
98235b3fdc Merge remote-tracking branch 'origin/dependabot/gradle/features/v5/internal-updates/org.jetbrains.kotlin-kotlin-stdlib-1.3.72' into features/v5/internal-updates 2020-04-14 20:25:22 +02:00
dependabot-preview[bot]
f5a9abfc8d
Bump kotlin-stdlib from 1.3.61 to 1.3.72
Bumps [kotlin-stdlib](https://github.com/JetBrains/kotlin) from 1.3.61 to 1.3.72.
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-14 18:25:00 +00:00
dependabot-preview[bot]
a8619fe2ad
Bump asm from 7.3.1 to 8.0.1
Bumps asm from 7.3.1 to 8.0.1.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-14 18:23:48 +00:00
dependabot-preview[bot]
c812bb1295
Bump annotations from 18.0.0 to 19.0.0
Bumps [annotations](https://github.com/JetBrains/java-annotations) from 18.0.0 to 19.0.0.
- [Release notes](https://github.com/JetBrains/java-annotations/releases)
- [Changelog](https://github.com/JetBrains/java-annotations/blob/master/CHANGELOG.md)
- [Commits](https://github.com/JetBrains/java-annotations/compare/18.0.0...19.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-14 17:50:27 +00:00
Alexander Söderberg
4e7bcc788b
Merge pull request #2764 from IntellectualSites/features/v5/event-entity-categories
Features/v5/event entity categories
2020-04-12 23:21:47 +02:00
Alexander Söderberg
79bd69e599 Make the entity counting code use the new entity categories, remove usage of magic numbers and add /plot caps 2020-04-12 19:30:50 +02:00
Alexander Söderberg
5772af37fe Reclassify shulker as a hostile mob 2020-04-12 04:46:51 +02:00
Alexander Söderberg
6324bb1134 Use entity categories in events 2020-04-12 01:47:56 +02:00
Alexander Söderberg
658f2a3fc3 Finalize entity type categorisation 2020-04-12 01:23:13 +02:00
Hannes Greule
6e536f81ac Add more entity categories 2020-04-12 00:57:50 +02:00
Alexander Söderberg
dd9450d36a Add entity category loading code to WorldUtil (implemented in BukkitUtil) 2020-04-11 22:26:31 +02:00
Alexander Söderberg
8ef3a90ce0 Merge remote-tracking branch 'origin/features/v5/internal-updates' into features/v5/internal-updates 2020-04-11 21:49:15 +02:00
Alexander Söderberg
e6c76ad3f3 Entity categories implementation 2020-04-11 21:49:08 +02:00
Hannes Greule
4a249843eb Workaround to accept Slimes and EnderDragons as Monsters 2020-04-11 21:42:52 +02:00
Alexander Söderberg
5c1f0f51df Add a custom bStats chart tracking terrain types 2020-04-11 20:56:34 +02:00
Alexander Söderberg
2377ce1123 Relocate metrics properly 2020-04-11 19:52:45 +02:00
Hannes Greule
6f2b31f4a3 Add missing default flag values to GlobalFlagContainer (fixes #2748) 2020-04-11 18:49:04 +02:00
Alexander Söderberg
c5590440d6 Merge remote-tracking branch 'origin/features/v5/internal-updates' into features/v5/internal-updates 2020-04-11 17:58:27 +02:00
Alexander Söderberg
7931390ae4 Fix json relocation issue. Make plot areas dump their default flags and add progress output for flag conversion. 2020-04-11 17:58:08 +02:00
Alexander Söderberg
546b857b9d Fail default flag parsing gracefully 2020-04-11 17:19:43 +02:00
Alexander Söderberg
ce10d54a9c Don't use legacy IDs to get block types in the hybrid plot manager 2020-04-11 13:28:58 +02:00
Alexander Söderberg
965bbb9f3b Extract block queues from AugmentedUtils 2020-04-11 13:23:57 +02:00
Alexander Söderberg
e88b331155 Clean up AugmentedUtils and make the code readable by humans 2020-04-11 12:08:46 +02:00
Alexander Söderberg
ce177c3c46 Clean up HybridGen and make the code readable by humans
Previously it was only readable by androids, and Jesse.
2020-04-11 12:00:42 +02:00
Alexander Söderberg
5a6dbfda36 Fix javadoc generation issues 2020-04-11 03:23:48 +02:00
Alexander Söderberg
6c1caac731 Rename jar from BukkitAPI to Bukkit 2020-04-11 02:57:00 +02:00
Alexander Söderberg
9c3c42c3e6 Rename published maven artifacts
# Conflicts:
#	Bukkit/build.gradle
#	Core/build.gradle
2020-04-11 02:54:34 +02:00
Alexander Söderberg
5fc33dcc06 Rename published maven artifacts 2020-04-11 02:39:02 +02:00
Alexander Söderberg
c196ced0e2 Move org.json into core 2020-04-11 02:28:15 +02:00
MattBDev
dfa977a020 Moved more packaged based on feedback 2020-04-10 20:19:18 -04:00
MattBDev
5be2dfa747 Package Changes 2020-04-10 19:26:07 -04:00
Alexander Söderberg
f9ea99fa1d
Merge pull request #2754 from IntellectualSites/features/v5/owners
Remove all direct access to Plot.owner
2020-04-10 19:52:41 +02:00
Alexander Söderberg
79583c011f Replace getOwnerAbs() == null with !hasOwner() 2020-04-10 19:28:10 +02:00
Alexander Söderberg
172bcc7677 Revert "Replace getOwnerAbs() == null with hasOwner()"
This reverts commit 79620042
2020-04-10 19:22:12 +02:00
Alexander Söderberg
fa51cb94a3
Merge pull request #2755 from IntellectualSites/features/v5/licenses
Add GPLv3 License headers to all source files.
2020-04-10 19:14:14 +02:00
Alexander Söderberg
c2060ea1a7 Remove deprecation of getOwner() 2020-04-10 19:11:53 +02:00
Alexander Söderberg
7962004215 Replace getOwnerAbs() == null with hasOwner() 2020-04-10 19:10:43 +02:00
Alexander Söderberg
45476f2867 I missed AbstractDB somehow... 2020-04-10 18:15:35 +02:00
Alexander Söderberg
280ced7904 Add GPLv3 License headers to all source files.
Reason: "            How to Apply These Terms to Your New Programs

           If you develop a new program, and you want it to be of the greatest
         possible use to the public, the best way to achieve this is to make it
         free software which everyone can redistribute and change under these terms.

           To do so, attach the following notices to the program.  It is safest
         to attach them to the start of each source file to most effectively
         state the exclusion of warranty; and each file should have at least
         the "copyright" line and a pointer to where the full notice is found."
2020-04-10 18:09:01 +02:00
Alexander Söderberg
474795367e Reformat Plot after the owner changes. It was a bit too messy. 2020-04-10 14:07:52 +02:00
Alexander Söderberg
ce756411cf Remove all direct access to Plot.owner
New methods were added for access to the absolute owner of a plot, and the documentation of the owner getters to clarify the purpose of the methods.
2020-04-10 14:05:01 +02:00
MattBDev
bdba2b33fb Remove Nukkit and Sponge files from v5
We don't need these because they already exist in our git history and in the legacy branch.
2020-04-09 19:38:10 -04:00
Alexander Söderberg
0d26111fa7 Include golems (snowmen, iron golems and shulkers) in the animal-interact flag. 2020-04-09 21:38:24 +02:00
Alexander Söderberg
dada7dbb86 Use relocated org.json instead of including the source files 2020-04-09 17:41:55 +02:00
Alexander Söderberg
cb05d34d20 Fixes #2751 2020-04-09 17:07:14 +02:00
Alexander Söderberg
7c25c60252
Merge pull request #2743 from IntellectualSites/features/v5/async-load
Prevent synchronous chunk loading whenever possible
2020-04-09 15:09:18 +02:00
Alexander Söderberg
86149224d1 Don't set walls, wall filling or outline in plots using full vanilla terrain generation 2020-04-09 13:06:45 +02:00
Alexander Söderberg
f717589074 Fix typo in MainUtil and switch out Consumer<Integer> to IntConsumer 2020-04-09 11:23:39 +02:00
Alexander Söderberg
254a0541cc Fix OfflinePlayerUtil runtime exception 2020-04-08 22:52:13 +02:00
Alexander Söderberg
271109a726 Fix dumdum async getLoadedChunks call, but only because Aikar broke everything. 2020-04-08 21:49:41 +02:00
Alexander Söderberg
38de74c4ff Make sure PlayerEvents#logout is called 2020-04-08 17:53:11 +02:00
Alexander Söderberg
865d11e844 Register vehicle-place and make it disabled by default 2020-04-08 17:28:16 +02:00
Alexander Söderberg
ebba9a2290 Fix interval flags 2020-04-08 17:22:53 +02:00
Alexander Söderberg
bc45b8b695 Merge branch 'features/v5/internal-updates' into features/v5/async-load 2020-04-08 17:17:17 +02:00
Alexander Söderberg
7ac389b698 Fix block ignition location check 2020-04-08 17:15:17 +02:00
Alexander Söderberg
616d22ceac Fix liquid-flow 2020-04-08 17:01:41 +02:00
Alexander Söderberg
f6332d2cd9 Add tab completions to flyflag 2020-04-08 16:53:39 +02:00
Alexander Söderberg
4ca7a81e96 Fix untrusted-visit. 2020-04-08 16:52:10 +02:00
Alexander Söderberg
ae2867136a Make the fly flag an enum flag instead. It now accepts: true, false and default, where default is the default value, and does not change the flight status at all. 2020-04-08 16:39:19 +02:00
Alexander Söderberg
ef04ed9151 Fix augmented generation 2020-04-08 04:10:22 +02:00
Alexander Söderberg
1522632f5a Don't replace blocks if they have identical states already 2020-04-08 02:02:20 +02:00
Alexander Söderberg
be6bcafccc Make sure augmented generation doesn't crash the server 2020-04-08 01:23:22 +02:00
Alexander Söderberg
5d332e7d58 Fix plot clearing in normal plot worlds 2020-04-08 00:01:58 +02:00
Alexander Söderberg
283ff945f3 Fix /plot auto performance and remove sign-guessing 2020-04-07 23:39:56 +02:00
Alexander Söderberg
0d4af3023d Extract TaskManager lambdas for better debugging 2020-04-07 23:18:36 +02:00
Alexander Söderberg
7fdb7961ce Merge branch 'features/v5/internal-updates' into features/v5/async-load 2020-04-07 22:13:42 +02:00
Alexander Söderberg
e161209a46 Fix plot claiming 2020-04-07 22:12:52 +02:00
Alexander Söderberg
5e2e4a8631 Revert testCreate change 2020-04-07 21:43:32 +02:00
Alexander Söderberg
e4a6bd0ca5 Don't try to remove players. Fixes #2742. 2020-04-07 20:56:43 +02:00
Alexander Söderberg
5547185b3f Prevent synchronous chunk loading whenever possible 2020-04-07 20:19:39 +02:00
dordsor21
7841ee3dcc Fix a few encapsulate merge issues 2020-04-02 13:40:11 +01:00
Hannes Greule
099a680c85
Encapsulation and Magic Values (#2711)
* Encapsulate attributes of PlotArea using lombok Getters/Setters

* Limit access to collections, don't expose implementation details

* Better naming for some boolean attributes

* Replace magic type value with PlotAreaType enum

* Replace magic terrain value with PlotAreaTerrainType enum

* Fix remaining rebase conflicts

* Reduce code duplication

Co-authored-by: Alexander Söderberg <Sauilitired@users.noreply.github.com>
2020-04-02 13:34:38 +01:00
dordsor21
9764d4d226 Actually add biomes to road schematics 2020-03-28 10:43:24 +00:00
NotMyFault
37336fffe2 Merge branch 'features/v5/internal-updates' of https://github.com/IntellectualSites/PlotSquared into features/v5/internal-updates 2020-03-28 02:26:25 +01:00
NotMyFault
a285404847 Update gradle, actions and fix typo in branch 2020-03-27 23:44:17 +01:00
dordsor21
2994b2c158 Use try with resource to close ClipboardReader and stop adding "atic" to schematic files or not reason 2020-03-26 20:55:27 +00:00
NotMyFault
3a3a06631d Add coral-dry flag 2020-03-25 21:14:58 +01:00
dordsor21
f9bf576d2e Actually initialise the biome array in HybridPlotWorlds.
Fixes generation using schematics (and allows generation using biomes in schematics for roads and plots....)
2020-03-25 17:46:08 +00:00
dordsor21
f2f7fbce09 Allow trusted users to use /plot set 2020-03-25 11:01:19 +00:00
dordsor21
412a3ee344
Support v2 schematics properly. No 3D biomes are supported by it as yet. (#2716) 2020-03-24 09:08:56 +01:00
dordsor21
2f4eea118a
add clear option to /ps purge (#2714) 2020-03-24 09:08:32 +01:00
dordsor21
7310506ed4
Add option to have road regeneration be persistent across restarts. (#2715)
* Add option to have road regeneration be persistent across restarts.

* Use int[] not Integer[]. There's the possibility of large arrays given the size of some worlds.

* Correctly close Input/Output streams with try-with-resource.
Also don't try to ObjectOutputStream if an existing file hasn't actually been deleted.
2020-03-22 19:23:35 +00:00
dordsor21
26b5ee7482 Merge branch 'features/v5/internal-updates' of https://github.com/IntellectualSites/PlotSquared into features/v5/internal-updates 2020-03-20 12:12:30 +00:00
dordsor21
58280a20a8 Log don't debug on regenallroad completion 2020-03-20 12:11:39 +00:00
dordsor21
3d47d7e73f
Use worldedit to regenerate chunks. (#2708)
* Use worldedit to regeneration chunks. It's very slow, but it works.

* Use the AutoClose-ness of EditSession
2020-03-20 13:05:13 +01:00
Alexander Söderberg
d9f9d7dc34
Features/v5/event results (#2706)
* Begin events rewrite using Guava EventBus:
- moved events to within core
- removed BukkitEventUtil
- EventUtil in core is now the implementation
- Refactor any event calls

TODO:
- Test :)
- Implement changes to PlotSquared's own listeners
- Other

* Correct code style for annotations and refactor EventUtil to EventDispatcher

* Make getEventResultRaw default method and remove empty PlotEventListener file

* not raw map

* Remove PlotPlusListener

* Add listener registration to PlotAPI. Add documentation and refactor Result enum

* Add reason for the Event Result. Change how the claim event is called
TODO: better auto event somehow. Possible re-write of auto required..?

* Implement changes to events properly
Add PlayerAutoPlotEvent
Add PlotDoneEvent
Add schematic variable to Claim event and allow it to be changed
Add reason for plot unlink to unlink event
Add pattern to component set event and allow it to be changed
Allow component of component set event to be changed
Add player to plot merge event

* Fix compile

* Correct formating

* Various cleanup
 - Correct formatting in places
 - Add feedback to Desc command cancellation
 - Correct use of flag API
 - Add FlagRemove event to flagcommand where required

* Replace reason with caption

* Switch colours in Event Deny caption

Co-authored-by: dordsor21 <dordsor21@gmail.com>
2020-03-15 12:22:49 +01:00
NotMyFault
4bcd926543 Update discord links 2020-03-09 23:50:22 +01:00
Alexander Söderberg
05626c2c8f
Features/v5/move swap fixes + some other important commits (comments, etc) (#2699)
* Use generics instead of the raw class

* Add Gradle wrapper verification

* Fix biome setting in versions prior to 1.15

* Fixes #2654

* Document area getters in PlotAreaManager, and replace y-value with z in the area contains check.

* Remove update notifications

* Remove unused dependencies

* Do not kick plot owners on "/p deny *"

* Do not kick any added players on /p deny *

* Allow redstone to be used in server plot with `redstone.disable-offline` enabled.

Potentially fixes #2613

* Disallow swapping ,erged plots

* Fix legacy converter.

* Fix blockbucket pattern generation

* Prevent pasting schematics onto merged plots.

* Cancel claim event correctly

* Revert "Cancel claim event correctly"

This reverts commit 0f786155
Further investigation required

* Fix plot swapping messing up owners. Fixes #2282

* Fix plot move

* Prevent plot swapping form changing the database unless the swap was successful.

* Update signs after swap.

* Only send move success message if the move was successful.

Co-authored-by: Matt <4009945+MattBDev@users.noreply.github.com>
Co-authored-by: NotMyFault <mc.cache@web.de>
Co-authored-by: Daniel <admin@hywse.eu>
Co-authored-by: Hannes Greule <SirYwell@users.noreply.github.com>
2020-02-28 22:15:04 +01:00
NotMyFault
30b83faab6
Fix plot downloading 2020-02-28 00:31:53 +01:00
Alexander Söderberg
9868648fcb
Pull/2693 (#2694)
* Commit WIP flag work.

* More ported flag types, and additions to the flag API.

* Make PlotFlag more generic to allow generic flag creation

* Pull Captions methods into a Caption interface.

* Port MusicFlag

* Port flight flag

* Port UntrustedVisitFlag

* Port DenyExitFlag

* Remove paper suggestion

* Make ListFlag lists immutable

* Update Flag containers. Add javadocs. Add missing methods.

* Port description flag

* Port greeting and farewell flags

* Port weather flag

* Move getExample implementation to BooleanFlag

* Port reserved flags

* Port all boolean flags.

* Remove unused flag types

* Invert liquid-flow flag

* Find the real (legacy) flag name

* Change NOITFY -> NOTIFY in Captions

* Make IntegerFlag extendable

* Port integer flags

* Update Flag command to current API state

* Begin remaking flag command

* Create DoubleFlag + extract common parsing stuff

* Supply arguments in flag parse exceptions

* Implement missing flag subcommands

* Update Flag command to current API state

* Implement PriceFlag

* Port deny-teleport

* Port gamemode flags

* Port BreakFlag

* Port PlaceFlag

* Port UseFlag

* Remove old unused flag constants

* Port blocked-cmds flag

* Fix entity util

* Port TimeFlag

* Use CaptionUtility for formatting

* Port keep flag

* Fix imports

* Reformat code

* Remove unused classes

* Fix MainUtil.java

* Remove FlagCmd

* Add flag info header and footer

* Comment out flag related stuff in SchematicHandler

* Remove FlagManager

* Finalize Plot.java

* Finalize PlotArea.java

* Finalize PlotListener

* Fix API issues

* Fix a bunch of compile errors

* Fix `/plot flag remove`

* Fix initialization of GlobalFlagContainer

* Apply API changes to events

* Update SQLManager to new API

* Invert default value for DenyExitFlag

* Replace flag.getValue().toString() with flag.toString()

* Make FlagContainer instance in Plot final

* Fix various command issues

* Clean up PlotSettings

* Don't show internal flags in flag list

* Fix `/plot flag add`

* Remove the info inventory as it's 100% broken

* Add plot info entries and fix up the default format

* Fix default flag state in Captions

* 781c200 part 2

* Fix odd grammar in captions

* Fix odd grammar in captions v2

* Add create table statements for plot_flags

* Remove old flag references in SQLManager

* Use the new plot_flags table

* Add tab completion to `/plot flag`

* Improve parse error handling

* Make flag permission check recognize parse exceptions

* Initial progress towards flag conversion

* Fix minor issues

* Don't validate flags during flag conversion

* Allow unrecognized flags to be parsed

* Filter out internal flags from command sugguestions

* Use the wrong caption when there's no plot description set

* Limit command suggestions for boolean flags

* Make blocktypelistflags accept blockcategories

* Require categories to be prefixed with '#' and fix some minor display issues

* Fix plot database conversion

* Update PlotFlagEvent.java

Updated return description

* Fix command annotation wrapping

* Add FLAG_UPDATE event for FlagContainer listeners

* Make getParentContainer nullable

* Document castUnsafe in FlagContainer

* Document FlagContainer constructors

* Add missing documentation to FlagContainer

* Document FlagParseException

* Fix wording in FlagContainer javadoc

* Document InternalFlag

* Document PlotFlag

* Minor changes

* Remove revisit comments

Co-authored-by: Hannes Greule <SirYwell@users.noreply.github.com>
Co-authored-by: NotMyFault <mc.cache@web.de>
Co-authored-by: Matt <4009945+MattBDev@users.noreply.github.com>
2020-02-24 18:42:02 +01:00
Alexander Söderberg
b99631f1bd Fix regen. Fixes #2692 2020-02-24 14:00:45 +01:00
Alexander Söderberg
6be26e8047 Also consider negative locations when cancelling liquid flow 2020-02-24 12:11:22 +01:00
Alexander Söderberg
c7de9379ad Prevent liquids from flowing out of block walls. Fixes #2598. 2020-02-24 11:47:52 +01:00
NotMyFault
86ea69b65e
Update README.md 2020-02-21 00:53:52 +01:00
NotMyFault
f2aa9dccd1 Revert "Remove unused code"
This reverts commit 6d779dad050cea295a3828985da26e7014460079.
2020-02-20 20:08:25 +01:00
Alexander Söderberg
464f5e09ae Allow all messages to be formatted by external formatters and add PAPI support 2020-02-20 16:03:17 +01:00
NotMyFault
17e4bde720 Update gradle version 2020-02-20 00:41:19 +01:00
NotMyFault
6d779dad05 Remove unused code
Or at least I made it unused lul
2020-02-20 00:39:32 +01:00
Alexander Söderberg
38d0cc1b29 Fix isPremium method 2020-02-20 00:05:55 +01:00
Alexander Söderberg
fc9a221127
Update BukkitMain.java
wiz is quick
2020-02-20 00:02:06 +01:00
NotMyFault
95394ec54f Add Premium verification 2020-02-19 23:55:43 +01:00
NotMyFault
a3759f93a2 Add placeholders 2020-02-16 20:33:24 +01:00
NotMyFault
2632283431 Move recent changes into 1 branch 2020-02-16 15:17:06 +01:00
NotMyFault
8a014e3ad5 Remove wiki generator and unnencessary comments from the settings 2020-02-16 15:08:02 +01:00
NotMyFault
1b3427837e Rename maven artifacts
Renaming the Core module artifact matchin its module name on GitHub, like the bukkit or nukkit module does.
Given that, it's more clear which maven artifact belongs to which module.
2020-02-16 14:42:27 +01:00
NotMyFault
b3c91d866b Lazy cherry-pick 5db1e73eae4b0d4628df8bbbc172670c42d96435 without merge conflics 2020-02-16 14:41:51 +01:00
Alexander Söderberg
10dd531cdb Remove paper suggestion 2020-02-16 14:38:33 +01:00
NotMyFault
6953187cac Add current + new version to update notification
And fix a little typo alongside bumping versioning to v5
2020-02-16 14:37:07 +01:00
NotMyFault
7b83f0146e Readd update notification permission implementation 2020-02-16 02:34:51 +01:00
NotMyFault
4ed108b5c0 Remove legacy auto updater (v3) 2020-02-16 01:36:24 +01:00
NotMyFault
24b6b23d25 Bind update notifications to spigot resource updates
The notification permission could be moved back into the other class, but well
2020-02-16 01:33:43 +01:00
NotMyFault
5ea03f12fb
Update issue template 2020-02-14 17:54:45 +01:00
MattBDev
99a53cb005 DoogiePC doesn't like trees 2020-02-12 18:57:42 -05:00
MattBDev
d7af409d01 Test another workaround 2020-02-12 18:21:23 -05:00
MattBDev
0304e98b00 Workaround for SPIGOT-5574 2020-02-12 15:42:31 -05:00
MattBDev
b16db904cc Removed unused class which should be unbreaking. 2020-02-11 17:09:36 -05:00
MattBDev
4b306d454b Fixed an error with the debug command and added @NotNull to generator methods 2020-02-11 17:06:58 -05:00
MattBDev
e53ea2377c Fixed #2671
Sort of fixed. I added an if statement to log and return if a certain condition is met. It is unclear if there will be more generation issues as a result.
2020-02-11 16:52:16 -05:00
MattBDev
f79f2ac29e Tweaks to the world generator 2020-02-11 16:16:56 -05:00
MattBDev
1516edbeca Update dependencies
Changed gradle to new group id and repository. Updated paper-api to 1.15.2
2020-02-11 15:25:42 -05:00
NotMyFault
54348d824c Update authors 2020-02-10 17:36:54 +01:00
NotMyFault
f32cb0c16e Merge remote-tracking branch 'origin/dependabot/gradle/v4/org.projectlombok-lombok-1.18.12' into v4 2020-02-10 17:18:02 +01:00
NotMyFault
4a03cb0701 Merge remote-tracking branch 'origin/dependabot/gradle/v4/org.ow2.asm-asm-7.3.1' into v4 2020-02-10 17:17:39 +01:00
dependabot-preview[bot]
76e25953b1 Bump lombok from 1.18.10 to 1.18.12
Bumps [lombok](https://github.com/rzwitserloot/lombok) from 1.18.10 to 1.18.12.
- [Release notes](https://github.com/rzwitserloot/lombok/releases)
- [Changelog](https://github.com/rzwitserloot/lombok/blob/master/doc/changelog.markdown)
- [Commits](https://github.com/rzwitserloot/lombok/compare/v1.18.10...v1.18.12)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-10 08:03:18 +00:00
NotMyFault
2f0bf97162 Fix displaying 1 player remove as players 2020-02-09 01:12:32 +01:00
Hannes Greule
d0b6badf09
Fix DebugClaimTest (#2667)
* Fix DebugClaimTest

* Remove code causing 3 database updates per plot + errors when using MySQL
2020-01-31 17:12:06 +00:00
NotMyFault
30f37e1e8b Update /plot info placeholders 2020-01-27 23:39:29 +01:00
NotMyFault
4e1c90bbcc Fixes space between names in plot info (Fixes #2675) 2020-01-27 23:06:42 +01:00
NotMyFault
c31c855952 Update gradle version to 6.1 2020-01-24 18:47:32 +01:00
NotMyFault
312b2ad1a8 Send the bStats ID 2020-01-24 18:10:19 +01:00
NotMyFault
0953b5627e Add bStats plugin version
bStats 1.7 requires plugins to have an ID to submit data.
2020-01-24 16:08:48 +01:00
Matt
57af89f1d0
Merge pull request #2652 from SynergyMC/breaking
Revert teleportation behavior to pre-4.400
2020-01-22 21:23:25 -05:00
NotMyFault
f71f481ff3
Compile against 1.15.2 2020-01-22 23:54:37 +01:00
NotMyFault
0ba31ed56b
Update dependencies fitting https pattern 2020-01-21 18:25:46 +01:00
NotMyFault
edc81bc668
Updated branch names for gh actions testing 2020-01-21 15:52:57 +01:00
NotMyFault
7797e33ec5
Update sponsors 2020-01-20 01:24:08 +01:00
NotMyFault
118adb42b9 add hungarian translation 2020-01-14 12:27:23 +01:00
dependabot-preview[bot]
2efe604b9b
Bump asm from 7.2 to 7.3.1
Bumps asm from 7.2 to 7.3.1.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-13 08:01:49 +00:00
NotMyFault
cadd0cd9b4
Merge pull request #2660 from IntellectualSites/feature/v4/wildcards-player-args
Improve "everyone" args and update a few command messages
2020-01-10 19:40:01 +01:00
NotMyFault
f3187a465c Oops 2020-01-10 19:38:38 +01:00
NotMyFault
6fe856c002 Merge remote-tracking branch 'origin/dependabot/gradle/v4/junit-junit-4.13' into v4 2020-01-10 19:06:22 +01:00
NotMyFault
9a626ea1de Deprecate metrics methods
Metrics are controlled via bstats config for some time now. The config option in settings.yml has already been deprecated in the past.
2020-01-10 14:18:38 +01:00
NotMyFault
026233b7e7 Update gradlew 2020-01-10 14:07:33 +01:00
NotMyFault
6ee9d91aef Update requriedTypes 2020-01-10 14:01:28 +01:00
NotMyFault
808a1ed703 Add wildcards to command args 2020-01-10 13:35:59 +01:00
NotMyFault
7142e9e0e3
deprecate metrics settings 2020-01-07 22:45:53 +01:00
dependabot-preview[bot]
66a2e5427e
Bump junit from 4.12 to 4.13
Bumps [junit](https://github.com/junit-team/junit4) from 4.12 to 4.13.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/master/doc/ReleaseNotes4.12.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.12...r4.13)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-06 07:40:34 +00:00
zombachu
3aa554c52b Implemented optional specification of teleport causes
This should have backwards-compatibility for any users of the API but would require an update from anything reimplementing (for whatever reason) the interfaces amended by this commit.
2020-01-02 18:29:12 -10:00
NotMyFault
4322f4c31d
Merge pull request #2649 from IntellectualSites/dependabot/gradle/v4/org.ajoberstar.grgit-4.0.1
Bump org.ajoberstar.grgit from 4.0.0 to 4.0.1
2020-01-03 01:24:18 +01:00
NotMyFault
33f8df3afe
Add teleport cooldown bypass permission to plugin.yml 2020-01-03 01:12:48 +01:00
NotMyFault
42a83b56c3
Add clarification of tp bypass permission node to settings.yml 2020-01-03 01:10:32 +01:00
zombachu
0f39df0e0b
Revert teleportation behavior to pre-4.400 2019-12-31 16:05:53 -10:00
zombachu
a17588199f
Merge pull request #1 from IntellectualSites/v4
Merge from upstream
2019-12-31 15:24:42 -10:00
dependabot-preview[bot]
fad835c029
Bump org.ajoberstar.grgit from 4.0.0 to 4.0.1
Bumps org.ajoberstar.grgit from 4.0.0 to 4.0.1.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-30 14:32:48 +00:00
NotMyFault
568e9537ec Bump WorldEdit version to 7.0.1 2019-12-27 17:33:52 +01:00
NotMyFault
58bb0509f7 Bump gradle version to 6.0.1 2019-12-27 17:01:17 +01:00
NotMyFault
0ad2682210 Add update and jvm flags to debugpaste 2019-12-27 16:53:38 +01:00
NotMyFault
f97e52ea0b
Fixes building against 1.15 2019-12-25 10:40:54 +01:00
Jesse Boyd
4c90523121
use 1.15 spigot 2019-12-25 02:39:41 +00:00
Traks
519d3ee2d6 Fix 'Unable to find method createTag' on 1.15 servers (#2642)
* Fix 'Unable to find method createTag' on 1.15 servers (#2629)

Mojang apparently refactored their NBT code in 1.15, so the NBT
parsing code in NbtFactory that used Mojang's NBT code via Reflection
broke. Since PlotSquared now depends on WorldEdit, it is much easier
to use their NBT parsing library than to update the Reflection-based
code.

* Clean up NBT streams properly
2019-12-23 20:35:37 +00:00
Alexander Söderberg
3abb35e506 Prevent NPE when trying to set statement = null in SQLManager
If the statement is null, the `isClosed` check will lead to a NPE. As it's going to be null either way, just ignoring the NPE has no side effects.
2019-12-20 18:01:36 +01:00
Alexander Söderberg
c6e36fd70e Fix plot biomes.
When migrating to the WorldEdit Biome types, code was not altered to account for these changes. This lead to configuration parsing breaking, and the `/plot setbiome` command no longer functioning. This fixes #2599.
2019-12-20 17:37:48 +01:00
Jesse Boyd
ccc7b0ec65
Fix #2634 no such method error 2019-12-20 06:03:23 +00:00
Matt
4d1d3a165c
Merge pull request #2635 from traksag/interact-fix
Fix interact handling for sneaking players
2019-12-18 22:23:42 -05:00
Traks
e54cf24248 Fix interact handling for sneaking players 2019-12-18 19:42:57 +01:00
Matt
7103969bba
Merge pull request #2634 from traksag/hanging-fix
Fix that players cannot place hanging entities
2019-12-18 12:37:47 -05:00
Traks
3bb40a8fff Fix that players cannot place hanging entities 2019-12-17 21:04:44 +01:00
MattBDev
f4dcc9e786 Merge remote-tracking branch 'origin/breaking' into breaking 2019-12-15 13:08:27 -05:00
MattBDev
9fd29b264e Some logging operations to check for tps loss. 2019-12-15 13:08:02 -05:00
MattBDev
478c761750 More PlayerEvent fixes. 2019-12-15 12:53:16 -05:00
NotMyFault
dbd6feed4e Update issue template and add link to suggestion repo on issue tab 2019-12-14 18:05:15 +01:00
NotMyFault
480c9f11b8
Add 1.15 to templates 2019-12-14 17:46:07 +01:00
MattBDev
ed8fa0a2a5 Revert changes to BlockPlaceEvent 2019-12-10 17:53:55 -05:00
MattBDev
3af05e7960 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-12-09 14:44:16 -05:00
MattBDev
07b6942690 Minor code tweaks 2019-12-09 14:43:53 -05:00
dependabot-preview[bot]
7d8a5213dd Bump okio from 2.2.2 to 2.4.1
Bumps [okio](https://github.com/square/okio) from 2.2.2 to 2.4.1.
- [Release notes](https://github.com/square/okio/releases)
- [Changelog](https://github.com/square/okio/blob/master/CHANGELOG.md)
- [Commits](https://github.com/square/okio/compare/2.2.2...2.4.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-07 19:34:28 +01:00
NotMyFault
241589fdb0 Revert "Bump retrofit from 2.4.0 to 2.6.2"
This reverts commit 1097f44febe5ce82e85e96a9e11fda4a74e3057e.
2019-12-07 18:56:43 +01:00
dependabot-preview[bot]
eb09e0a633 Bump okhttp from 3.12.0 to 4.2.2
Bumps [okhttp](https://github.com/square/okhttp) from 3.12.0 to 4.2.2.
- [Release notes](https://github.com/square/okhttp/releases)
- [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/square/okhttp/compare/parent-3.12.0...parent-4.2.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-07 18:49:39 +01:00
dependabot-preview[bot]
4e2c90e399 Bump gson from 2.8.0 to 2.8.6
Bumps [gson](https://github.com/google/gson) from 2.8.0 to 2.8.6.
- [Release notes](https://github.com/google/gson/releases)
- [Changelog](https://github.com/google/gson/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/gson/compare/gson-parent-2.8.0...gson-parent-2.8.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-07 18:48:37 +01:00
dependabot-preview[bot]
1097f44feb Bump retrofit from 2.4.0 to 2.6.2
Bumps [retrofit](https://github.com/square/retrofit) from 2.4.0 to 2.6.2.
- [Release notes](https://github.com/square/retrofit/releases)
- [Changelog](https://github.com/square/retrofit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/square/retrofit/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-07 18:47:38 +01:00
dependabot-preview[bot]
e5423b5e08 Bump kotlin-stdlib from 1.3.50 to 1.3.61
Bumps [kotlin-stdlib](https://github.com/JetBrains/kotlin) from 1.3.50 to 1.3.61.
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v1.3.61/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v1.3.50...v1.3.61)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-07 18:41:32 +01:00
dependabot-preview[bot]
4ba5b6da1d Bump annotations from 17.0.0 to 18.0.0
Bumps [annotations](https://github.com/JetBrains/java-annotations) from 17.0.0 to 18.0.0.
- [Release notes](https://github.com/JetBrains/java-annotations/releases)
- [Commits](https://github.com/JetBrains/java-annotations/compare/17.0.0...18.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-07 18:37:56 +01:00
dependabot-preview[bot]
c1a7844f4a Bump lombok from 1.18.8 to 1.18.10
Bumps [lombok](https://github.com/rzwitserloot/lombok) from 1.18.8 to 1.18.10.
- [Release notes](https://github.com/rzwitserloot/lombok/releases)
- [Changelog](https://github.com/rzwitserloot/lombok/blob/master/doc/changelog.markdown)
- [Commits](https://github.com/rzwitserloot/lombok/compare/v1.18.8...v1.18.10)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-07 18:36:45 +01:00
dependabot-preview[bot]
781a4d8d78 Bump org.ajoberstar.grgit from 3.1.1 to 4.0.0
Bumps org.ajoberstar.grgit from 3.1.1 to 4.0.0.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-07 18:35:23 +01:00
NotMyFault
3ba29583fc Add all colors to style.yml
For further releases , we should aim to get a rid of the styles.yml and $ codes. I've seen a lot of people struggling with them, and if you want to use other formatting codes, you need to yamlize the non yamlized messages, otherwise it won't work properly.
2019-12-07 17:40:15 +01:00
MattBDev
7760631751 Remove deprecated method from Captions.java 2019-12-06 21:18:56 -05:00
MattBDev
05d6d557b8 Merge remote-tracking branch 'origin/breaking' into breaking 2019-12-06 21:16:19 -05:00
MattBDev
9925a320f5 Fix event listeners 2019-12-06 21:16:09 -05:00
NotMyFault
dca5d84d29 Fixes #2620 2019-12-06 00:28:07 +01:00
NotMyFault
0b470f8e01
Update links 2019-12-04 20:11:05 +01:00
MattBDev
7e58f4341e Minor fixes and performance improvement 2019-12-02 17:07:57 -05:00
MattBDev
d8933afb50 Merge remote-tracking branch 'origin/breaking' into breaking 2019-11-28 21:50:31 -05:00
MattBDev
4bb45fc220 Replace ByteArrayUtilities code with Guava and Replace PlotGameMode with WorldEdit equivalent. 2019-11-28 21:50:21 -05:00
NotMyFault
09f913cba4 Enhanced Fixes #2595
Updating messages and adding new strings that fit better.
2019-11-28 19:02:58 +01:00
MattBDev
006d730185 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-11-26 18:00:44 -05:00
Jesse Boyd
cf558d8f62
Update DebugPaste.java 2019-11-25 22:40:50 +00:00
Jesse Boyd
a65d546f3b
Fix debugpaste split 2019-11-25 22:38:03 +00:00
Jesse Boyd
bf02c9fe5f
Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-11-25 22:37:39 +00:00
NotMyFault
6908b9f29b
Update bug-issue-report-for-plotsquared.md 2019-11-24 19:30:37 +01:00
Jesse Boyd
cd06dbc915
Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-11-22 16:12:01 +00:00
Jesse Boyd
977dfa807f
potentially fix partial world auto 2019-11-22 16:11:48 +00:00
NotMyFault
8b7e8ec635
Update bug-issue-report-for-plotsquared.md 2019-11-22 15:52:25 +01:00
NotMyFault
c14e1d7add Update Settings.java 2019-11-22 12:40:27 +01:00
NotMyFault
7377366372 Updating some debug colors 2019-11-22 12:28:34 +01:00
Jesse Boyd
9c9841663a
Fixes #2595 (leave error) 2019-11-19 01:39:51 +00:00
MattBDev
612e96201c Fixed ItemTypeListFlag issue 2019-11-18 13:43:16 -05:00
MattBDev
d7aa4a0e1f Revert "Fix some flag issues"
This reverts commit 8b741477
2019-11-18 13:41:46 -05:00
MattBDev
8b7414770f Fix some flag issues 2019-11-18 11:09:32 -05:00
Jesse Boyd
a26ede4dae
Typo 2019-11-14 12:54:02 -08:00
Jesse Boyd
7591770c40
Update README.md 2019-11-14 12:48:41 -08:00
Jesse Boyd
7623698a00
don't use legacy ids here 2019-11-12 22:31:02 +00:00
Jesse Boyd
f518c47e09
Fixes #1922 Banned people can still "talk" in plot 2019-11-12 20:52:14 +00:00
Jesse Boyd
c23086259d
Potentially fixes rename issues
#2450
2019-11-12 20:48:33 +00:00
Jesse Boyd
765a021ecd
Some flag fixes
Use ItemType for the flags, since they accept items, not blocks.
Fixes #2571
2019-11-12 20:38:18 +00:00
Alexander Söderberg
7e21107120
Update README.md
Include information about what the project is. The previous README assumed that the reader would already be familiar with the concept, which isn't really ideal for a project description. The added text is taken from the Spigot resource page.
2019-11-12 10:20:46 +01:00
Jesse Boyd
322e186c4b
Ignore invalid blocks 2019-11-12 07:32:05 +00:00
Jesse Boyd
59b8776814
Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-11-11 20:39:44 +00:00
Jesse Boyd
5bb7069c7f
Fixes #2571 2019-11-11 20:39:28 +00:00
NotMyFault
1a2c15684e
Fixed typo 2019-11-11 21:39:27 +01:00
NotMyFault
b02565532f
Update template checkbox 2019-11-11 21:38:44 +01:00
Jesse Boyd
7d7414ebb9
Fix for single chance parsing 2019-11-11 19:47:26 +00:00
Jesse Boyd
55d6217c32
Check if WORLDEDIT_RESTRICTIONS is enabled
Unregister if disabled.
2019-11-11 19:44:51 +00:00
Jesse Boyd
10e5760ba8
Merge pull request #2564 from IntellectualSites/we
Use patterns instead of BlockBucket
2019-11-10 14:08:47 -08:00
Jesse Boyd
f797141a29
Update Plot.java 2019-11-10 22:08:03 +00:00
Jesse Boyd
968c23113c
Fixes #2412 2019-11-10 21:51:29 +00:00
Jesse Boyd
bf4d953f3c
No need to convert to a BlockState here 2019-11-10 18:49:31 +00:00
Jesse Boyd
d34f5cc97e
Config reading/writing 2019-11-10 18:32:32 +00:00
Jesse Boyd
d254633b77
Use patterns instead of BlockBucket
Still use BlockBucket for loading/saving from config
2019-11-10 17:47:37 +00:00
Alexander Söderberg
be93e6efdf
Merge pull request #2560 from IntellectualSites/we
"Use WorldEdit classes" because actually descriptive commitmessages are dumb, right?
2019-11-10 15:56:41 +01:00
Jesse Boyd
1d9ad94822
Fix plot getRegions off by 1 2019-11-10 14:01:12 +00:00
Jesse Boyd
fe438fd62a
swallow stacktrace 2019-11-10 13:29:58 +00:00
Jesse Boyd
93894aca96
Force lowercase 2019-11-10 13:27:37 +00:00
Jesse Boyd
f1b8510708
forgot to find 2019-11-10 13:24:04 +00:00
Jesse Boyd
7dcecf486d
Use regex for block bucket, yay 2019-11-10 13:18:15 +00:00
Jesse Boyd
8c1985f9c0
Split by regex 2019-11-10 13:08:34 +00:00
Jesse Boyd
34eb7d05dc
Print actual value for setup? 2019-11-10 12:45:51 +00:00
Jesse Boyd
729452038b
Check if integer 2019-11-10 12:43:47 +00:00
Alexander Söderberg
3e30e9554f Add missing RunnableVal import. 2019-11-10 13:26:59 +01:00
Alexander Söderberg
009bcaf6d4 Merge remote-tracking branch 'origin/we' into we 2019-11-10 13:26:27 +01:00
Alexander Söderberg
baca8808ee Add missing Location import. 2019-11-10 13:26:15 +01:00
Alexander Söderberg
1a923063b5
Merge branch 'breaking' into we 2019-11-10 13:18:16 +01:00
Jesse Boyd
c512189478
fix import 2019-11-10 11:31:47 +00:00
Jesse Boyd
c155c65a8f
Remove modifier reflection
Fixes #2484
2019-11-10 11:23:25 +00:00
Alexander Söderberg
a221d6fd07 Run tasks synchronously on Bukkit when the plugin is disabled.
Previously, the tasks would fail to run, as the scheduler prevents disabled plugins from running tasks. This would cause problems on server shutdown, especially when the SQLManager attempts to perform database queries.

This fixes #2446.
2019-11-10 12:10:38 +01:00
Alexander Söderberg
37280779b0 Make /plot setowner require an argument. Fixes #2501. 2019-11-10 12:06:33 +01:00
Jesse Boyd
ed588476e0
Fix single plot areas 2019-11-08 22:31:01 +00:00
Jesse Boyd
19fe39ce2e
Merge branch 'we' of https://github.com/IntellectualSites/PlotSquared into we 2019-11-08 05:18:07 +00:00
Jesse Boyd
07fcd53bf8
Fixes IntellectualSites/PlotSquaredSuggestions#58 2019-11-08 05:17:51 +00:00
NotMyFault
834d786037
Fix okio 2019-11-07 17:02:34 +01:00
NotMyFault
72c6f1165a
Fix okio 2019-11-07 17:02:08 +01:00
Matt
1570c4d08a
Add missing import 2019-11-06 14:20:32 -05:00
Jesse Boyd
252fdefef3
bad regex replace 2019-11-06 11:39:55 +00:00
Jesse Boyd
fed5169724
Get sign lines sync 2019-11-05 15:23:48 +00:00
Jesse Boyd
2cb734bba2
editsession util 2019-11-04 21:55:40 +00:00
MattBDev
46926a4d99 Merge remote-tracking branch 'origin/breaking' into breaking 2019-11-04 16:20:03 -05:00
Jesse Boyd
88732bb88c
Use CuboidRegion instead of RegionWrapper 2019-11-04 21:08:33 +00:00
Jesse Boyd
ba3ff08d6c
Update BlockStateListFlag.java 2019-11-04 20:17:29 +00:00
Jesse Boyd
8f7f6a4f40
Merge branch 'breaking' into we 2019-11-04 20:17:15 +00:00
NotMyFault
e8bf3f0d2c
Merge pull request #2558 from IntellectualSites/more-translation-strings
Add translation messages for flag errors
2019-11-04 21:12:39 +01:00
Jesse Boyd
7e6dc48d69
imports 2019-11-04 19:58:24 +00:00
Jesse Boyd
37f608258f
Remove PlotBlock 2019-11-04 19:55:55 +00:00
NotMyFault
a25511c849 Add custom translations for special flags 2019-11-04 19:22:54 +01:00
Jesse Boyd
930dee9326
Refactor BlockVector2 2019-11-04 17:44:23 +00:00
NotMyFault
315f26fb82 Add missing color 2019-11-04 00:46:08 +01:00
NotMyFault
e972cb4c1a Make flag error messages translatable 2019-11-04 00:33:04 +01:00
NotMyFault
7309e61221 AeSix' template improvements 2019-11-02 12:48:41 +01:00
MattBDev
17e784c283 Revert dependency upgrades 2019-11-01 21:45:06 -04:00
Matt
627ecd2b71
Merge pull request #2542 from mindw0rm/UntrustedVisit
New plot flag untrusted-visit
2019-10-31 17:02:48 -04:00
Matt
1c5bd55c96
Merge pull request #2553 from IntellectualSites/bukkit-api
Providing bukkit module on maven
2019-10-31 17:02:00 -04:00
NotMyFault
6ec3951e4e
Add Bukkit module to maven 2019-10-30 15:05:52 +01:00
Alexander Söderberg
d1115d62a7
Merge pull request #2548 from IntellectualSites/flag_fix
Flag fixes and others 🐮
2019-10-27 16:13:22 +01:00
NotMyFault
e29727827d Fix missing word 2019-10-27 16:02:34 +01:00
NotMyFault
1f89948948 Remove unused flags 2019-10-27 16:01:57 +01:00
NotMyFault
1067e5f2c2
Remove redundant empty line 2019-10-27 15:19:49 +01:00
NotMyFault
25ca011bfe
Fixes #2550 2019-10-27 15:10:15 +01:00
Alexander Söderberg
3be0be1b60 Make sure DENY_EXIT checks for the admin override permission. Fixes #2411. 2019-10-27 12:11:48 +01:00
Alexander Söderberg
2e15934666 Fix /plot flag set allowing for invalid flag values. (Fixes #2519) 2019-10-27 12:01:04 +01:00
Alexander Söderberg
cb52ee8cfb Make the flag list output message configurable. 2019-10-27 11:55:15 +01:00
Alexander Söderberg
01eee306f1 Fixes #2462 by making flag categories translatable. This reflects (somewhat) recent changes to command categories. 2019-10-27 11:45:18 +01:00
Alexander Söderberg
a601739fbd Improve handling of list flags, which in turn resolves issues where add and remove would allow players to add flags with unrecognized values. 2019-10-27 11:25:33 +01:00
mindw0rm
cb1767347b
Merge branch 'breaking' into UntrustedVisit 2019-10-23 20:51:59 +02:00
Matt
32654e1f25
Merge pull request #2506 from mindw0rm/DenyTeleportBugfix
Bugfixes for deny-teleport
2019-10-23 14:37:20 -04:00
mindw0rm
91108a5df9 Merge branch 'breaking' into UntrustedVisit 2019-10-22 17:21:24 +02:00
mindw0rm
e5e522bc31 Merge branch 'breaking' into DenyTeleportBugfix 2019-10-22 17:20:43 +02:00
Matt
5741d5f6a0
Merge pull request #2533 from mindw0rm/PlaceFlagBugfix
Place flag bugfix (fixxes issue #2524)
2019-10-21 21:27:48 -04:00
Matt
8b30d6a7ff
Merge pull request #2537 from IntellectualSites/dependabot/gradle/com.google.code.gson-gson-2.8.6
Bump gson from 2.8.0 to 2.8.6
2019-10-19 17:45:28 -04:00
Matt
108b84d8b1
Merge pull request #2527 from IntellectualSites/dependabot/gradle/com.squareup.retrofit2-retrofit-2.6.2
Bump retrofit from 2.4.0 to 2.6.2
2019-10-19 17:44:37 -04:00
Matt
469a4f25e5
Merge branch 'breaking' into dependabot/gradle/com.squareup.retrofit2-retrofit-2.6.2 2019-10-19 17:44:27 -04:00
Matt
c49369bc7e
Merge pull request #2538 from IntellectualSites/dependabot/gradle/org.ow2.asm-asm-7.2
Bump asm from 7.1 to 7.2
2019-10-19 17:43:25 -04:00
Matt
46b5f01bbc
Merge pull request #2536 from IntellectualSites/dependabot/gradle/com.squareup.okhttp3-okhttp-4.2.2
Bump okhttp from 3.14.0 to 4.2.2
2019-10-19 17:43:13 -04:00
dependabot-preview[bot]
d7d9b1793f
Bump okhttp from 3.14.0 to 4.2.2
Bumps [okhttp](https://github.com/square/okhttp) from 3.14.0 to 4.2.2.
- [Release notes](https://github.com/square/okhttp/releases)
- [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/square/okhttp/compare/parent-3.14.0...parent-4.2.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-19 21:40:45 +00:00
dependabot-preview[bot]
e029cc3fa1
Bump retrofit from 2.4.0 to 2.6.2
Bumps [retrofit](https://github.com/square/retrofit) from 2.4.0 to 2.6.2.
- [Release notes](https://github.com/square/retrofit/releases)
- [Changelog](https://github.com/square/retrofit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/square/retrofit/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-19 21:40:43 +00:00
Matt
53e80e4359
Merge pull request #2535 from IntellectualSites/dependabot/gradle/com.squareup.okio-okio-2.4.1
Bump okio from 2.2.2 to 2.4.1
2019-10-19 17:39:38 -04:00
dependabot-preview[bot]
427cf081e3
Bump okio from 2.2.2 to 2.4.1
Bumps [okio](https://github.com/square/okio) from 2.2.2 to 2.4.1.
- [Release notes](https://github.com/square/okio/releases)
- [Changelog](https://github.com/square/okio/blob/master/CHANGELOG.md)
- [Commits](https://github.com/square/okio/compare/2.2.2...2.4.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-19 21:37:55 +00:00
Matt
c103504fc8
Merge pull request #2529 from IntellectualSites/dependabot/gradle/org.jetbrains.kotlin-kotlin-stdlib-1.3.50
Bump kotlin-stdlib from 1.3.30 to 1.3.50
2019-10-19 17:36:40 -04:00
mindw0rm
20957a75d5 use a new Location convert function to ensure that there will be no side effects 2019-10-18 08:02:44 +02:00
mindw0rm
dd715a9c8a Revert "copy yaw and pitch when converting between Bukkit Location and PlotSquared Location"
Undo this since I can't guarantee that there aren't side effects.
2019-10-18 07:51:01 +02:00
mindw0rm
24d82e562a merge upstream changes 2019-10-18 07:44:04 +02:00
NotMyFault
9ad2537ca2
Merge pull request #2517 from IntellectualSites/debugpaste-update
Improve world generator diagnosis
2019-10-17 12:23:47 +02:00
dependabot-preview[bot]
4a3c015524
Bump asm from 7.1 to 7.2
Bumps asm from 7.1 to 7.2.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-14 15:17:55 +00:00
dependabot-preview[bot]
53e94cc001
Bump gson from 2.8.0 to 2.8.6
Bumps [gson](https://github.com/google/gson) from 2.8.0 to 2.8.6.
- [Release notes](https://github.com/google/gson/releases)
- [Changelog](https://github.com/google/gson/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/gson/compare/gson-parent-2.8.0...gson-parent-2.8.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-14 15:17:37 +00:00
mindw0rm
039b7aee9e Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into UntrustedVisit 2019-10-10 20:34:41 +02:00
mindw0rm
0bcaaf3c0b copy yaw and pitch when converting between Bukkit Location and PlotSquared Location 2019-10-10 20:33:25 +02:00
mindw0rm
5315e1e337 let untrusted-visit override deny-teleport 2019-10-10 20:32:48 +02:00
mindw0rm
1f4f78a179 this can be done more elegantly 2019-10-10 01:53:27 +02:00
mindw0rm
599ef8aa44 Bugfix for #2524 (place flag) 2019-10-10 01:36:40 +02:00
Matt
e445f96e0c
Merge pull request #2528 from IntellectualSites/dependabot/gradle/org.yaml-snakeyaml-1.25
Bump snakeyaml from 1.23 to 1.25
2019-10-07 13:49:52 -04:00
Matt
9a8aa7a4e5
Merge pull request #2530 from IntellectualSites/dependabot/gradle/org.projectlombok-lombok-1.18.10
Bump lombok from 1.18.8 to 1.18.10
2019-10-07 13:47:28 -04:00
NotMyFault
a3905c68cf
Fix links 2019-10-07 19:20:48 +02:00
NotMyFault
3d1cd46053
Update Sponsors 2019-10-07 19:09:41 +02:00
dependabot-preview[bot]
ec6c9dac49
Bump lombok from 1.18.8 to 1.18.10
Bumps [lombok](https://github.com/rzwitserloot/lombok) from 1.18.8 to 1.18.10.
- [Release notes](https://github.com/rzwitserloot/lombok/releases)
- [Changelog](https://github.com/rzwitserloot/lombok/blob/master/doc/changelog.markdown)
- [Commits](https://github.com/rzwitserloot/lombok/compare/v1.18.8...v1.18.10)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-07 15:16:57 +00:00
dependabot-preview[bot]
8068671200
Bump kotlin-stdlib from 1.3.30 to 1.3.50
Bumps [kotlin-stdlib](https://github.com/JetBrains/kotlin) from 1.3.30 to 1.3.50.
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v1.3.50/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v1.3.30...v1.3.50)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-07 15:16:54 +00:00
dependabot-preview[bot]
8927f50cc6
Bump snakeyaml from 1.23 to 1.25
Bumps [snakeyaml](https://bitbucket.org/asomov/snakeyaml) from 1.23 to 1.25.
- [Commits](https://bitbucket.org/asomov/snakeyaml/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-07 15:16:31 +00:00
NotMyFault
b806a30639 Setting debug value default to false
If the user is interested in the information or needs it for debugging, they can enable them, but we don't need to spam them unnecessarily with stats about his plot worlds on each startup, /plot reload, etc.
The same information can be obtained from a debugpaste as well, so it's not a loss of information to offer assistance.
2019-10-03 01:32:19 +02:00
NotMyFault
ae0f1d2a15 Adding "website" to plugin.yml 2019-10-03 01:26:31 +02:00
NotMyFault
120d36e413 Add a confirmation to the debugpaste
That should prevent people from accidentally pressing buttons (whyever you would do that)
2019-10-03 01:12:08 +02:00
NotMyFault
c8c5d777a1 Make paths... idk what to say here 2019-10-03 00:40:41 +02:00
NotMyFault
b92d42e7cc Add clarification to what files are pasted 2019-10-01 14:46:19 +02:00
NotMyFault
59bc6f19e5 General clarification of the config
Certain values were rather vague and caused some confusion in the past, hopefully things are more clear now.
2019-10-01 14:01:50 +02:00
NotMyFault
ca25b7b3c8 Fix odd space 2019-10-01 13:02:32 +02:00
NotMyFault
b074e6e198
Update auto-comment.yml
I created templates and setup Actions to ensure functionality.
2019-10-01 12:54:20 +02:00
NotMyFault
267bebd0e8 Improve world generator diagnosis 2019-10-01 12:12:42 +02:00
mindw0rm
58dbe96bd8 Added a plot flag 'untrusted visit', that allows /plot visit for untrusted players without the permission plot.visit.other. 2019-09-19 10:40:47 +02:00
NotMyFault
becac84e6e
Setup Actions test 2019-09-18 02:06:28 +02:00
mindw0rm
ae1273a7f3 Bugfixes for deny-teleport 2019-09-14 12:58:22 +02:00
NotMyFault
05ef076ef0 Remove unnecessary spaces 2019-09-12 04:01:47 +02:00
NotMyFault
d20d95d29b Remove schematic test command 2019-09-12 03:53:29 +02:00
NotMyFault
6e387f3321 Do not remove the schematic file extension 2019-09-12 03:44:31 +02:00
MattBDev
68a5166d2f Fixes the major lag source from GlobalBlockQueue 2019-09-11 19:04:29 -04:00
MattBDev
2bf47478b2 Merge remote-tracking branch 'origin/breaking' into breaking 2019-09-09 15:15:53 -04:00
MattBDev
07b88e3147 Minor changes to the block queue classes to match FAWE more closely. 2019-09-09 15:15:44 -04:00
Matt
26e851fcf1
Merge pull request #2500 from 56738/remove-everyone
Make removing * remove the Everyone node before removing all members
2019-09-09 14:34:39 -04:00
56738
5b3426f4ac Make removing * remove the Everyone node before removing all members 2019-09-09 18:44:36 +02:00
MattBDev
ecfb71b08f Changes made to GlobalBlockQueue to help diagnose lag. 2019-09-08 19:36:02 -04:00
MattBDev
fd6fbebd69 Fixed #2496 2019-09-08 18:43:47 -04:00
NotMyFault
758c343e52
Update bug-issue-report-for-plotsquared.md 2019-09-08 20:25:12 +02:00
NotMyFault
04f789d404 Fix merging 2019-09-08 20:02:45 +02:00
NotMyFault
fe730574c9
Fixes #2490 2019-09-08 01:06:27 +02:00
NotMyFault
20b0fa31d0 Update gradle and deprecated methods 2019-09-07 22:46:13 +02:00
NotMyFault
ec0281768d
Update README.md 2019-09-07 12:50:12 +02:00
NotMyFault
3bec76e27a
Create CONTRIBUTING.md 2019-09-07 12:46:40 +02:00
MattBDev
462c113ce8 Fixed accidental code reversion 2019-09-06 21:20:54 -04:00
Matt
12538c7c27
Merge pull request #2461 from IntellectualSites/midnight-ideas
@N0tMyFaultOG has some random ideas sometimes
2019-09-06 21:16:30 -04:00
NotMyFault
e01b470493 Resolve merge conflicts 2019-09-07 03:06:05 +02:00
MattBDev
f7b78595a9 Merge remote-tracking branch 'origin/breaking' into breaking 2019-09-06 20:40:38 -04:00
MattBDev
b3136b4ebe Version number fixes, fixed documentation, new caption added, and tweaks to API functionality. 2019-09-06 20:40:28 -04:00
NotMyFault
4d0bd8a3a3 Upgrade build files 2019-09-04 03:04:51 +02:00
NotMyFault
e1db27010c Updating command usage formats 2019-09-04 03:01:25 +02:00
NotMyFault
40e3b7fa06 Revert "Add new switch conditions to entity listeners"
This reverts commit a0d666ae14ee89e918f1403bf1ac14f2679b8bb7.
It seems to break armor stand placing in some cases.
2019-09-03 23:56:08 +02:00
MattBDev
a7012814ab Deprecated a poorly named method 2019-09-01 19:40:16 -04:00
MattBDev
213fd80894 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-09-01 16:55:49 -04:00
MattBDev
5e8909883d Modified internal configuration classes, Updated Mojang UUID fetcher, other various method and documentation tweaks 2019-09-01 16:54:43 -04:00
NotMyFault
08cd39749b Create PULL_REQUEST_TEMPLATE.md 2019-08-27 14:44:56 +02:00
MattBDev
a0d666ae14 Add new switch conditions to entity listeners 2019-08-23 23:58:52 -04:00
MattBDev
fa8b18f3d5 Add new switch conditions to entity spawning 2019-08-23 15:57:57 -04:00
dordsor21
267dea4693 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-08-23 17:18:43 +01:00
dordsor21
434d219f41 Add plots.admin.area.sudo for permission to commands of the form "/plot <area> <command...>" as well as plots.admin 2019-08-23 17:18:25 +01:00
Matt
589a69ac6d
Update ISSUE_TEMPLATE.md 2019-08-20 15:36:13 -04:00
dordsor21
dc0126b53c Revert PaperLib from later commits too 2019-08-19 20:47:36 +01:00
dordsor21
0ca69d4f03 Don't use PaperLib I guess 2019-08-19 20:39:03 +01:00
MattBDev
ec84b91f84 added a stupid check because of a spigot issue. 2019-08-19 14:51:14 -04:00
Matt
a63f8650e5
Create CONTRIBUTING.md 2019-08-18 13:25:11 -04:00
NotMyFault
59a1d619d3 Add sponsors 2019-08-18 14:29:37 +02:00
MattBDev
76dc60194d Added an invalid world name check. 2019-08-17 19:17:01 -04:00
MattBDev
cc9c1f63d8 When an exception is actually being used it shouldn't be named ignored 2019-08-17 18:45:07 -04:00
MattBDev
e5da93f359 Added a null check for the very unlikely chance that the command isn't found. 2019-08-17 18:42:31 -04:00
MattBDev
008237b2a4 Fixed #2469 2019-08-17 18:40:39 -04:00
MattBDev
920796d8ec Fixed #2468 2019-08-17 16:28:53 -04:00
NotMyFault
c6a4206266 Fix Typo 2019-08-17 17:06:17 +02:00
NotMyFault
1cf85ff2c6 Removed unused translation strings
And added a new alias
2019-08-17 02:19:29 +02:00
NotMyFault
be20b2404b OCD
- Typo Fixes
- Small amendments (Spelling)
- Reformatting
2019-08-17 01:48:43 +02:00
NotMyFault
011baba140
Update PlotSquared.java 2019-08-16 02:05:51 +02:00
NotMyFault
b22919a278 Variable renames and fixes 2019-08-16 01:47:22 +02:00
NotMyFault
49b7c71fbb Adding some more translation strings 2019-08-16 01:22:24 +02:00
NotMyFault
31c81fc9fe Update command aliases format 2019-08-15 17:35:40 +02:00
NotMyFault
8653b9b0a2 Update unfitting messages 2019-08-15 16:37:57 +02:00
NotMyFault
b3e53e34b6 Simplify help string 2019-08-15 16:20:30 +02:00
NotMyFault
fbaef13553 Unify player string
<> args are used in a lot of commands, PlayerName is used in only 3 commands and I don'T want to remove methods if not really necessary, so let's just change it here.
2019-08-15 15:39:37 +02:00
MattBDev
3473f5dc85 Fixed compatibility with FAWE and compile issue. 2019-08-14 20:47:01 -04:00
MattBDev
b4c33aaa18 Midnight work
Also fixes #2463
2019-08-14 14:36:20 -04:00
MattBDev
a910b542a0 Replace annotations with JetBrains annotations 2019-08-13 23:43:11 -04:00
MattBDev
705d0294b5 Merge remote-tracking branch 'origin/breaking' into breaking 2019-08-13 23:37:22 -04:00
MattBDev
403916748c Variable renaming 2019-08-13 23:37:15 -04:00
MattBDev
fd9e716ec4 Variable renaming 2019-08-13 22:42:01 -04:00
MattBDev
3e6b0b8394 Work on directions and merging 2019-08-13 22:01:23 -04:00
MattBDev
56e055c671 Second attempt at a sign fix. 2019-08-13 18:39:38 -04:00
MattBDev
1341100f03 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-08-13 18:28:54 -04:00
MattBDev
d7c72d5f75 Variable renames 2019-08-13 18:26:55 -04:00
MattBDev
265f0c6615 Potential fix for #1930 2019-08-13 18:06:10 -04:00
MattBDev
9642777750 If NMF can have midnight work, so can I 2019-08-13 17:33:32 -04:00
NotMyFault
41052b27a0 I have some random ideas sometimes
- Adjusting some RequiredTypes fitting their partners/default behavior
- A plot doesn't need to be claimed to get the center
- Adapting another gamemode acronym
- Fix copyFile to adapt the latest changes
- Removing HastebinUtility, we have our own paste service
2019-08-13 21:57:49 +02:00
NotMyFault
0ac4b7728f
Merge pull request #2460 from jewome62/feature/toggle-time
Add toggle for time
2019-08-13 18:44:32 +02:00
NotMyFault
bb97fb8e19 Update Templates to sponge schematic format
Skyblock has been removed as it was simply the default island if ASkyBlock
2019-08-13 04:08:17 +02:00
NotMyFault
b1391bd6d7 Fix template export 2019-08-13 03:13:03 +02:00
NotMyFault
f1c190028e Fixes #2013
Tested with LuckPerms, result successful.
2019-08-12 23:59:14 +02:00
MattBDev
ad7bcd19d4 Added a debug command to diagnose the issues in #2411 2019-08-12 13:40:22 -04:00
jewome62
ca954ccc97 Add toggle for time 2019-08-11 21:15:02 +02:00
Sauilitired
8ab10de4ad
Fix plot title toggling (fixes #2456) 2019-08-10 17:54:44 +02:00
MattBDev
df9d5ae2ac Merge remote-tracking branch 'origin/breaking' into breaking 2019-08-07 19:16:55 -04:00
MattBDev
5ddbf3def4 Update gradle 2019-08-07 19:16:44 -04:00
MattBDev
289f01f7a2 Import changes and variable renames 2019-08-06 21:46:38 -04:00
MattBDev
f3aa9c43ef Fixed a potential NPE 2019-08-06 21:44:39 -04:00
NotMyFault
165cf26818
Fix typo 2019-08-07 03:43:49 +02:00
MattBDev
e6a7f4e5a7 Add null checks to validation task
Fixes #2407
2019-08-06 20:45:01 -04:00
MattBDev
8f685b754a Modifications to formatting and UUID Handler
Fixes #2423
2019-08-06 20:35:36 -04:00
MattBDev
539ad9f05c Small changes 2019-08-06 16:08:56 -04:00
MattBDev
5b8f6e466a Minor gradle edit 2019-08-06 15:05:04 -04:00
Leomixer17
520be48198 Create fixborders.js 2019-08-05 14:47:19 -04:00
Leomixer17
e4a345880e Update addsigns.js 2019-08-05 14:46:54 -04:00
MattBDev
392ef51a6f Revert broken async chunk change 2019-08-05 14:37:56 -04:00
MattBDev
f06903f1b8 Merge remote-tracking branch 'origin/paperstuff' into paperstuff
# Conflicts:
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Help.java
2019-08-05 14:07:09 -04:00
MattBDev
fe83ef0975 Get chunks asynchronously 2019-08-05 14:03:09 -04:00
NotMyFault
9e8a6c702d Fix gradle script 2019-08-05 14:03:08 -04:00
NotMyFault
3e8b8a7575 Remove old files 2019-08-05 14:03:08 -04:00
NotMyFault
d3e37e5eab Migrate Templates to new format 2019-08-05 14:03:08 -04:00
NotMyFault
0c8b11cedd Update DebugUUID.java 2019-08-05 14:03:07 -04:00
NotMyFault
cd26b1647d Add kelp-grow flag
Simply as the name says, add a controlled way to let kelp grow.
2019-08-05 14:03:07 -04:00
NotMyFault
cdc01a5bc4 Reformat debugpaste
And upgrade from IC -> IS
2019-08-05 14:03:07 -04:00
MattBDev
1295f7c4bf Merge with breaking 2019-08-05 14:03:06 -04:00
Sauilitired
20dd98d3b9 Use PaperLib and make command task return completable futures 2019-08-05 14:02:30 -04:00
MattBDev
bd51292f4c Get chunks asynchronously 2019-08-05 13:33:27 -04:00
MattBDev
cc45208605 Merge remote-tracking branch 'origin/breaking' into paperstuff 2019-08-05 13:32:19 -04:00
NotMyFault
7542dbeab8
Fix gradle script 2019-08-04 18:40:39 +02:00
MattBDev
01dfdbe2ef Merge with breaking 2019-08-03 23:26:16 -04:00
MattBDev
bb21abb110 Merge branch 'breaking' into paperstuff
# Conflicts:
#	Bukkit/build.gradle
#	Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java
#	Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlayerPlotTrustedEvent.java
#	Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitPlayer.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Command.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Add.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Buy.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Clear.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugExec.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Grant.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Help.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/MainCommand.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Near.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Relight.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SubCommand.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trust.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java
2019-08-03 23:11:02 -04:00
NotMyFault
59517647b5 Remove old files 2019-08-03 23:20:21 +02:00
NotMyFault
1eba425087 Migrate Templates to new format 2019-08-03 23:18:50 +02:00
NotMyFault
16fcb2f505
Update DebugUUID.java 2019-07-30 23:58:48 +02:00
NotMyFault
6d0849eb66
Merge pull request #2431 from IntellectualSites/kelp-grow
Add kelp-grow flag
2019-07-27 21:55:39 +02:00
NotMyFault
dbf5084fa1 Reformat debugpaste
And upgrade from IC -> IS
2019-07-25 20:02:39 +02:00
MattBDev
d6779d977a Fixes #2423 2019-07-21 20:43:36 -04:00
MattBDev
e8df39d3c4 Fixes #2435 2019-07-21 20:40:04 -04:00
NotMyFault
feda094273 Add kelp-grow flag
Simply as the name says, add a controlled way to let kelp grow.
2019-07-20 01:29:30 +02:00
Jesse Boyd
23b88a375d
player interact ignore cancel 2019-07-12 02:18:08 +10:00
dordsor21
095dccd30f Revert changes to intersection generation 2019-06-28 13:59:57 +01:00
dordsor21
246845607f Let's first test against Material.matchMaterial for material matching (:
Also update some dependencies
2019-06-27 15:18:54 +01:00
NotMyFault
3074e45d2c
Fixed #2325
The permission node does not exist on PlotMe anymore
2019-06-25 11:43:28 +02:00
dordsor21
83d1f1d629
1.14 id support (#2404)
* Plausible fix for 1.14 support.
- Allow 1.14 blocks to be specified in LegacyBlocks, but only saved if the server version is 1.14.
- No snazzy config conversion, but it seems most people managed to figure it out on their own anyway

* Ignore the "severe" output because of new 1.13/14 blocks

* fix oak_wall_sign for 1.14
2019-06-24 13:37:59 +01:00
dordsor21
485415c551
1.14 id support (#2403)
* Plausible fix for 1.14 support.
- Allow 1.14 blocks to be specified in LegacyBlocks, but only saved if the server version is 1.14.
- No snazzy config conversion, but it seems most people managed to figure it out on their own anyway

* Ignore the "severe" output because of new 1.13/14 blocks
2019-06-23 14:17:44 +01:00
Alexander Krivács Schrøder
d6401d1638 Allow running the road regeneration on a single region
The plot-based road regeneration from before does not have the same behavior as the real road regeneration code. This new debug operation will regenerate the roads within the region the player is standing using the same code that regenerates all roads. This makes it much easier to tell if things are working correctly and as expected.
2019-06-16 11:57:35 -04:00
Alexander Krivács Schrøder
7f404e1cf5 Fix plot walls after running regenallroads
Also clears whatever was above the plot wall, such as pieces of the road.
2019-06-16 11:57:35 -04:00
Alexander Krivács Schrøder
a94c588a17 Check if location has PlotArea to avoid NPE 2019-06-03 16:26:20 -04:00
Alexander Krivács Schrøder
d106262454 Have PlotAreas create their own PlotManager
Leads to cleaner code, less need for instanceof and casting, as a PlotArea knows which kind of PlotManager it needs to make
2019-06-03 16:26:20 -04:00
Alexander Krivács Schrøder
c5bca66618 Remove PlotArea parameter from PlotManager method calls
As per the previous commit, all PlotManagers now have a reference to their managed PlotArea.
2019-06-03 16:26:20 -04:00
Alexander Krivács Schrøder
6b3960fc3f Pass the PlotArea into the PlotManager 2019-06-03 16:26:20 -04:00
Alexander Krivács Schrøder
908a5784a1 Cache conversions to BaseBlock and fix leaky abstraction 2019-06-03 16:24:59 -04:00
Alexander Krivács Schrøder
bbff898073 Extract air block into variable to reduce unnecessary function calls 2019-06-03 16:24:59 -04:00
Alexander Krivács Schrøder
19f8704cb4 Remove leftovers from getting rid of PlotBlocks in LocalChunk 2019-06-03 16:24:59 -04:00
Alexander Krivács Schrøder
b366b0d261 Set unspecified blocks from the schematic to air
If this isn't done, any blocks not specified in the schematic will remain after a clear, which is obviously undesirable.
2019-06-03 16:24:59 -04:00
Alexander Krivács Schrøder
941821e453 Convert all PlotBlocks to BaseBlocks in the BasicLocalBlockQueue
The `BukkitLocalQueue` only supports using one of the sets (the removed `baseBlocks` variable in `BasicLocalBlockQueue` was the deciding factor for which one won out) which led to issues with missing blocks when trying to use both types at the same time, such as in the `HybridPlotManager`s `clearPlot` method, where `PlotBlock` is used to fill in the various layers, while the`createSchemAbs` method uses `BaseBlock` for its data.
2019-06-03 16:24:59 -04:00
MattBDev
427523644c Removed unused imports 2019-05-31 12:04:38 -04:00
MattBDev
475e9b50e1 Fixes #2380 2019-05-31 12:00:44 -04:00
MattBDev
812d41092e Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-05-31 11:57:18 -04:00
Alexander Krivács Schrøder
41299e6851 Fix issue with plot border during merge
* `getExtendedTopAbs()` used wrong relative plot for calculating X position.
* Not running `finishPlotMerge()` after every merge led to broken roads during a `merge all`
2019-05-29 23:28:16 -04:00
Alexander Krivács Schrøder
95cb0d84f0 Fix issue with road generation during unlink
Roads should always be created with respect to `current`.
2019-05-29 23:28:16 -04:00
zombachu
fb478de164 Update outdated list of files to check on failed world load (#2365) 2019-05-22 12:09:31 -04:00
MattBDev
1bd7c8ca5f Variable renames 2019-05-21 18:50:52 -04:00
MattBDev
fe471c3571 new library in gradle and another change I can't remember. 2019-05-21 18:32:26 -04:00
MattBDev
8ff833de36 Added Paper to Platform 2019-05-17 18:50:24 -04:00
MattBDev
5dd2610b5e Misc. changes and removal of title manager 2019-05-17 18:49:09 -04:00
MattBDev
4e3a927323 Modifications to the generator code 2019-05-17 16:21:03 -04:00
MattBDev
595a68ecba variable renames 2019-05-17 15:32:05 -04:00
MattBDev
6f5cb30734 Minor message changes and variable changes 2019-05-17 14:38:57 -04:00
MattBDev
427504fd7c Commented out Multiverse-Core and Bump to 1.14.1 2019-05-17 14:26:47 -04:00
MattBDev
b66734a472 Misc. code changes
A lot of renaming
Some formatting
Narrowed scope of variables
Added annotations
2019-05-13 21:57:41 -04:00
MattBDev
84911c1a8c Remove unused title classes 2019-05-13 18:22:17 -04:00
MattBDev
adefe2eeef Titles can be used on Spigot and Paper now 2019-05-13 18:20:58 -04:00
MattBDev
549a4df834 Merge remote-tracking branch 'origin/breaking' into breaking 2019-05-13 15:56:41 -04:00
MattBDev
4daf1c7721 Fixes #2355 2019-05-13 15:56:28 -04:00
dordsor21
728082723c Revert "Don't force metrics. Forcing metrics is against the precedent for all major Spigot plugins"
This reverts commit 4522d98934ccd9481bbf57ed1430c6ddd4d1bbaf.
2019-05-12 12:53:25 +01:00
dordsor21
4522d98934 Don't force metrics. Forcing metrics is against the precedent for all major Spigot plugins 2019-05-11 14:31:13 +01:00
MattBDev
0d67c174aa Fix compatibility with 1.13 and 1.14 2019-05-10 23:00:11 -04:00
MattBDev
a841b4ea86 Titles are now exclusive to paper servers 2019-05-10 22:42:07 -04:00
MattBDev
f232334bcc Various formatting tweaks as well as metrics changes. 2019-05-10 21:18:28 -04:00
MattBDev
d8ac6115c7 I never thought it would come to this 2019-05-10 17:16:48 -04:00
dordsor21
885d1b9d7e Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-05-05 16:56:14 +01:00
dordsor21
f6e492638d Bad temporary fix for #2345 - just don't use BukkitLocalQueue#regenChunkSafe and that on 1.14 :) (: 2019-05-05 16:56:00 +01:00
dordsor21
46beb90112
Correcter versioning 2019-05-05 11:58:45 +01:00
dordsor21
0a6fad73c3 Correct versioning 2019-05-05 11:56:08 +01:00
NotMyFault
5796db51a7 Update links 2019-05-02 20:51:52 +02:00
dordsor21
2998f45b27
Update JavaDoc link 2019-05-02 16:14:53 +01:00
dordsor21
e156d58769 Generate javadoc with aggregatedJavadocs option 2019-05-02 15:54:14 +01:00
dordsor21
eb9d98d289 Use https://www.athion.net/ISPaster/paste 2019-05-01 19:52:26 +01:00
MattBDev
2ec13e4e76 Replace code with hasFlag() where appropriate. 2019-05-01 12:31:50 -04:00
MattBDev
f72d39ed85 Fixes #1318 2019-05-01 12:11:35 -04:00
MattBDev
72291b09f2 Fix the actual issue and remove whatever junk from the previous commit 2019-04-30 15:11:43 -04:00
MattBDev
ac5cdfae64 Fix for ItemFrames 2019-04-30 14:44:33 -04:00
MattBDev
db6115eae5 Documentation and formatting changes 2019-04-29 15:20:52 -04:00
MattBDev
9e324762b6 Move the update utility setup to it's own method 2019-04-29 15:18:38 -04:00
MattBDev
299fac95fb Add a stupidity fail-safe. 2019-04-29 11:02:47 -04:00
MattBDev
906c1081fa Merge remote-tracking branch 'origin/breaking' into breaking 2019-04-29 10:50:10 -04:00
MattBDev
237b10a2a2 Tidying up the code 2019-04-29 10:49:58 -04:00
NotMyFault
b7909cc6e5
Fix typo 2019-04-27 16:16:13 +02:00
Matt
dca8594542
Update ISSUE_TEMPLATE.md 2019-04-25 13:06:26 -04:00
MattBDev
0b7e63bafb Added new 1.14 blocks 2019-04-24 22:04:30 -04:00
MattBDev
9f792fa54b Fixes #2328
I hope this doesn't cause more issues than it solves
2019-04-24 21:23:57 -04:00
MattBDev
d0be0780fd Reformatting and cleaning. 2019-04-24 16:11:24 -04:00
dordsor21
bef3dbc6f4 Reformat code 2019-04-23 23:48:22 +01:00
dordsor21
d352804b5d Update gradle lombok version for core 2019-04-23 23:47:00 +01:00
dordsor21
9485f82ea9 Fix signs between 1.13 and 1.14 2019-04-23 23:46:10 +01:00
dordsor21
c7ba94f959 Fix legacy material loading error and Jenkins4J dependencies 2019-04-23 23:03:52 +01:00
dordsor21
5ac00c4920 downgrade Jenkins4J 2019-04-23 22:41:06 +01:00
dordsor21
bd1217810f Should fix the sign issue 2019-04-23 22:30:31 +01:00
dordsor21
1e97392244 Update to gradle 5.4 2019-04-23 22:27:32 +01:00
MattBDev
9b3ca4468c Temporary fix for a working 1.14 build 2019-04-23 14:41:20 -04:00
MattBDev
b2b2f3cd05 attempt to fix signs 2019-04-23 14:24:55 -04:00
MattBDev
bae3774eb6 Merge remote-tracking branch 'origin/breaking' into breaking 2019-04-23 13:45:35 -04:00
MattBDev
1118901ca2 Initial 1.14 Update 2019-04-23 13:45:24 -04:00
Jesse Boyd
0c0a696d36
Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-04-23 12:57:46 +10:00
Jesse Boyd
21a5b04b7b
remove debug 2019-04-23 12:57:39 +10:00
MattBDev
6fa41efbf5 Merge remote-tracking branch 'origin/breaking' into breaking 2019-04-22 11:55:11 -04:00
MattBDev
ef8d33db41 Minor command changes
Changed RequiredType in some classes and formatting changed in others.
2019-04-22 11:55:05 -04:00
Jesse Boyd
1abe444205
Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-04-23 01:53:35 +10:00
Jesse Boyd
145af1e091
fix workaround 2019-04-23 01:53:24 +10:00
MattBDev
f5fa15080c Minor javadoc updates 2019-04-22 11:45:23 -04:00
Jesse Boyd
0c0d0104d7
Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-04-23 01:06:52 +10:00
Jesse Boyd
406dd22703
Workaround for effective permission check 2019-04-23 01:06:41 +10:00
dordsor21
bb44c2ea92 parsable build number 2019-04-20 16:26:31 +01:00
Jesse Boyd
ea26ec628d
Use Settings.Teleport.ON_LOGIN 2019-04-19 13:02:50 +10:00
Jesse Boyd
815e513093
Fix teleportOnLogin error 2019-04-19 12:53:48 +10:00
Jesse Boyd
8ac23b92d8
Use UUID, not just name 2019-04-17 22:18:03 +10:00
Jesse Boyd
d31dbc7c7c
Fix debugimportworlds 1.13
because someone changed PlotId.fromString to throw an exception without updating things that call it
2019-04-17 22:07:33 +10:00
Jesse Boyd
000e3de35d
Don't allow importing using base directory 2019-04-17 14:36:31 +10:00
Jesse Boyd
7e63ffe745
Optimize vanilla world generation*
*For single plot worlds

Reuse base world data. Instead of taking several seconds, it should now take tens of milliseconds.
2019-04-17 14:30:05 +10:00
Jesse Boyd
27eda9eb7c
Don't setup single plot worlds 2019-04-17 14:00:01 +10:00
Jesse Boyd
0fdc5eafbd
Allow single plot areas to load survival worlds 2019-04-17 13:46:33 +10:00
Jesse Boyd
59f89980a3
Don't need ratio out of 100 anymore 2019-04-17 13:13:56 +10:00
Jesse Boyd
50acf4f51f
Print exception on failed schematic setup 2019-04-13 13:06:21 +10:00
Jesse Boyd
04779d28fb
Don't fail on metrics error 2019-04-13 12:26:19 +10:00
Jesse Boyd
1e78368115
Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-04-13 12:23:24 +10:00
dordsor21
0c46df65e6
Not sure why that last commit was a thing locally 2019-04-12 17:42:35 +01:00
dordsor21
4c788cb51e Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-04-12 17:40:16 +01:00
MattBDev
1c915905c6 Fixes #2275 2019-04-11 23:27:47 -04:00
Jesse Boyd
9f3e3c83e0
Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-04-12 12:11:16 +10:00
Jesse Boyd
6916752434
Fixes #2322 2019-04-12 12:11:03 +10:00
dordsor21
b0b328e50b
Update offset to match CI 2019-04-11 12:43:16 +01:00
Jesse Boyd
6cea26f436
Add random collection 2019-04-10 17:10:44 +10:00
Jesse Boyd
533edc5f40
Change default threshold to -1 2019-04-10 17:10:17 +10:00
Jesse Boyd
97903f3870
Fix you are not in a plot area for single plot worlds 2019-04-10 11:34:21 +10:00
dordsor21
d571f54c65
Update offset to match ci 2019-04-09 15:48:25 +01:00
Jesse Boyd
e0bd8e3f9d
Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-04-09 00:29:30 +10:00
Jesse Boyd
9225a13808
sorry for breaking roads 2019-04-09 00:29:13 +10:00
Jesse Boyd
3f712ed5f0
should check both end/nether 2019-04-08 18:03:38 +10:00
Jesse Boyd
259fe94f83
Potential fix to skip chunks being kept loaded 2019-04-08 01:43:38 +10:00
Jesse Boyd
3651b3ac8d
I don't know about coffee, but how about Java? @sauilitired 2019-04-06 23:14:39 +11:00
Jesse Boyd
b32b8a98e2
Fixes #1936 2019-04-06 17:19:48 +11:00
Jesse Boyd
5d515b3863
This shouldn't have been made private 2019-04-06 12:55:45 +11:00
Jesse Boyd
a3cb4e5ffb
Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-04-06 03:54:42 +11:00
Jesse Boyd
676ef0159a
only change plotY if height not 256 2019-04-06 03:54:27 +11:00
dordsor21
34d11bf23d Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-04-05 17:39:33 +01:00
dordsor21
0c00eb2061 Add clean task back properly 2019-04-05 17:39:16 +01:00
Jesse Boyd
3e3951a3e7
*negate 2019-04-06 02:07:39 +11:00
Jesse Boyd
c71fe00741
Missed this as well 2019-04-06 02:07:14 +11:00
Jesse Boyd
69a029a555
Fix plot schematic y 2019-04-06 01:54:02 +11:00
Sauilitired
3f194f90ce
Unbreakify things 2019-04-04 18:31:47 +02:00
Sauilitired
7e401a83cf
Make PlotLoc's immutable 2019-04-04 18:26:10 +02:00
dordsor21
69b05932eb Update to gradle 5. gradlew clean assemble build actually WORKS 2019-04-03 17:15:09 +01:00
dordsor21
ac2d43db68
Update offset to match CI 2019-04-03 14:41:54 +01:00
Jesse Boyd
b5418e4dce
Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-04-04 00:20:13 +11:00
Jesse Boyd
6b422582a6
Load WorldEdit onEnable
as otherwise it doesn't work
2019-04-04 00:19:59 +11:00
Sauilitired
f5388b9737
Merge remote-tracking branch 'origin/breaking' into breaking 2019-04-01 17:40:10 +02:00
Sauilitired
6323fb0041
Add plot like/dislikes 2019-04-01 17:39:28 +02:00
Jesse Boyd
b1835f0998
whoops, wrong schematic 2019-04-01 21:45:55 +11:00
Jesse Boyd
1c9c0d0207
Schematic fixes
The 1.13 schematic format uses the `.schem` extension, use that instead
Support loading both legacy `.schematic` and `.schem` files for road
schematics
Fix reading road schematics with an offset
2019-04-01 21:39:10 +11:00
Sauilitired
0f8b7cd588
fixes #2211 2019-04-01 11:14:47 +02:00
Sauilitired
c450e4aed3
Fix interval flags (fixes #2302) 2019-04-01 10:17:50 +02:00
Sauilitired
14badf8cfc
remove rogue debug message 2019-04-01 09:43:29 +02:00
Sauilitired
df3e78ee40
Make the "Display all commands" message configurable too 2019-04-01 09:04:19 +02:00
Sauilitired
11689bf855
Configurable help categories 2019-04-01 09:00:08 +02:00
Sauilitired
4152582ae0
Fix UUID related NPE 2019-04-01 08:35:06 +02:00
Jesse Boyd
3be7511b7c
Fix genChunk setCuboid 2019-04-01 05:01:32 +11:00
Jesse Boyd
f3adeeac0e
Fix single plot area NPEs & generator stackoverflow 2019-04-01 04:44:18 +11:00
Jesse Boyd
67cf1b45ed
Fix another legacy converter NPE 2019-04-01 04:43:44 +11:00
Jesse Boyd
e396da8ee5
fix converter NPE 2019-04-01 03:19:53 +11:00
Jesse Boyd
04b9b67c9d
Fixes #2288 2019-03-31 18:31:16 +11:00
Sauilitired
45360f0979
Make sure /plot home ignores server owned plots 2019-03-30 13:32:45 +01:00
Sauilitired
ae57264487
Add server-plot flag, and option to disable on-claim teleportation 2019-03-30 13:27:18 +01:00
Sauilitired
08ebf57c90
Add hide-info flag 2019-03-30 12:50:32 +01:00
Alexander Söderberg
d9407d6329
Merge pull request #2312 from IntellectualSites/async-gen
Add support for Paper async chunk generation
2019-03-29 19:31:02 +01:00
Sauilitired
c6ae2456f2
Add support for Paper async chunk generation 2019-03-26 09:27:20 +01:00
dordsor21
c9f38430c6 Clean and fix up the fromAny method in Legacy Mappings
it never checked for an id data pair or singular id (5, 5:2 etc) which is sort of the whole point. Fixes #2296
2019-03-20 17:17:45 +00:00
dordsor21
3a761b3b5f
Update offset to match CI 2019-03-20 12:20:09 +00:00
Sauilitired
c48116b723
Merge remote-tracking branch 'origin/breaking' into breaking 2019-03-18 19:49:31 +01:00
Sauilitired
0b77b863ba
Update notifications. 2019-03-18 19:49:22 +01:00
Alexander Söderberg
832d60ce87
Update README.md 2019-03-17 12:34:33 +01:00
Alexander Söderberg
f863dfee42
Update README.md 2019-03-17 12:32:09 +01:00
Alexander Söderberg
c44d180352
Update README.md 2019-03-17 12:31:23 +01:00
Alexander Söderberg
a17cb735b7
Update README.md 2019-03-17 12:30:14 +01:00
matt
806124b047 Merge remote-tracking branch 'origin/breaking' into breaking 2019-03-15 13:40:04 -04:00
matt
61cb288382 oops sorry.
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-03-15 13:39:51 -04:00
Matt
3956adf291
Update ISSUE_TEMPLATE.md
Added a warning about future legacy version support.
2019-03-15 01:00:55 -04:00
matt
672fb0f829 Merge remote-tracking branch 'origin/breaking' into breaking 2019-03-14 21:49:52 -04:00
matt
7f14e88c4c last commit before 4.0.0
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-03-14 21:49:33 -04:00
dordsor21
e146b6a88d
Update offset to match CI 2019-03-13 13:21:09 +00:00
matt
cf1764723f Fixes #2291
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-03-12 16:56:51 -04:00
matt
7b788c07b8 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-03-09 00:05:49 -05:00
dordsor21
dffbaf89a3 Fix for offhandedness 2019-03-09 00:28:21 +00:00
matt
578069b3c9 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-03-08 19:26:06 -05:00
matt
ed3cadd439 Formatting fixes and minor performance improvement
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-03-08 19:25:59 -05:00
dordsor21
aa894b8ad9 Fixes #2245
Also some minor fixes to PlayerInteractEvent main/off hand logic
2019-03-09 00:12:21 +00:00
dordsor21
ed10877431 Should fix IndexOutOfBoundsException when copying
fixes#2290
2019-03-08 23:04:38 +00:00
matt
1d327ec346 Fixes an issue with boats
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-03-07 18:38:21 -05:00
matt
56c24a6a56 Type weakening and Direction changes
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-03-06 12:47:38 -05:00
matt
4c8457ad14 OCD
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-22 11:54:13 -05:00
dordsor21
f93cfb9f8b
Update build offset 2019-02-22 16:53:11 +00:00
matt
1755272f81 Merge remote-tracking branch 'origin/breaking' into breaking 2019-02-22 11:51:22 -05:00
matt
25530ed7f0 Doc Updates, Renaming, Reformatting, and a Test
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-22 11:51:06 -05:00
dordsor21
53e732b4fe Make replacing wall on merge configurable
In case people are doing fun things with road schematics etc :)
2019-02-22 15:21:44 +00:00
dordsor21
7aebd9b74b Set wall filling on merge 2019-02-22 15:11:35 +00:00
dordsor21
be51d8e159 Correct artifact id for maven 2019-02-22 14:38:18 +00:00
matt
bfc6b62213 Stupid docs
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-21 21:31:12 -05:00
matt
a9bebb10da Merge remote-tracking branch 'origin/breaking' into breaking
# Conflicts:
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEExtent.java
2019-02-21 21:18:03 -05:00
matt
2f18ef6828 Critical bug fixes, reformatting, and cleaning
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-21 21:14:48 -05:00
dordsor21
f2d68642f9 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-02-20 14:51:01 +00:00
dordsor21
350e151214 Don't use streams as they're lower performance for our use cases.
Some minor reformating too.
2019-02-20 14:50:49 +00:00
dordsor21
72b031e3e5
Update offset to match CI 2019-02-20 11:59:39 +00:00
dordsor21
d0a4465985 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-02-20 11:55:50 +00:00
dordsor21
0ef8b4ad14 Update to WorldEdit's *breaking* Biome handling changes 2019-02-20 11:55:39 +00:00
matt
c5d9412c6c Cleaning and API Addition
Begins the process of removing "magic values" for directions in the plugin.

Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-19 22:57:35 -05:00
matt
92718a5ec8 Merge branch 'consumers' into breaking 2019-02-19 22:29:59 -05:00
matt
099a807ce0 CLeaning of code
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-19 22:29:27 -05:00
matt
df47697ca6 CLeaning of code
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-19 19:00:37 -05:00
matt
b7aeeb151d Replace RunnableVal with java Consumer
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-19 18:39:43 -05:00
dordsor21
2e22dfe056
Update offset to match CI 2019-02-16 22:06:31 +00:00
matt
a64d764cc1 New API method, more 1.13 entity support, and cleanup.
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-15 12:50:43 -05:00
dordsor21
4f27abb4a0 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-02-14 17:39:01 +00:00
dordsor21
b999cb4195 Fix players being able to place boats, armorstands etc using offhand 2019-02-14 17:38:36 +00:00
dordsor21
745fd58e2e
* 2019-02-13 21:54:13 +00:00
dordsor21
57981a870e
Update version offset to match ci 2019-02-13 21:53:11 +00:00
dordsor21
130e1b6300 Fix armorstands, boats etc being placeable on players plots with "use 0" flag 2019-02-13 21:47:54 +00:00
dordsor21
477e698f7e Reformat 2019-02-13 17:13:57 +00:00
matt
11c4a90cc9 Merge remote-tracking branch 'origin/breaking' into breaking 2019-02-13 12:05:42 -05:00
matt
35493662da Cleanup
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-13 12:05:28 -05:00
dordsor21
8710f2f83b Fix NPE when right-clicking a >1.13 block 2019-02-13 13:43:22 +00:00
dordsor21
3e8308ecd7 Catch statement already being null 2019-02-13 13:35:19 +00:00
dordsor21
dae7bbdf9d Fix dropped items being removed from plots 2019-02-13 13:26:19 +00:00
dordsor21
d0994f1b4b Fixes to EntityTask 2019-02-10 23:03:14 +00:00
dordsor21
cae95343ca
Update build offset 2019-02-10 22:51:21 +00:00
matt
17027e6292 Javadoc changes and cleaning of old unused code
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-08 14:49:37 -05:00
matt
e891873d28 Cleaning and scope changes
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-08 11:21:53 -05:00
matt
b39ea1b68b Cleaning and API clarifications
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-06 21:29:51 -05:00
matt
3d8179a4e6 Small tweaks
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-06 17:30:25 -05:00
matt
9101cb9218 PlotComment API tweaks.
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-06 12:33:14 -05:00
matt
6ec6c26a10 Guava needs to be in sync with Minecraft
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-06 12:02:20 -05:00
dordsor21
d6a801d854 Reformat 2019-02-06 16:42:27 +00:00
dordsor21
6711788dd0 Fix ClassCastException in runEntityTask 2019-02-06 16:38:01 +00:00
dordsor21
e41060ad65
And again
Because the ci built, but using a specific commit (to split Matt's previous commits into separate builds)
2019-02-06 14:12:50 +00:00
dordsor21
7e7f14a66b
Update build ci offset 2019-02-06 14:10:34 +00:00
matt
0c780166e0 Documentation and PlotId updates
minor code tweaks in the plot class too

Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-06 00:10:05 -05:00
matt
87547834ef Minor changes to variable names and castings
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-05 23:12:01 -05:00
matt
ccc53278a1 Fix the world border issue
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-05 20:36:42 -05:00
matt
9a23b718f3 Cleanup of various methods
mainly just more lambda's

Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-05 19:41:03 -05:00
matt
e3d43509cf Cleanup of some database methods
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-04 18:00:05 -05:00
matt
dfbcecb081 Removes Cluster Flags
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-04 12:46:27 -05:00
dordsor21
cf82bc5efb Revert 8ac9b86 2019-02-04 15:18:50 +00:00
dordsor21
14e1296e13 Only thing I can think of in 8ac9b86that would be causing the lack of plot owners (before reverting the commit) 2019-02-04 14:24:17 +00:00
dordsor21
6d6087b1e3 And don't add the Core/ code into Bukkit/ code 2019-02-04 14:02:21 +00:00
dordsor21
51afbdfcdc Apply correct codestyle 2019-02-04 13:59:11 +00:00
dordsor21
9c90928d07 Remove the debug and don't created a new BloxkBucket for every air block. 2019-02-02 16:13:55 +00:00
matt
8ac9b862f8 Major cleanup.
Added todo comments to many 1.13 issues still lingering. Changed access to some methods to be weaker. Removed cluster flags (most of it). Java 8 stuff added. Hid more PlotSetting methods. etc.

Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-01-31 14:20:48 -05:00
NotMyFault
cd8a1a0816
Fixed some translation mismatches 2019-01-27 00:48:03 +01:00
dordsor21
a4c3fb26c7 Check for road or unowned plot 2019-01-23 14:02:18 +00:00
dordsor21
fd4a5f2aaa Fix item despawning on plots 2019-01-23 13:34:23 +00:00
dordsor21
25ed9d2798 Fix road schematic pasting height 2019-01-23 12:23:05 +00:00
Sauilitired
c96a1afaed
Don't fuck up road schematics, I guess 2019-01-22 21:32:24 +01:00
Sauilitired
344a2afeff
Use StringBuilder, like a sane person 2019-01-22 19:54:31 +01:00
Sauilitired
e54f964eca
Fix #2009 2019-01-22 18:51:13 +01:00
Sauilitired
8733dc6dab
Fix deny-teleport flag: Fixes #2128 2019-01-22 10:43:29 +01:00
Sauilitired
7e56e47046
Fix block list flag permissions 2019-01-21 17:49:36 +01:00
Sauilitired
7edfc313d6
I did an oopsie 2019-01-21 12:24:34 +01:00
Sauilitired
d37f5b9aa8
Fix schematic pasting offsets 2019-01-21 09:53:04 +01:00
Sauilitired
1fbfc767c4
Use PaperLib and make command task return completable futures 2019-01-21 09:20:33 +01:00
dordsor21
bd797b59fe Allow disabling of scientific notation (disabled by default) for DoubleFlags 2019-01-20 15:56:49 +00:00
dordsor21
0609b3d7f6 Safer generation of the BlockBucketChunk 2019-01-19 16:28:49 +00:00
dordsor21
ca883c211a Add merge permission changes from master 2019-01-18 19:02:12 +00:00
dordsor21
330ab83ece possible NPE fix and add useful debug if it fails 2019-01-17 22:34:28 +00:00
dordsor21
d846bc7a2e Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-01-17 16:28:55 +00:00
dordsor21
db2e245b13 alphabetise PlayerEvents stuff and add Turtle Eggs 2019-01-17 16:28:42 +00:00
Sauilitired
4e79a3aa16
Fix broken group ID 2019-01-17 15:31:18 +01:00
dordsor21
ea422b5561 Fix NPE on world initialise 2019-01-17 13:19:24 +00:00
dordsor21
f366f5e406 Remove needless generateExtBlockSections method that just reduced performance for no reason 2019-01-17 01:06:32 +00:00
dordsor21
223064567f
Plot analysis (#2239)
* Start to fix (and may have fixed) plot analysis with block buxkets and 1.13

* Standard deviation ought also be multiplied by 100, and only obtain the BlockBucket array once

* Add schematics to Plot Analysis
Add generateBlockBucketChunk method to SingleWorldGenerator
2019-01-17 01:04:00 +00:00
matt
0817d7de5a Removed PlotMe converting features.
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-01-15 22:19:29 -05:00
dordsor21
0e0a534620 Fix regenallroads extend (height) 2019-01-16 01:55:45 +00:00
dordsor21
61f8ceaaaa I'm an idiot and left one of my debug messages in 2019-01-16 01:28:07 +00:00
dordsor21
7e6b11a21b Fix plot swap and have a nicer static AIR block 2019-01-15 23:58:21 +00:00
dordsor21
28c219c694 /plot leave has a terrible description 2019-01-15 16:20:50 +00:00
dordsor21
f679d3f873 Debug not debug 2019-01-14 18:27:20 +00:00
dordsor21
232b7ccfc1 Don't allow debugroadregen on merged plots 2019-01-14 18:15:44 +00:00
dordsor21
44fc8a55ea Add "kick" meta check in PlotListener 2019-01-14 17:41:28 +00:00
dordsor21
b2d035cf69 Fix deny-exit flag causing plot kick to break 2019-01-14 17:31:22 +00:00
dordsor21
d81d3c72e4 Update scripts and code to work nicely with each other.
Fixes #2208
2019-01-12 19:56:11 +00:00
dordsor21
f62777bc1a Minor:
Fix BukkitLegacyMappings method map usage
Move obtaining legacy block to default clause
Task should be async
2019-01-12 18:05:20 +00:00
Logan Fick
8ba661aa35 Fixed plot owner UUIDs getting unnecessarily randomized. (#2233) 2019-01-12 17:48:53 +00:00
dordsor21
15ea0f3210 Fix BukkitLegacyMappings having maps the wrong way round & fix PlotBlockListFlag to use PlotBlocks.
Fixes #2229
2019-01-12 17:39:29 +00:00
dordsor21
0d76e46fa2 Fix requiring restart for /ps load after /ps save & make descriptions nicer 2019-01-11 12:50:38 +00:00
Alexander Söderberg
daf3e3dde5
Merge pull request #2230 from N0tMyFaultOG/breaking
Cleanup - Removing bo3
2019-01-10 22:33:20 +01:00
NotMyFault
222585bf01
Update C.java 2019-01-10 22:21:34 +01:00
NotMyFault
63af0de9f0
Update Settings.java 2019-01-10 22:20:30 +01:00
NotMyFault
5df6f2a13e
Update Download.java 2019-01-10 22:18:28 +01:00
NotMyFault
c5f1c60ad7
Delete base.yml 2019-01-10 22:16:22 +01:00
Sauilitired
3ac7785cc3
Skip empty files in DebugPaste 2019-01-10 21:34:52 +01:00
dordsor21
3bbd97e7e1 Fix PlotDeleteEvent and PlotMergeEvent not being called.
Replaced current PlotMergeEvent with PlotAutoMergeEvent (called when a plot is merged on /plot auto). And made PlotMergeEvent be called for /plot merge command.
2019-01-10 17:10:25 +00:00
Sauilitired
e47b4fef20
Remove update and changelog commands 2019-01-10 17:45:40 +01:00
matt
7302480728 Merge branch 'optional' into breaking 2019-01-09 20:01:32 -05:00
NotMyFault
457c520eb6
Fixing debugpaste description 2019-01-09 23:40:08 +01:00
Sauilitired
053edb823d
Use Incendo pasting instead of Hastebin 2019-01-09 23:12:36 +01:00
dordsor21
727d120e70 Regenallroads:
- remove the "estimated time" as it's just not remotely correct, nor would it be correct if it were based on actual chunk number
 - fix the air to be pasted above the road when using regenallroads
2019-01-09 16:15:34 +00:00
dordsor21
ea01a5171b Add missing admin unlink permission 2019-01-03 22:36:09 +00:00
dordsor21
77ddeabca2 Fix NPE with plot version (update to new versioning within code)
Also add date and commit to plugin.properties file.
2019-01-03 17:32:21 +00:00
matt
e12a7bb85f Migrated remaining Optionals 2019-01-02 23:15:42 -05:00
matt
c7b9bfeb4b Migrate from Guava Optionals to Java Optionals 2019-01-02 23:11:26 -05:00
dordsor21
ae9e52f093 Don't dump g_sch 2019-01-02 13:18:20 +00:00
dordsor21
00a5d5ff64 Nicer versioning and match CI build number 2019-01-02 13:01:37 +00:00
dordsor21
29868bdd29 Fix road generation for roads of even width 2019-01-01 14:43:41 +00:00
Sauilitired
38a382f8e5
Add missing argument to unlink 2019-01-01 00:55:25 +01:00
dordsor21
f8ce00c2df Also cancel picking water/lava up with a bucket. 2018-12-31 18:03:59 +00:00
dordsor21
6a9038c306 Fix #2205 2018-12-31 17:57:17 +00:00
dordsor21
7bcc4c4ce3 Fix plot move/swap block rotation issue (switch to BaseBlock). Also fix container inventory pasting.
Some cleanup.
Fixes #2209
2018-12-31 17:15:47 +00:00
dordsor21
8c52e20736 Use BaseBlocks in regenallroads and minor cleanup of HybridUtils.
Fixes #2210
2018-12-31 16:08:09 +00:00
dordsor21
3156741664 Fix plot redstone disabling (not sure why it was the way it was, but it was never going to work, so I fixed? it)
also minor reformat to PlayerEvents
2018-12-28 17:25:29 +00:00
dordsor21
750be6c5fe clean merge up 2018-12-28 17:03:00 +00:00
Rick Strafy
6292bff7c9 Fix rotation (#2200)
* Fix rotation

* Clean up some events and utility classes. Try to use as general type
declarations as possible. Add configurable override for the unsafe block checker.

* Treat tridents as a projectile

* Fix rotation and merged with current breaking branch
2018-12-28 09:42:03 +00:00
Sauilitired
f25581c3f1
Treat tridents as a projectile 2018-12-28 08:14:47 +01:00
Sauilitired
12b8ae3eed
Clean up some events and utility classes. Try to use as general type
declarations as possible. Add configurable override for the unsafe block checker.
2018-12-28 07:39:39 +01:00
dordsor21
660754511b Fix rotation of road schematics 2018-12-28 00:47:48 +00:00
dordsor21
2846363a2c Revert "Use our own schematic readers in only create one input stream, and allow for future customisation of schematics if required/wanted."
This reverts commit 3521b8aa22624dcd725175243c9105dfc034d7f2.
2018-12-27 20:06:02 +00:00
dordsor21
3521b8aa22 Use our own schematic readers in only create one input stream, and allow for future customisation of schematics if required/wanted. 2018-12-27 19:42:56 +00:00
Sauilitired
249b5d4068
Revert dors commit 2018-12-27 17:29:35 +01:00
Sauilitired
76113cb0ab
Allow specifying Y value for default plot home 2018-12-27 16:18:54 +01:00
matt
a529518b91 Minor changes, formatting, comments.
One notable thing added was the inclusion of more of the new mobs in one of the events.
2018-12-27 00:46:32 -05:00
Alexander Söderberg
75bcd1adec
Update StringMan.java 2018-12-27 01:31:48 +01:00
dordsor21
fba7eac6d8 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2018-12-26 21:18:38 +00:00
dordsor21
6e127db982 Cleanup 2018-12-26 21:18:22 +00:00
Sauilitired
d12bdcfda4
Fix NPE on VehicleMoveEvent. Fixes #2195. 2018-12-26 19:25:20 +01:00
Sauilitired
f1cf541606
Merge remote-tracking branch 'origin/breaking' into breaking 2018-12-26 19:16:42 +01:00
Sauilitired
2b9fe5afda
Fix plot music (and plot inventories) 2018-12-26 19:16:34 +01:00
dordsor21
ba47a21971 - Update code style to format annotations nicely
- Reformat code
2018-12-26 17:21:06 +00:00
dordsor21
8cb2bdc846 Nice code to handle schematic loading and remove the ability to debugroadregen a specific chunk, as it uses a completely different method to actual road generation. 2018-12-26 16:44:39 +00:00
Sauilitired
5bdc5a0fcc
Fix road schematics but for real this time 2018-12-26 17:24:35 +01:00
Sauilitired
2ebb7d11a8
Fix road schematics 2018-12-26 17:05:37 +01:00
Sauilitired
1d08f4d4ff
Include a rationale like Spottedleaf was kind enough to suggest 2018-12-26 15:38:31 +01:00
Sauilitired
b05316c000
Recommend paper just like FAWE. I want to be like the cool kids.
Oh, and fix an issue with `/plot music`. Still broken. Just not
the same kind of broken.
2018-12-26 15:29:39 +01:00
Sauilitired
f1378013c1
Fix plot home 2018-12-26 01:39:49 +01:00
Sauilitired
edc758334c
Actually copy over the files as well... 2018-12-25 18:30:42 +01:00
Sauilitired
beb0f5708f
Whoops... 2018-12-25 18:28:07 +01:00
Sauilitired
71baee063c
Update maven info for Core 2018-12-25 18:27:07 +01:00
Sauilitired
1ca50cdbd2
Merge remote-tracking branch 'origin/breaking' into breaking 2018-12-25 12:05:12 +01:00
Sauilitired
afb0a9f17f
Forcefully load WorldEdit on startup 2018-12-25 12:05:01 +01:00
dordsor21
c14b76b324 Fix rotational blocks in road generation 2018-12-24 23:14:13 +00:00
dordsor21
af23d3d98e Fix schematic pasting to paste tile entities and blocks with BlockData (e.g. stairs) properly 2018-12-24 17:56:13 +00:00
Sauilitired
9fe9c2662b
Fix legacy conversion of block lists 2018-12-24 08:57:17 +01:00
Sauilitired
9e0c226632
Fix schematic pasting 2018-12-24 08:13:15 +01:00
Sauilitired
4f43788307
Merge remote-tracking branch 'origin/breaking' into breaking 2018-12-24 01:50:45 +01:00
Sauilitired
8dae2555db
Make mv create work again 2018-12-24 01:50:17 +01:00
dordsor21
1bf621fb4b Fix schematic saving (and improve performance slightly) 2018-12-23 22:49:43 +00:00
Sauilitired
2ede77318a
Add dordsor21 to author list 2018-12-23 20:32:48 +01:00
Sauilitired
5c678e86bb
Fix configuration loading issues 2018-12-23 20:31:29 +01:00
Sauilitired
02937cc543
Add configuration conversion and fix BukkitLegacyMappings 2018-12-23 19:43:36 +01:00
Sauilitired
165cac8b13
Fix bStats problem and commit Setup progress 2018-12-23 17:38:27 +01:00
MattBDev
25b34b419f Merge remote-tracking branch 'origin/breaking' into breaking 2018-12-21 23:48:18 -05:00
MattBDev
c1fa6c842d Removing old Metrics class
We don't need any fancy metrics at the moment. They can be added later if needed.
2018-12-21 23:38:01 -05:00
Sauilitired
7900a95b25
Implement LegacyConverter 2018-12-21 22:55:47 +01:00
Sauilitired
fe12d03916
Remove unused classes. 2018-12-21 21:28:33 +01:00
sauilitired
23b9eca4ab Add bStats support, seeing as mcstats has been down for ages 2018-12-21 21:10:37 +01:00
sauilitired
3c48488c61 Merge remote-tracking branch 'origin/breaking' into breaking 2018-12-21 17:49:15 +01:00
sauilitired
dff64c5c68 Add support for 1.13 blocks 2018-12-21 17:49:04 +01:00
dordsor21
886081e27f The local build was a fluke, and I couldn't work it out in the last 3 hours, so here are some basic updates/cleanup to a few things, and an updated bui;d command in README.md 2018-12-21 16:26:19 +00:00
dordsor21
e757c3e13c Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2018-12-21 13:39:27 +00:00
dordsor21
5fdb60f85d Default plot height is at sea level (62) 2018-12-21 13:39:20 +00:00
dordsor21
aaed3f622a Fix build for gradlew clean assemble build 2018-12-21 13:38:28 +00:00
sauilitired
130274de86 Fix multiverse setup and don't allow unsafe blocks in setup 2018-12-21 03:31:08 +01:00
dordsor21
8bc0bcd9e6 Update BukkitUtil#isBlockSolid to 1.13 2018-12-21 01:04:37 +00:00
dordsor21
28f3be56b3 Fix schematic creation
Seems fairly ugly, but only because the format requires the blocks be inputted in that exact order, and it prevents us from having to cache the blocks per chunk to then insert into the relevant tags.
2018-12-21 00:49:15 +00:00
dordsor21
c53cd1ec91 oops 2018-12-20 23:34:55 +00:00
dordsor21
90682e9f8b Various:
- Some minor cleanup
 - Test for null id, not for null PlotBlock
 - Small fixes to schematic saving (still broken)
2018-12-20 23:33:24 +00:00
sauilitired
341e386df8 Delete Collection getBlocks to Array getBlocks 2018-12-20 21:46:00 +01:00
sauilitired
f4140ae728 Add getBlockArray() method 2018-12-20 21:40:50 +01:00
dordsor21
1021c6f2b0 Use Math.min and Math.max 2018-12-20 20:25:21 +00:00
dordsor21
780d3d7703 *Don't set the the cuboid block by block if we've already technically done that 2018-12-20 20:23:11 +00:00
dordsor21
6ac7948f72 Pretty basic fix for chunk generation 2018-12-20 20:20:31 +00:00
dordsor21
4e10682748 A few minor fixes 2018-12-20 18:46:52 +00:00
sauilitired
096ad1febe Make sure that blocks are actually compiled. Whoopsie 🐮 2018-12-20 19:35:02 +01:00
dordsor21
1543ac50cd Various:
- Empty StringPlotBlocks are air
 - Update signs to 1.13
 - Fix getting material in BukktiLocalQueue#setMaterial
2018-12-20 17:20:13 +00:00
dordsor21
442473368d This slipped through 2018-12-20 12:26:51 +00:00
dordsor21
b35221bf4f Fix crashing on chunk load (chunks are still empty though) 2018-12-20 12:23:49 +00:00
sauilitired
568b4c8e85 Merge remote-tracking branch 'origin/breaking' into breaking
# Conflicts:
#	Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/generator/BukkitPlotGenerator.java
#	Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java
2018-12-20 02:25:55 +01:00
sauilitired
e939b8237e Changelist:
- Added aliases for custom configuration types
- Removed numerical ID based methods in Block Queues
- Fixed sign removal in Plot.java
- (Hopefully) fixed dividing by 0 errors in BlockBucket
- Removed random from some methods, as blockbucket has it's own random
- Temporarily removed chunk analysis
- Changed a lot in GenChunk and BukkitPlotGenerator
2018-12-20 02:23:48 +01:00
dordsor21
ffe5cddead 1.13.2 spigot dependancy 2018-12-20 01:05:10 +00:00
dordsor21
821e828f07
Merge pull request #2190 from IntellectualSites/master
Merge
2018-12-20 00:58:44 +00:00
dordsor21
2596f37f66
Merge branch 'breaking' into master 2018-12-20 00:58:28 +00:00
dordsor21
cbc2b70336 Merge commit 'be485075993f8dc807595c524f58c3bb58156a0c' into breaking
# Conflicts:
#	README.md
2018-12-20 00:55:44 +00:00
dordsor21
5aac7d07d2 Remove abstraction of BukkitSchematicHandler 2018-12-20 00:47:04 +00:00
dordsor21
ee6d52efa3 Update all legacy IDs 2018-12-20 00:43:47 +00:00
dordsor21
adc2d980f4 Clean up listeners for legacy versions 2018-12-19 23:49:35 +00:00
dordsor21
11ccfe7ac4 Reformat code 2018-12-19 23:26:20 +00:00
dordsor21
fa2dbb2b89 Update to WorldEdit 7 (and WE7-compatible schematics, *hopefully keeping legacy*) 2018-12-19 23:18:57 +00:00
dordsor21
e7b25d3fc8 Update BukkitLocalQueue to new LegacyMappings 2018-12-19 18:46:30 +00:00
sauilitired
444222c7f9 Improve PlotBlock name matching 2018-12-19 18:36:50 +01:00
sauilitired
e724aa8caf Fix PlotItem. 2018-12-19 18:24:35 +01:00
sauilitired
8f23299e7d Use BlockBuckets everywhere. 2018-12-19 17:19:54 +01:00
dordsor21
361cc9e9f7 Remove old LegacyMappings class from Bukkit
Add "fromAny" method
2018-12-19 15:08:49 +00:00
dordsor21
865de73a83
Merge pull request #2189 from dordsor21/breaking
Refactor legacy mappings to use PlotBlocks
2018-12-19 14:54:55 +00:00
dordsor21
531d8cc706
Merge branch 'breaking' into breaking 2018-12-19 14:54:32 +00:00
dordsor21
4b02bb1df8 Refactor legacy mappings to use PlotBlocks 2018-12-19 14:52:15 +00:00
sauilitired
1d3270d869 BlockBuckets r cool 🐮 2018-12-19 00:01:13 +01:00
NotMyFault
3be23a3d37 Switching from IRC to Discord
To offer us a better possibility to help you regarding issues or bugs, join us on discord https://discord.gg/ngZCzbU
2018-12-18 21:27:30 +01:00
sauilitired
af9418552a Whoops. 2018-12-18 20:58:52 +01:00
sauilitired
10b87f5728 Add mappings for pre initialized items 2018-12-18 20:56:55 +01:00
sauilitired
ccad0bced9 Progress. 2018-12-18 20:54:20 +01:00
sauilitired
fb7bcef05f 1.13 shizzle 2018-12-17 20:57:21 +01:00
dordsor21
b9482fe5b4 Possible fix for FAWE build failures 2018-12-17 13:16:53 +00:00
NotMyFault
be48507599
Merge pull request #2188 from N0tMyFaultOG/master
Adding French translation
2018-12-12 16:15:12 +01:00
NotMyFault
8ad75efa0e Adding French translation 2018-12-12 16:12:40 +01:00
sauilitired
820710721e Schematic list command 2018-12-06 18:01:33 +01:00
sauilitired
152e9e0e90 Make it build. 2018-12-06 16:59:10 +01:00
sauilitired
3fc7fb0a7a Bump version (PlotSquared 4 will be new release) 2018-12-06 16:53:21 +01:00
sauilitired
18e969227c Update lombok version build. Disable Sponge and Nukkit builds. 2018-12-06 16:49:49 +01:00
NotMyFault
0252cf724a
Adding JavaDocs, Maven Repo and API Documentation 2018-11-15 14:02:31 +01:00
sauilitired
4395ca06b4 Add @SuppressWarnings("unused") to listeners. 2018-11-15 00:12:12 +01:00
sauilitired
a4a923c23c Extract duplicated switch statement in EntityUtil 2018-11-15 00:08:32 +01:00
sauilitired
06f64aeff0 Extract duplicated method declaration 2018-11-15 00:06:20 +01:00
sauilitired
a8b4729845 Rename DBFunc#everyone to DBFunc#EVERYONE, and create two string constants 🐱 2018-11-14 23:51:56 +01:00
sauilitired
3c64376abe Fix guest gamemode flag. 2018-11-14 23:40:27 +01:00
dordsor21
8cd54929e7 Merge branch 'master' into breaking
# Conflicts:
#	Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/events/PlotRateEvent.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitEventUtil.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Add.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Delete.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Kick.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Load.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Music.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Owner.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Rate.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Reload.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SchematicCmd.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trust.java
#	Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/GameModeFlag.java
#	Core/src/main/java/com/intellectualcrafters/plot/commands/Clear.java
#	Core/src/main/java/com/intellectualcrafters/plot/commands/PluginCmd.java
#	Core/src/main/java/com/intellectualcrafters/plot/commands/Relight.java
#	Core/src/main/java/com/intellectualcrafters/plot/commands/SetHome.java
#	Core/src/main/java/com/intellectualcrafters/plot/config/C.java
#	Core/src/main/java/com/intellectualcrafters/plot/config/Configuration.java
#	Core/src/main/java/com/intellectualcrafters/plot/config/Settings.java
#	Core/src/test/java/com/github/intellectualsites/plotsquared/plot/util/EventUtilTest.java
#	Nukkit/src/main/java/com/plotsquared/nukkit/util/NukkitEventUtil.java
#	README.md
#	Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/events/PlotRateEvent.java
#	Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/SpongeSchematicHandler.java
#	Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/util/block/SpongeLocalQueue.java
#	Sponge/src/main/java/com/plotsquared/sponge/util/SpongeEventUtil.java
2018-11-14 14:44:07 +00:00
sauilitired
8df7f63931 Refactor PS (and rename to PlotSquared) 2018-11-14 14:19:57 +01:00
sauilitired
16dbbe5244 Refactoring of PS#getPlots:
Initialize to HashSet rather than ArrayList, because of add in HashSet
is O(1) vs. add in ArrayList which is O(n). Also make the wrapping
set immutable.
2018-11-14 13:52:09 +01:00
NotMyFault
ae2869a29b Translation update and fixing wrong lines 2018-11-05 16:00:44 +01:00
NotMyFault
40e7df8d69
Merge pull request #2142 from dordsor21/master
Cancel plot chat if message event is cancelled to allow for swear block/etc
2018-10-25 12:11:46 +02:00
dordsor21
ea5ffbeb77 Cancel plot chat if message event is cancelled to allow for swear block/etc 2018-10-25 10:51:18 +01:00
NotMyFault
302051a6ca Minor cleanup 2018-10-20 14:03:21 +02:00
Jesse Boyd
b6d4872ca4
Merge pull request #2102 from dordsor21/master
Add PlotChangeOwner Event
2018-10-13 15:11:45 +11:00
NotMyFault
4b7ca2ff37
Minor cleanup 2018-10-10 18:29:21 +02:00
NotMyFault
e4e4694a1c
Merge pull request #2127 from Leomixer17/patch-1
Delete chinese.yml
2018-10-10 18:07:07 +02:00
Leomixer17
ba6818a5bd
Delete chinese.yml 2018-10-10 17:27:29 +02:00
NotMyFault
1734c0e357
Rename ko_KR.yml to ko-KR.yml 2018-10-10 16:52:35 +02:00
NotMyFault
e2e34f24d6
Rename zh_CN.yml to zh-CN.yml 2018-10-10 16:51:43 +02:00
NotMyFault
765db2df0c
Added languages 'back' 2018-10-10 16:49:31 +02:00
NotMyFault
e1e6d95f75
Merge pull request #2049 from f0rb1d/master
Updated Simplified Chinese translation and formalized language codes.
2018-10-10 16:40:52 +02:00
NotMyFault
70584a338c
Update PS.java 2018-10-10 16:38:01 +02:00
NotMyFault
11e2777f60
Update PS.java 2018-10-10 16:36:14 +02:00
NotMyFault
b6303a7615
Update PS.java 2018-10-10 16:33:03 +02:00
NotMyFault
88e80f54f7
Updating locale names 2018-10-10 16:30:38 +02:00
NotMyFault
c6f8a6ddc1
Merge pull request #2088 from N0tMyFaultOG/master
Minor translation and template changes
2018-10-10 15:13:55 +02:00
dordsor21
9e9b21779c Add PlotChangeOwner Event 2018-09-19 16:57:33 +01:00
Jesse Boyd
eab918bcd4
minor sponge cleanup 2018-09-10 07:46:56 +10:00
Jesse Boyd
2e7d95f5a6
Fix sponge schem save 2018-09-10 07:45:00 +10:00
Jesse Boyd
906f16d075
Fixes #2092 2018-09-10 06:38:22 +10:00
NotMyFault
979b3c0408
Added bridge template and korean translation 2018-09-03 00:04:32 +02:00
NotMyFault
5b2428559a
Bridge template from the spigot page 2018-09-03 00:02:07 +02:00
NotMyFault
f001eebad4
Update Settings.java 2018-09-02 23:51:45 +02:00
Jesse Boyd
f5a981fda7
Fix plot visit sorting 2018-08-24 06:47:16 +10:00
sauilitired
032484b0f5 Pull out duplicated method sub in BukkitPlayer 2018-08-20 12:15:03 +02:00
sauilitired
587c942d88 Suppress PlotAPI warnings 2018-08-20 11:36:59 +02:00
sauilitired
e98c648244 Move PlotAPI to Core and move bukkit specific methods to BukkitUtil. 2018-08-20 11:35:41 +02:00
sauilitired
be9fb3bd3a Remove deprecated methods without internal use. 2018-08-20 11:05:00 +02:00
sauilitired
01a927ccad Allow PlotRateEvent to be cancelled. Fixes #2017 2018-08-19 23:12:59 +02:00
sauilitired
3c86531b58 * ;) 2018-08-19 22:21:42 +02:00
sauilitired
847ce7f20d (W.I.P) TeleportEntityWrapper as alternative to replicating entity wrapper 2018-08-19 22:18:58 +02:00
Jesse Boyd
4b8c434669
Fix compile (var must be final) 2018-08-12 21:36:04 +10:00
Alexander Söderberg
9105294965
Update auto-comment.yml 2018-08-11 15:48:33 +02:00
Alexander Söderberg
5378c9007c
Create auto-comment.yml 2018-08-11 15:43:36 +02:00
Alexander Söderberg
40e91de111
Create stale.yml 2018-08-11 15:38:22 +02:00
Alexander Söderberg
b1246adac2
Update README.md 2018-08-11 15:29:31 +02:00
Alexander Söderberg
86e7f4e2b3
Update ISSUE_TEMPLATE.md 2018-08-11 15:28:41 +02:00
sauilitired
af461e1fc2 Add alternative maven link and re-enable gradle daemon 2018-08-10 23:41:31 +02:00
sauilitired
d9bc1fcfe7 Disable daemon (temporarily) to allow for CI builds to not run out of memory. 2018-08-10 23:38:28 +02:00
sauilitired
369ccb7c8d Prettify BukkitUtil 2018-08-10 20:54:17 +02:00
sauilitired
724fb34b1f Prettify BukkitMain 2018-08-10 20:46:38 +02:00
sauilitired
2898e9ae2b Fix error from refactoring 2018-08-10 20:30:05 +02:00
sauilitired
b551424ced Update gradle 2018-08-10 20:29:50 +02:00
sauilitired
b0348cfc34 Update packages. This will not be appreciated 🐱 2018-08-10 17:53:15 +02:00
sauilitired
1646cd0f5a Reformat code 2018-08-10 17:01:11 +02:00
sauilitired
02ee1e8fa1 Update README.md and commit code style 2018-08-10 16:52:35 +02:00
Alexander Söderberg
a2813a2427
Merge pull request #2057 from IntellectualSites/Sauilitired-patch-1
Remove unnecessary lines in Configuration javadoc
2018-08-10 16:05:06 +02:00
Alexander Söderberg
bbcd508bc3
Remove unnecessary lines in Configuration javadoc 2018-08-10 16:04:43 +02:00
F0rb1d
a4f176fd07 Updated Simplified Chinese translation and formalized language codes. 2018-08-03 20:35:36 +08:00
Jesse Boyd
3d8d75170d
Check admin for setowner null 2018-07-31 14:28:22 +10:00
Jesse Boyd
2c11a292f4
Prevent multiple uses of plot auto 2018-07-29 21:43:07 +10:00
Jesse Boyd
cd9d22cb9b
Fix augmented generator not clearing column 2018-07-27 14:02:40 +10:00
Jesse Boyd
645c5fb529
Fix nukkit augmented generator 2018-07-27 13:25:46 +10:00
Jesse Boyd
2d98da47cf
Debug generator error 2018-07-27 10:57:34 +10:00
Jesse Boyd
1b08d54be0
Merge pull request #2029 from Speentie8081/master
Add support for spigot 1.13 and spigot 1.13-pre7
2018-07-27 10:37:51 +10:00
Speentie8081
be8172ce91 Assume spigot 1.13 if NumberFormatException is fired 2018-07-22 09:17:38 -05:00
Speentie8081
768e21d1b5 Update NBTFactory to support spigot 1.13 2018-07-22 09:09:39 -05:00
Speentie8081
bbee2debff Remove unneeded changes and add back support for 1.9 through 1.12 2018-07-21 10:32:38 -05:00
Speentie8081
d5b01aced2 Use MaterialData instead of block id and data for chunk generation 2018-07-21 00:15:13 -05:00
Speentie8081
f533efb2c8 Add support for spigot 1.13-pre7 2018-07-20 23:51:09 -05:00
Jesse Boyd
aaa70888bd
Merge pull request #2028 from PhanaticD/patch-3
fix dispensers
2018-07-21 12:40:54 +10:00
Josh
d673537026
fix dispensers
previously dispensers were not working at all, this change blocks lava and water and allows dispensers to function normally again on servers with plotsquared. if you were trying to block dispensers launching items into the road however that still is not blocked by this
2018-07-20 19:23:39 -04:00
Jesse Boyd
ae1e58c0ac
Add -f override for plot move 2018-07-07 09:22:24 +10:00
Jesse Boyd
5d04c64d48
Fix typo 2018-07-07 09:11:23 +10:00
Jesse Boyd
185fe39942
Fix check for UUID support 2018-07-07 08:50:43 +10:00
Jesse Boyd
18c92bea38
Allow specifying area for move command 2018-07-05 19:33:17 +10:00
Jesse Boyd
79e1ea9a8f
* 2018-06-23 14:13:06 +10:00
Jesse Boyd
1772fdab16
Fixes #1988 2018-06-23 14:12:21 +10:00
Jesse Boyd
9020d740d1
Revert "possible fix for mob damage"
This reverts commit df6914fb1e526c7433c3cfc8d2996214d1d6fbb5.
2018-06-23 11:46:19 +10:00
Jesse Boyd
df6914fb1e
possible fix for mob damage 2018-06-21 07:48:45 +10:00
Jesse Boyd
da5478f141
Only check int flag ranges 2018-06-20 07:48:51 +10:00
Jesse Boyd
d454602888
Fixes #1961 2018-06-19 03:44:45 +10:00
Jesse Boyd
3039331976
Add account age expiry filter 2018-06-19 03:29:14 +10:00
Jesse Boyd
6ed6f607b5
Sort flag list alphabetically 2018-06-13 09:28:32 +10:00
Jesse Boyd
37b0cdeace
Revert "Don't cancel chat event"
This reverts commit dc5fc5af4762ef0ee4a1b8658729e232b70207cc.
2018-06-10 19:35:34 +10:00
Jesse Boyd
9897890e6a
*Add console sender to nukkit chat 2018-06-09 15:49:54 +10:00
Jesse Boyd
ce3e3be59e
Tweak nukkit plot chat 2018-06-09 15:37:49 +10:00
Jesse Boyd
9ed5847c0a
Fixes #1768 2018-06-09 06:20:31 +10:00
Jesse Boyd
dc5fc5af47
Don't cancel chat event 2018-06-09 05:45:25 +10:00
Jesse Boyd
eca67c7d84
Merge pull request #1986 from dualspiral/bugfix/null-suggestions
Fix errors with tab completion on Sponge.
2018-06-09 05:11:27 +10:00
Daniel Naylor
c7a1526e12 Fix errors with tab completion on Sponge.
Fixes #1768
2018-06-08 11:17:02 +01:00
Jesse Boyd
740de4932b
Fix flag perm check 2018-06-07 12:30:39 +10:00
Jesse Boyd
442513b592
Fixes #1970 2018-06-07 08:15:28 +10:00
Jesse Boyd
40635255e3
Probably fixes #1953 2018-05-18 14:48:17 +10:00
Jesse Boyd
550df7f232
Fixes #1952 2018-05-17 17:46:54 +10:00
Jesse Boyd
4ffc4e67ab
Fixes #1822 2018-05-17 16:30:31 +10:00
Jesse Boyd
d6c472fcdf
Fixes #1484 2018-05-17 16:23:27 +10:00
Jesse Boyd
a83b51eb12
Fixes #1951 2018-05-17 15:21:53 +10:00
Jesse Boyd
67a70d4ade
Fixes #1928 2018-05-17 15:17:45 +10:00
Jesse Boyd
f479a70594
Fixes #1729 2018-05-17 15:11:44 +10:00
Jesse Boyd
9f9527d2e2
Fixes #1784 2018-05-17 14:53:34 +10:00
Jesse Boyd
98b7a84119
Fixes #1483 2018-05-17 14:50:47 +10:00
Jesse Boyd
5cb94f3e45
Fixes #1928 2018-05-17 14:43:51 +10:00
Jesse Boyd
ecf94b8706
minor web tweaks 2018-05-13 10:32:48 +10:00
Jesse Boyd
3006e941ba
Merge pull request #1943 from N0tMyFaultOG/patch-3
Update, rework and redesign of the german.yml
2018-05-12 09:25:42 +10:00
NotMyFault
244ccb71cf
Update of german.yml
german.yml design has been reworked to the up-to-date PlotSquared language file design. Many lines were added and adjusted.
2018-05-11 20:37:50 +02:00
Jesse Boyd
2d617fc05e
Merge pull request #1942 from N0tMyFaultOG/patch-2
Typo fixes
2018-05-11 11:36:49 +10:00
NotMyFault
e13785edfe
Typo fixes
Had to write some custom messages for a server and fixed the typos in here
2018-05-11 00:03:35 +02:00
Jesse Boyd
59e06c2319
Fixes #1929 2018-05-07 10:44:16 +10:00
Jesse Boyd
9a7ce84e1c
Potentially fixes #1769 2018-05-07 10:20:13 +10:00
Jesse Boyd
ef54775ca7
wtf, this has its own spawn reason, thanks spigot
Fixes #1803
2018-05-07 10:15:21 +10:00
Jesse Boyd
d49bfa612e
Merge pull request #1933 from Leomixer17/patch-1
Update italian.yml
2018-05-02 00:52:53 +10:00
Jesse Boyd
72f30d8aef
usernames can be 2 characters 2018-05-02 00:43:27 +10:00
Leomixer17
ef6b1cb932
Update italian.yml 2018-05-01 01:29:18 +02:00
Jesse Boyd
154bad6188
* 2018-04-28 21:53:39 +10:00
Jesse Boyd
613d79fb39
Fixes #1691 2018-04-28 21:51:26 +10:00
Jesse Boyd
5f9bd853ec
Fixes #1903 2018-04-28 09:41:09 +10:00
Jesse Boyd
ef83b5a1b7
Fixes #1931 2018-04-28 09:28:55 +10:00
Jesse Boyd
9fe1e53d9d
Fix single generator biomes 2018-04-15 10:47:00 +10:00
Jesse Boyd
4f63cdf560
Fixes #1920 2018-04-13 20:37:28 +10:00
Jesse Boyd
7f257e2bf3
* 2018-04-12 00:20:13 +10:00
Jesse Boyd
c5b332246e
Fix setblock npe 1.8 2018-04-11 23:41:09 +10:00
Alexander Söderberg
0c7be7e11d
Merge pull request #1915 from Foorack/master
Fix maven compilation
2018-04-09 17:05:27 +02:00
Foorack
c5a30bd708 Filter Core resources 2018-04-07 20:52:31 +02:00
Foorack
90c3fac4fa Fix PlotVersion when compiling with Maven 2018-04-07 20:52:19 +02:00
Foorack
e4f6c39bb7 Fix Maven compiling 2018-04-07 12:05:37 +02:00
Jesse Boyd
39084be791
Fix nukkit compile 2018-03-19 16:05:12 +11:00
Jesse Boyd
ded33aa9be
Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2018-03-18 09:28:36 +11:00
Jesse Boyd
3565e67137
Prevent entity portal use from plotworld 2018-03-18 09:28:23 +11:00
Jesse Boyd
0e5483c050
Merge pull request #1901 from bibo38/nlfix
Fixed wrong newlines in german language file
2018-03-17 15:24:39 +11:00
bibo38
fb706e0d60 Fixed wrong newlines in german language file 2018-03-16 18:07:29 +01:00
Jesse Boyd
368b9a0168
Fixes #1786 2018-03-15 16:34:28 +11:00
Jesse Boyd
c208c530ff
Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2018-03-12 17:27:00 +11:00
Jesse Boyd
b36d42811a
Fixes #1897 2018-03-12 17:26:40 +11:00
Jesse Boyd
5921e1865b
Merge pull request #1895 from BrainStone/master
using newer MySQL driver
2018-03-12 17:23:27 +11:00
BrainStone
515405aa9e using newer MySQL driver
- Newer driver doesn't need manual loading
- Fixes #1783
2018-03-10 21:34:11 +01:00
Jesse Boyd
8f5e2eb439
Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2018-03-08 08:37:36 +11:00
Jesse Boyd
5b18b918a9
Ignore unsupported statement isClosed 2018-03-08 08:37:17 +11:00
dordsor whitwell
7dcb85d5d4
Fix typo in database update error message 2018-03-07 21:02:19 +00:00
Jesse Boyd
1cd30b84d5
check for closed connections 2018-02-15 23:12:42 +11:00
Jesse Boyd
eb1c3263ec
Fix deny-exit flag 2018-02-15 18:59:40 +11:00
Jesse Boyd
c98f2b4261
update to latest nukkit 2018-02-13 02:16:13 +11:00
Jesse Boyd
d9a17bd379
Fixes #1872 2018-02-08 19:48:40 +11:00
Jesse Boyd
c5d5b52df4
Tweak item drop check 2018-02-08 19:42:36 +11:00
Jesse Boyd
73d0068d07
Update to latest nukkit 2018-02-02 15:19:58 +11:00
Jesse Boyd
4b50276ba0
Fixes #1844 2018-01-31 13:05:11 +11:00
Jesse Boyd
8815c83ba1
Various minor
Teleport on login fixes
World unloading fixes
2018-01-27 16:26:09 +11:00
Jesse Boyd
c5778137f6
Update asm 2018-01-25 17:46:41 +11:00
Jesse Boyd
d22c0349f7
* 2018-01-25 15:32:25 +11:00
Jesse Boyd
785ba10ca1
Update to latest sponge 2018-01-25 14:51:39 +11:00
Jesse Boyd
0e183f5627
Fixes #1839 2018-01-13 12:47:02 +11:00
Jesse Boyd
b239cb4a18
Fixes #1828 2018-01-10 17:50:38 +11:00
Jesse Boyd
02b358133e
Better idea, send the packet. Closes #1837 2018-01-10 17:39:12 +11:00
Jesse Boyd
4f464439e5
* 2018-01-10 17:22:46 +11:00
Jesse Boyd
4716104951
Revert broken changes to visit 2018-01-10 17:15:05 +11:00
Jesse Boyd
bc8b2af164
Fixes #1774 (backwards compatibility) 2018-01-10 17:06:35 +11:00
Jesse Boyd
03337fe080
Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2018-01-10 16:58:42 +11:00
Jesse Boyd
4ff02831f3
Fixes #1767 (performance issue) 2018-01-10 16:58:37 +11:00
Jesse Boyd
09e83bcbf8
Merge pull request #1793 from Leomixer17/patch-3
Update italian.yml
2018-01-10 16:50:17 +11:00
Jesse Boyd
57ae3945d7
Merge pull request #1836 from PhanaticD/patch-1
nukkit world height is 256
2018-01-10 16:45:52 +11:00
Jesse Boyd
17e4c1ec60
Update NukkitMain.java 2018-01-10 16:45:41 +11:00
Josh
b9a4f2256e
Update NukkitMain.java 2018-01-10 00:44:38 -05:00
Jesse Boyd
5ddefcea22
when PlayerQuitEvent is never called 2018-01-04 19:24:00 +11:00
Leomixer17
47314ce00d
Update italian.yml 2017-12-10 15:28:35 +01:00
Leomixer17
452bf593e0
Update italian.yml 2017-12-10 14:35:43 +01:00
Leomixer17
a9bd6566b7
Update italian.yml 2017-12-10 12:53:22 +01:00
Christian Langel
59557cf889 improvements: Message for visit Command to a players without plots (#1796)
We provide now a clear message if we are sure that the Visit command means a player but we dont found any claimed plots for this player.

This is helpful if we try teleport to  a numeric named player

See this related tickets: #1691, #1778
2017-12-09 11:08:15 +01:00
Leomixer17
48bdfd75e5
Update italian.yml 2017-12-07 19:50:02 +01:00
Alexander Söderberg
6c06e48a1f
Merge pull request #1792 from Opachl/PS-#1791
fix: p visit issue in latest builds
2017-12-07 08:54:36 +01:00
Opachl
70a82d9fc6 fix: p visit issue in latest builds
p visit issue in latest builds #1791
2017-12-06 21:40:26 +01:00
Leomixer17
61e045aa50 Update italian.yml (#1789) 2017-12-04 17:02:11 +01:00
Alexander Söderberg
d373a4dafa
Merge pull request #1787 from Leomixer17/patch-1
Improved the italian translation
2017-12-03 22:47:16 +01:00
Leomixer17
9daf13c897
Update italian.yml 2017-12-03 21:13:39 +01:00
Christian Langel
7d39d09317 fix: remove plot-alias with "/p alias" (#1779)
* fix: remove plot-alias with "/p alias"

remove plot-alias with "/p alias" #1718

* Apply requested Review Changes

Restored the original Permisson to keep backwards compatibility
Clean unused imports.

* added some improvements after testing

added some improvements after testing
2017-12-03 17:59:36 +01:00
Christian Langel
3779b17720 fix: shulker-teleport in a other plot (#1774)
- shulker-teleport in a other plot (Fixes #1762)
 - dropper can't drop lava_bucket and water_bucket  (Fixes #1775)
2017-12-03 17:21:15 +01:00
Christian Langel
06208696db fix: numeric Playernames thows NumberFormatException on Teleport (#1778)
* fix: numeric Playernames thows NumberFormatException on Teleport

Refactoring of the Teleport Handling

Supports now:
     * p h xPlotPlayerGuy [PAGE] = Player  [numeric] [alphanumeric]
     * p h MyPlantage      [PAGE] = Alias    [numeric] [alphanumeric]
     * p h PlotworldLarge [PAGE] = World  [numeric] [alphanumeric]
     * p h 1:1		       [PAGE] = plotId  [numeric (1,1|1;2) ]
     * p h 4		                   = 4 th Plot of the Player if available  [numeric (1,1|1;2) ]
Check order: Player, Alias, World, PlotId, Page [PAGE]
[PAGE] is optional

* Apply suggested Code Style

Changes:
Collections now empty instead of null.
Property renaming
2017-12-03 17:15:09 +01:00
Alexander Söderberg
f27b12a211
Merge pull request #1767 from Opachl/master
fix: no wether update after "/p flag remove weather"
2017-11-18 14:15:29 +01:00
Opachl
9413ce0880 fix: no wether update after "/p flag remove weather"
no wether update after "/p flag remove weather" #1723
2017-11-15 11:14:14 +01:00
Jesse Boyd
734c4bb5fe
Fix vehicle deletion 2017-11-14 17:24:02 +11:00
Jesse Boyd
6b7adcdf34
Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2017-11-14 17:10:05 +11:00
Jesse Boyd
a752780eeb
Minor fixes
Update message color
CME on plot action
Creative middle click banner/head
2017-11-14 17:09:51 +11:00
Jesse Boyd
01fafc3be4
Merge pull request #1766 from Opachl/master
fix: Interaction flag with item_frame #1761
2017-11-13 16:13:19 +11:00
Opachl
c281620d75
Update PlayerEvents.java
added missing import
2017-11-12 17:49:14 +01:00
Opachl
c3f93a1960 fix: Interaction flag with item_frame
Interaction flag with item_frame #1761
2017-11-12 17:36:58 +01:00
Opachl
b4e8d782a1 Revert "fix: nteraction flag with item_frame"
This reverts commit a2eb727e257e09a5d7df6b440ca14f8a0d613709.
2017-11-12 17:35:59 +01:00
Opachl
a2eb727e25 fix: nteraction flag with item_frame
nteraction flag with item_frame #1761
2017-11-12 17:34:50 +01:00
Jesse Boyd
6e9c103b55
Fix typo 2017-11-12 13:32:09 +11:00
Jesse Boyd
cbf7956a32
Add gradle jar 2017-11-12 12:49:19 +11:00
Jesse Boyd
6e841543b8
Closes #1731 2017-11-09 10:57:17 +11:00
Jesse Boyd
585f1b75a1
Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2017-11-09 10:18:58 +11:00
Jesse Boyd
534d627b05
Fixes #1732 2017-11-09 10:18:52 +11:00
Jesse Boyd
fe534bccbe
Merge pull request #1753 from Leomixer17/patch-1
Improved italian translation
2017-11-09 10:16:37 +11:00
Jesse Boyd
37f1da0715
Various minor
VehicleMoveEvent
- Move KillRoadVehicles code there
- Fix for pre-1.12
Fix auto merge being disabled
2017-11-09 10:15:16 +11:00
Jesse Boyd
515aca5f06
Merge pull request #1757 from IntellectualSites/FixVehicles
Implement VehicleMoveEvent for Bukkit.
2017-11-08 11:59:46 +11:00
Alexander Söderberg
530803c738 Implement VehicleMoveEvent for Bukkit. This fixes #1754. It also makes sure that you cannot use
vehicles to enter plots that you're denied from.
2017-11-06 22:01:18 +01:00
Leomixer17
faa24bbdf4
Update italian.yml 2017-11-04 21:36:03 +01:00
Jesse Boyd
5b6d5664e4
Fix fireworks being spawnable in other plots 2017-11-03 06:58:57 +11:00
Jesse Boyd
22429fc3e0
Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2017-10-31 23:26:18 +11:00
Jesse Boyd
7e2a911530
Closes #1750 2017-10-31 23:26:08 +11:00
Jesse Boyd
7b04ec9ff3
Merge pull request #1746 from Gabscap/fix-location_equals
Fix Location.equals
2017-10-29 21:08:58 +11:00
Jesse Boyd
097159d606
Fix wrong sign height 2017-10-23 18:23:37 +11:00
Gabscap
04bfe73c29 Fix Location.equals 2017-10-20 14:23:35 +02:00
Jesse Boyd
d4614007ae
Fixes #1743 2017-10-14 20:52:35 +11:00
Jesse Boyd
9480c70655
Save world before download 2017-09-30 00:28:39 +10:00
Jesse Boyd
8b6cc7a193
* 2017-09-29 23:23:40 +10:00
Jesse Boyd
0d608245f5
Some tweaks / optimizations 2017-09-25 16:57:42 +10:00
Jesse Boyd
92f94ecedc
Tweaks
Use sign with plot schematic
Tweak world unloading
2017-09-24 00:13:05 +10:00
Jesse Boyd
2360782234
* 2017-09-23 20:09:34 +10:00
Jesse Boyd
1d20ae2777
allow air 2017-09-23 19:28:40 +10:00
Jesse Boyd
6b55b8cd67
Allow configuring a separate nonmember home position 2017-09-23 19:10:57 +10:00
Jesse Boyd
c645c4a6cb
* 2017-09-23 18:20:27 +10:00
Jesse Boyd
8e55860f77
Center plot schematic 2017-09-23 16:25:28 +10:00
Jesse Boyd
abfbeffbb0
Skip y=255, block when finding a free spot 2017-09-23 15:09:03 +10:00
Jesse Boyd
31908090b8
Buld height check 2017-09-23 14:07:52 +10:00
Jesse Boyd
d97ff94465
Various minor
Fix download world spawnpoint
Fix regenallroads on augmented world
Ensure all chunks have unloaded before unloading a world
2017-09-20 00:33:29 +10:00
Jesse Boyd
ce90b36d28
Wrap plot.schematic 2017-09-13 13:57:07 +10:00
Jesse Boyd
20d7a0eea2
Don't overwrite online player names from uuid cache 2017-09-06 19:49:57 +10:00
Jesse Boyd
24b3b60983
Might fix #1704 2017-09-01 23:11:37 +10:00
Jesse Boyd
17154ef1d5
idk why that wasn't working 2017-08-18 23:34:27 +10:00
Jesse Boyd
538e2a6002
Varios
Fixes #1697
Fixes #1689
2017-08-18 12:37:26 +10:00
Jesse Boyd
84a6a6daf4
Closes #1643 2017-08-10 17:24:59 +10:00
Jesse Boyd
a2324190bb
Fixes #1619 2017-08-10 17:18:35 +10:00
Jesse Boyd
af99c6a706
* 2017-08-10 17:15:03 +10:00
Jesse Boyd
c9cee8a4a8
Fixes #1504 2017-08-10 17:12:27 +10:00
Jesse Boyd
da51be20a3
Fix compile 2017-08-10 16:55:57 +10:00
Jesse Boyd
c808257b7c
Fixes #1668 2017-08-10 16:52:17 +10:00
Jesse Boyd
c3759f8963
Fixes #1672 2017-08-10 16:46:51 +10:00
Jesse Boyd
c36ef1d237
Fixes #1673
+ unrelated plotme conversion fix
2017-08-10 16:35:53 +10:00
Jesse Boyd
f49d43d6a3
Notify player when using an invalid purge argument 2017-08-10 16:11:50 +10:00
Jesse Boyd
cc1324f581
Fixes #1682 2017-08-09 15:45:27 +10:00
Jesse Boyd
ac9042bbe4
Various minor
New plugin updater and versioning
In game changelog
fix login teleporting
2017-08-09 15:05:13 +10:00
Jesse Boyd
b280644661 Delete build 2017-08-09 15:01:16 +10:00
Jesse Boyd
b924809c91
Fixes #1608 2017-08-03 23:13:04 +10:00
Jesse Boyd
a913983d99
Add plot leave 2017-07-25 06:39:59 +10:00
Jesse Boyd
3633576e03
Fix teleport for single plot worlds 2017-07-08 23:22:05 +10:00
Jesse Boyd
73318f23a1
Fixes #1660 2017-07-08 21:56:15 +10:00
Jesse Boyd
248751378b
Fixes #1661 2017-07-08 21:50:47 +10:00
Jesse Boyd
1918000668 Merge pull request #1645 from dordsor21/master
Lower TPS threshold please
2017-07-07 16:12:26 +10:00
Jesse Boyd
9037b74720
Closes #1659 2017-07-07 16:11:46 +10:00
Jesse Boyd
f6540bbfcb
bypass owner check for download 2017-06-29 15:38:37 +10:00
dordsor whitwell
507d0f19e4 Lower TPS threshold please 2017-06-24 16:11:52 +01:00
Jesse Boyd
355e16fe92
Ignore searching top block for teleportation 2017-06-09 17:43:46 +10:00
Jesse Boyd
2b1905889c
Minor sponge fix 2017-05-16 13:20:28 +10:00
Jesse Boyd
7ee67c8b41 Merge pull request #1599 from Gabscap/fix-min_height
Fix world.min_height setting
2017-05-03 14:58:16 +10:00
Gabscap
f8ab36b67c Fix world.min_height setting 2017-05-01 21:23:21 +02:00
Jesse Boyd
b5ef5df20d
* 2017-04-28 01:47:05 +10:00
Jesse Boyd
509b1f1c3d
Fixes #1593 2017-04-28 00:59:59 +10:00
Jesse Boyd
bfe98f3285
Some claiming fixes 2017-04-20 14:12:40 +10:00
Jesse Boyd
47915b8b86
Read sign on main thread 2017-04-20 01:09:52 +10:00
Jesse Boyd
3c110bb125
Fixes #1585 2017-04-18 22:55:04 +10:00
Jesse Boyd
a87fee1224 Merge pull request #1583 from manuelgu/patch-3
Added useSSL=false to JDBC connection URL
2017-04-17 22:28:20 +10:00
Jesse Boyd
757b9c695f
Fix compile 2017-04-17 19:11:55 +10:00
Jesse Boyd
193948d4fd
Fix claim 2017-04-17 11:56:10 +10:00
manuelgu
b616951e23 Added useSSL=false to JDBC connection URL
This is required according to MySQL 5.5.45+, 5.6.26+ and 5.7.6+.
2017-04-16 22:17:17 +02:00
Jesse Boyd
37977f1da4
Check database before claiming plot 2017-04-15 12:40:23 +10:00
Jesse Boyd
7eb7cd9b53
Ensure world loading occurs on the main thread 2017-04-11 01:49:01 +10:00
Jesse Boyd
ddfcc5b077
Player login tweaks 2017-04-10 09:06:44 +10:00
Jesse Boyd
9f6bf14649
Log when a plot is created/deleted 2017-04-09 17:10:23 +10:00
Jesse Boyd
f99994737c
Print error when failing to close database 2017-04-09 17:09:06 +10:00
Jesse Boyd
6e0ade4f63
Some sponge fixes 2017-04-07 08:25:08 +10:00
Jesse Boyd
c1a6c75ebe
* 2017-04-04 08:07:54 +10:00
Jesse Boyd
022372e9b7
Fixes #1534 + various
Auto world loading/unloading
Auto player teleporting on login
2017-04-04 07:59:36 +10:00
Jesse Boyd
3f54ba23c2
Fix world delete 2017-04-01 04:36:45 +11:00
The Gitter Badger
e8672df760 Add Gitter badge (#1565) 2017-03-27 12:03:33 -04:00
Jesse Boyd
5d6f4c6668
Some plot area restructuring 2017-03-23 11:10:29 +11:00
Jesse Boyd
a07ed4eafd
* 2017-03-18 00:50:43 +11:00
Jesse Boyd
5262ff665a
Fix door break 2017-03-18 00:49:41 +11:00
Jesse Boyd
1129a80329
Fixes #1510 2017-03-17 17:41:58 +11:00
Jesse Boyd
a628c5927f
Fixes #1560 2017-03-17 16:40:29 +11:00
Jesse Boyd
478ad9670b
Fixes #1476 2017-03-16 14:15:00 +11:00
Jesse Boyd
8e3407505a
Recover on database error
Might resolve #1476
2017-03-15 02:10:57 +11:00
Jesse Boyd
e208d7f72a
Fix mass purge 2017-03-15 01:28:02 +11:00
Jesse Boyd
b0df79bb80
Break up purge task 2017-03-15 00:16:27 +11:00
Jesse Boyd
411c75b219
Fixes #1556 Close #1555 2017-03-14 01:56:14 +11:00
Jesse Boyd
491cc50440
Fixes #1528 2017-03-13 18:45:37 +11:00
Jesse Boyd
e9723f5be1
Fixes #1532 2017-03-13 18:38:58 +11:00
Jesse Boyd
a015039dad
Fixes #1535
Set `misc_spawn_unowned`
2017-03-13 18:36:40 +11:00
Jesse Boyd
a0640a1e66
Fixes #1536 2017-03-13 18:12:38 +11:00
Jesse Boyd
0b6d2d3dd6
Fixes #1538 2017-03-13 18:07:48 +11:00
Jesse Boyd
ad11ad3472
Fixes #1517 2017-03-13 18:02:05 +11:00
Jesse Boyd
93717e670c
Use InteractBlockEvent
For some reason sponge was calling the event twice, the second with a
relative location, which makes no sense. Switching to a different event
works.
2017-03-13 17:34:44 +11:00
Jesse Boyd
38a33248e7
Send message on perm check 2017-03-13 09:04:40 +11:00
Jesse Boyd
52496af9a1
Fix road interact on sponge 2017-03-13 07:16:16 +11:00
Jesse Boyd
4d4950090d
Fix 1.7 block placer 2017-03-10 07:07:50 +11:00
Jesse Boyd
c8c144b6da
Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2017-03-08 16:51:29 +11:00
Jesse Boyd
e94adb04ea
Add maven repo
closes #1394
2017-03-08 16:51:01 +11:00
Jesse Boyd
395c1c743f Merge pull request #1537 from HexagonMC/master
Fix plot teleport.
2017-03-06 15:40:28 +11:00
Simon
b1fb01303d Fix plot teleport.
Fixes https://github.com/IntellectualSites/PlotSquared/issues/1302
2017-02-20 20:29:43 +01:00
Jesse Boyd
aa7b770c03
tweak highest block check 2017-01-31 16:45:02 +11:00
Jesse Boyd
e7990a06e2
Check player name for invalid character first 2017-01-30 19:42:16 +11:00
Jesse Boyd
88f5e5b0bc
Sort player names 2017-01-15 22:51:54 +11:00
Jesse Boyd
47db330764
Fix title global flag 2017-01-13 08:05:13 +11:00
Jesse Boyd
35ebc8c830
Permission check fix 2017-01-13 07:22:28 +11:00
Jesse Boyd
686a6c499f
Fixes #1502 2017-01-11 07:53:53 +11:00
Jesse Boyd
cb6d839214
Possible fix for #1476
Changes database load to prefer the latest entry over older ones.

Some previous changes may fix connections dropping, which resulted in
(incorrect) fixes being attempted by the plugin.
2017-01-11 07:21:36 +11:00
Jesse Boyd
6af96f43d4
Optimize schematic paste 2016-12-31 17:23:46 +11:00
Jesse Boyd
e3eccfd476
Fix debugpaste 2016-12-31 17:23:38 +11:00
Jesse Boyd
15d4b6d34b
Bump spigot version 2016-12-29 07:23:51 +11:00
Jesse Boyd
c3e2421d51 Merge pull request #1492 from c7w/master
Update s_chinese.yml
2016-12-25 17:32:36 +11:00
c7w
f7793f027c Update s_chinese.yml 2016-12-25 14:30:32 +08:00
Jesse Boyd
6ec96870c0
Fix SO 2016-12-23 15:33:19 +11:00
Jesse Boyd
a843203ca3
Merge remote-tracking branch 'origin/master'
# Conflicts:
#	Core/src/main/java/com/intellectualcrafters/plot/object/Plot.java
2016-12-15 17:42:51 +11:00
Jesse Boyd
3240fc9559
Exit plot on unclaim
Fixes #1471
2016-12-15 17:37:26 +11:00
Jesse Boyd
5fd1486cec Merge pull request #1478 from EvilOlaf/patch-2
Update ISSUE_TEMPLATE.md
2016-12-13 01:44:37 +11:00
Very Evil Olaf
d648148f51 Update ISSUE_TEMPLATE.md 2016-12-12 15:42:00 +01:00
MattBDev
d554dab8c8 Fix potential NPE with claiming 2016-12-10 14:33:48 -05:00
MattBDev
9ad45750ee Unclaiming a plot should call plotExit() 2016-12-09 20:58:05 -05:00
MattBDev
a554ae5633 Potential fix for commands 2016-12-09 16:58:32 -05:00
Jesse Boyd
7b1c4a5042
Check border when claiming a plot
Also fixes #1467
2016-12-10 01:09:07 +11:00
Jesse Boyd
9fc464e896
Shorter border teleportation 2016-12-10 00:44:42 +11:00
Jesse Boyd
bec11b244e
Use the correct plot id 2016-12-10 00:26:40 +11:00
Jesse Boyd
dc94418b51
Only expand border to current plot. 2016-12-09 23:52:48 +11:00
Jesse Boyd
72ab10c079
remove debug 2016-12-03 23:08:10 +11:00
Jesse Boyd
f50d32f06b
* 2016-12-02 17:17:16 +11:00
Jesse Boyd
6cc744a2e6
Fixes #1444 2016-12-02 17:16:19 +11:00
MattBDev
e40dc37f89 Fix versioning messup. 2016-12-01 21:56:19 -05:00
Jesse Boyd
7e34d9e20a
Fix title logic 2016-11-30 21:26:52 +11:00
Jesse Boyd
c891abce09
Allow added players to use frost walker
Properly fixes #1438
2016-11-30 20:46:48 +11:00
Jesse Boyd
2b561f2efa
Rename to ice-form 2016-11-30 19:06:03 +11:00
Jesse Boyd
dea0a452df
Add fading 1.11 titles 2016-11-30 16:28:50 +11:00
Jesse Boyd
81418b07a8
Fixes #1438 (unless other things call this event) 2016-11-30 16:15:20 +11:00
Jesse Boyd
a3c1ad3ec8
Fixes #1449 2016-11-30 16:10:08 +11:00
Jesse Boyd
7c6c19ba63
Fixes #740 2016-11-30 16:07:16 +11:00
Jesse Boyd
2e23ae0811
Fixes #1243 2016-11-30 16:00:47 +11:00
Jesse Boyd
28e7f5bc08
Fixes #1349
Non standard plot managers/areas not supported
2016-11-30 15:57:24 +11:00
Jesse Boyd
7a1417dc56
Fixes #1415 2016-11-30 15:45:28 +11:00
Jesse Boyd
e7fa9e01be
Fixes #1419 2016-11-30 15:43:23 +11:00
Jesse Boyd
93414d54c1
Fixes #1453 2016-11-30 15:41:08 +11:00
Jesse Boyd
5642fd3899
Fixes #1359
plots.chat.color
and
PLOT_CHAT_SPY_FORMAT
2016-11-30 15:36:13 +11:00
Jesse Boyd
f3d950f6e1
Fix flame enchant damaging entities 2016-11-30 15:03:48 +11:00
Jesse Boyd
95f8aaa2fe
this could be here? 2016-11-30 13:10:36 +11:00
Jesse Boyd
878010255c
Java 9 2016-11-28 18:02:03 +11:00
MattBDev
8edc357d01 Fixed #1448 2016-11-27 01:26:06 -05:00
MattBDev
588639d9c2 3.5.1 Start 2016-11-27 01:08:35 -05:00
1045 changed files with 85341 additions and 75273 deletions

387
.editorconfig Normal file
View File

@ -0,0 +1,387 @@
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 130
tab_width = 4
ij_continuation_indent_size = 8
ij_formatter_off_tag = @formatter:off
ij_formatter_on_tag = @formatter:on
ij_formatter_tags_enabled = false
ij_smart_tabs = false
ij_wrap_on_typing = true
[*.java]
ij_java_align_consecutive_assignments = false
ij_java_align_consecutive_variable_declarations = false
ij_java_align_group_field_declarations = false
ij_java_align_multiline_annotation_parameters = false
ij_java_align_multiline_array_initializer_expression = false
ij_java_align_multiline_assignment = false
ij_java_align_multiline_binary_operation = false
ij_java_align_multiline_chained_methods = false
ij_java_align_multiline_extends_list = false
ij_java_align_multiline_for = true
ij_java_align_multiline_method_parentheses = false
ij_java_align_multiline_parameters = true
ij_java_align_multiline_parameters_in_calls = false
ij_java_align_multiline_parenthesized_expression = false
ij_java_align_multiline_records = true
ij_java_align_multiline_resources = true
ij_java_align_multiline_ternary_operation = false
ij_java_align_multiline_text_blocks = false
ij_java_align_multiline_throws_list = false
ij_java_align_subsequent_simple_methods = false
ij_java_align_throws_keyword = false
ij_java_annotation_parameter_wrap = off
ij_java_array_initializer_new_line_after_left_brace = false
ij_java_array_initializer_right_brace_on_new_line = false
ij_java_array_initializer_wrap = off
ij_java_assert_statement_colon_on_next_line = false
ij_java_assert_statement_wrap = off
ij_java_assignment_wrap = off
ij_java_binary_operation_sign_on_next_line = false
ij_java_binary_operation_wrap = off
ij_java_blank_lines_after_anonymous_class_header = 0
ij_java_blank_lines_after_class_header = 1
ij_java_blank_lines_after_imports = 1
ij_java_blank_lines_after_package = 1
ij_java_blank_lines_around_class = 1
ij_java_blank_lines_around_field = 0
ij_java_blank_lines_around_field_in_interface = 0
ij_java_blank_lines_around_initializer = 1
ij_java_blank_lines_around_method = 1
ij_java_blank_lines_around_method_in_interface = 1
ij_java_blank_lines_before_class_end = 1
ij_java_blank_lines_before_imports = 1
ij_java_blank_lines_before_method_body = 0
ij_java_blank_lines_before_package = 0
ij_java_block_brace_style = end_of_line
ij_java_block_comment_at_first_column = true
ij_java_call_parameters_new_line_after_left_paren = true
ij_java_call_parameters_right_paren_on_new_line = true
ij_java_call_parameters_wrap = on_every_item
ij_java_case_statement_on_separate_line = true
ij_java_catch_on_new_line = false
ij_java_class_annotation_wrap = split_into_lines
ij_java_class_brace_style = end_of_line
ij_java_class_count_to_use_import_on_demand = 100000
ij_java_class_names_in_javadoc = 1
ij_java_do_not_indent_top_level_class_members = false
ij_java_do_not_wrap_after_single_annotation = false
ij_java_do_while_brace_force = always
ij_java_doc_add_blank_line_after_description = true
ij_java_doc_add_blank_line_after_param_comments = false
ij_java_doc_add_blank_line_after_return = false
ij_java_doc_add_p_tag_on_empty_lines = true
ij_java_doc_align_exception_comments = true
ij_java_doc_align_param_comments = true
ij_java_doc_do_not_wrap_if_one_line = false
ij_java_doc_enable_formatting = true
ij_java_doc_enable_leading_asterisks = true
ij_java_doc_indent_on_continuation = true
ij_java_doc_keep_empty_lines = true
ij_java_doc_keep_empty_parameter_tag = true
ij_java_doc_keep_empty_return_tag = true
ij_java_doc_keep_empty_throws_tag = true
ij_java_doc_keep_invalid_tags = false
ij_java_doc_param_description_on_new_line = false
ij_java_doc_preserve_line_breaks = false
ij_java_doc_use_throws_not_exception_tag = true
ij_java_else_on_new_line = false
ij_java_enum_constants_wrap = split_into_lines
ij_java_extends_keyword_wrap = off
ij_java_extends_list_wrap = normal
ij_java_field_annotation_wrap = split_into_lines
ij_java_finally_on_new_line = false
ij_java_for_brace_force = always
ij_java_for_statement_new_line_after_left_paren = false
ij_java_for_statement_right_paren_on_new_line = false
ij_java_for_statement_wrap = off
ij_java_generate_final_locals = true
ij_java_generate_final_parameters = true
ij_java_if_brace_force = always
ij_java_imports_layout = *, |, javax.**, java.**, |, $*
ij_java_indent_case_from_switch = true
ij_java_insert_inner_class_imports = false
ij_java_insert_override_annotation = true
ij_java_keep_blank_lines_before_right_brace = 2
ij_java_keep_blank_lines_between_package_declaration_and_header = 2
ij_java_keep_blank_lines_in_code = 2
ij_java_keep_blank_lines_in_declarations = 2
ij_java_keep_control_statement_in_one_line = true
ij_java_keep_first_column_comment = true
ij_java_keep_indents_on_empty_lines = false
ij_java_keep_line_breaks = true
ij_java_keep_multiple_expressions_in_one_line = false
ij_java_keep_simple_blocks_in_one_line = false
ij_java_keep_simple_classes_in_one_line = false
ij_java_keep_simple_lambdas_in_one_line = false
ij_java_keep_simple_methods_in_one_line = false
ij_java_label_indent_absolute = false
ij_java_label_indent_size = 0
ij_java_lambda_brace_style = end_of_line
ij_java_layout_static_imports_separately = true
ij_java_line_comment_add_space = false
ij_java_line_comment_at_first_column = true
ij_java_method_annotation_wrap = split_into_lines
ij_java_method_brace_style = end_of_line
ij_java_method_call_chain_wrap = on_every_item
ij_java_method_parameters_new_line_after_left_paren = true
ij_java_method_parameters_right_paren_on_new_line = true
ij_java_method_parameters_wrap = on_every_item
ij_java_modifier_list_wrap = false
ij_java_names_count_to_use_import_on_demand = 100000
ij_java_new_line_after_lparen_in_record_header = false
ij_java_parameter_annotation_wrap = off
ij_java_parentheses_expression_new_line_after_left_paren = false
ij_java_parentheses_expression_right_paren_on_new_line = false
ij_java_place_assignment_sign_on_next_line = false
ij_java_prefer_longer_names = false
ij_java_prefer_parameters_wrap = true
ij_java_record_components_wrap = normal
ij_java_repeat_synchronized = true
ij_java_replace_instanceof_and_cast = false
ij_java_replace_null_check = true
ij_java_replace_sum_lambda_with_method_ref = true
ij_java_resource_list_new_line_after_left_paren = false
ij_java_resource_list_right_paren_on_new_line = false
ij_java_resource_list_wrap = off
ij_java_rparen_on_new_line_in_record_header = false
ij_java_space_after_closing_angle_bracket_in_type_argument = false
ij_java_space_after_colon = true
ij_java_space_after_comma = true
ij_java_space_after_comma_in_type_arguments = true
ij_java_space_after_for_semicolon = true
ij_java_space_after_quest = true
ij_java_space_after_type_cast = true
ij_java_space_before_annotation_array_initializer_left_brace = false
ij_java_space_before_annotation_parameter_list = false
ij_java_space_before_array_initializer_left_brace = false
ij_java_space_before_catch_keyword = true
ij_java_space_before_catch_left_brace = true
ij_java_space_before_catch_parentheses = true
ij_java_space_before_class_left_brace = true
ij_java_space_before_colon = true
ij_java_space_before_colon_in_foreach = true
ij_java_space_before_comma = false
ij_java_space_before_do_left_brace = true
ij_java_space_before_else_keyword = true
ij_java_space_before_else_left_brace = true
ij_java_space_before_finally_keyword = true
ij_java_space_before_finally_left_brace = true
ij_java_space_before_for_left_brace = true
ij_java_space_before_for_parentheses = true
ij_java_space_before_for_semicolon = false
ij_java_space_before_if_left_brace = true
ij_java_space_before_if_parentheses = true
ij_java_space_before_method_call_parentheses = false
ij_java_space_before_method_left_brace = true
ij_java_space_before_method_parentheses = false
ij_java_space_before_opening_angle_bracket_in_type_parameter = false
ij_java_space_before_quest = true
ij_java_space_before_switch_left_brace = true
ij_java_space_before_switch_parentheses = true
ij_java_space_before_synchronized_left_brace = true
ij_java_space_before_synchronized_parentheses = true
ij_java_space_before_try_left_brace = true
ij_java_space_before_try_parentheses = true
ij_java_space_before_type_parameter_list = false
ij_java_space_before_while_keyword = true
ij_java_space_before_while_left_brace = true
ij_java_space_before_while_parentheses = true
ij_java_space_inside_one_line_enum_braces = false
ij_java_space_within_empty_array_initializer_braces = false
ij_java_space_within_empty_method_call_parentheses = false
ij_java_space_within_empty_method_parentheses = false
ij_java_spaces_around_additive_operators = true
ij_java_spaces_around_assignment_operators = true
ij_java_spaces_around_bitwise_operators = true
ij_java_spaces_around_equality_operators = true
ij_java_spaces_around_lambda_arrow = true
ij_java_spaces_around_logical_operators = true
ij_java_spaces_around_method_ref_dbl_colon = false
ij_java_spaces_around_multiplicative_operators = true
ij_java_spaces_around_relational_operators = true
ij_java_spaces_around_shift_operators = true
ij_java_spaces_around_type_bounds_in_type_parameters = true
ij_java_spaces_around_unary_operator = false
ij_java_spaces_within_angle_brackets = false
ij_java_spaces_within_annotation_parentheses = false
ij_java_spaces_within_array_initializer_braces = false
ij_java_spaces_within_braces = false
ij_java_spaces_within_brackets = false
ij_java_spaces_within_cast_parentheses = false
ij_java_spaces_within_catch_parentheses = false
ij_java_spaces_within_for_parentheses = false
ij_java_spaces_within_if_parentheses = false
ij_java_spaces_within_method_call_parentheses = false
ij_java_spaces_within_method_parentheses = false
ij_java_spaces_within_parentheses = false
ij_java_spaces_within_switch_parentheses = false
ij_java_spaces_within_synchronized_parentheses = false
ij_java_spaces_within_try_parentheses = false
ij_java_spaces_within_while_parentheses = false
ij_java_special_else_if_treatment = true
ij_java_subclass_name_suffix = Impl
ij_java_ternary_operation_signs_on_next_line = true
ij_java_ternary_operation_wrap = on_every_item
ij_java_test_name_suffix = Test
ij_java_throws_keyword_wrap = off
ij_java_throws_list_wrap = normal
ij_java_use_external_annotations = false
ij_java_use_fq_class_names = false
ij_java_use_relative_indents = false
ij_java_use_single_class_imports = true
ij_java_variable_annotation_wrap = off
ij_java_visibility = public
ij_java_while_brace_force = always
ij_java_while_on_new_line = false
ij_java_wrap_comments = false
ij_java_wrap_first_method_in_call_chain = true
ij_java_wrap_long_lines = false
[*.properties]
ij_properties_align_group_field_declarations = false
ij_properties_keep_blank_lines = false
ij_properties_key_value_delimiter = equals
ij_properties_spaces_around_key_value_delimiter = false
[.editorconfig]
ij_editorconfig_align_group_field_declarations = false
ij_editorconfig_space_after_colon = false
ij_editorconfig_space_after_comma = true
ij_editorconfig_space_before_colon = false
ij_editorconfig_space_before_comma = false
ij_editorconfig_spaces_around_assignment_operators = true
[{*.gradle.kts, *.kt, *.kts, *.main.kts}]
ij_kotlin_align_in_columns_case_branch = false
ij_kotlin_align_multiline_binary_operation = false
ij_kotlin_align_multiline_extends_list = false
ij_kotlin_align_multiline_method_parentheses = false
ij_kotlin_align_multiline_parameters = true
ij_kotlin_align_multiline_parameters_in_calls = false
ij_kotlin_allow_trailing_comma = false
ij_kotlin_allow_trailing_comma_on_call_site = false
ij_kotlin_assignment_wrap = off
ij_kotlin_blank_lines_after_class_header = 0
ij_kotlin_blank_lines_around_block_when_branches = 0
ij_kotlin_blank_lines_before_declaration_with_comment_or_annotation_on_separate_line = 1
ij_kotlin_block_comment_at_first_column = true
ij_kotlin_call_parameters_new_line_after_left_paren = false
ij_kotlin_call_parameters_right_paren_on_new_line = false
ij_kotlin_call_parameters_wrap = off
ij_kotlin_catch_on_new_line = false
ij_kotlin_class_annotation_wrap = split_into_lines
ij_kotlin_continuation_indent_for_chained_calls = true
ij_kotlin_continuation_indent_for_expression_bodies = true
ij_kotlin_continuation_indent_in_argument_lists = true
ij_kotlin_continuation_indent_in_elvis = true
ij_kotlin_continuation_indent_in_if_conditions = true
ij_kotlin_continuation_indent_in_parameter_lists = true
ij_kotlin_continuation_indent_in_supertype_lists = true
ij_kotlin_else_on_new_line = false
ij_kotlin_enum_constants_wrap = off
ij_kotlin_extends_list_wrap = off
ij_kotlin_field_annotation_wrap = split_into_lines
ij_kotlin_finally_on_new_line = false
ij_kotlin_if_rparen_on_new_line = false
ij_kotlin_import_nested_classes = false
ij_kotlin_insert_whitespaces_in_simple_one_line_method = true
ij_kotlin_keep_blank_lines_before_right_brace = 2
ij_kotlin_keep_blank_lines_in_code = 2
ij_kotlin_keep_blank_lines_in_declarations = 2
ij_kotlin_keep_first_column_comment = true
ij_kotlin_keep_indents_on_empty_lines = false
ij_kotlin_keep_line_breaks = true
ij_kotlin_lbrace_on_next_line = false
ij_kotlin_line_comment_add_space = false
ij_kotlin_line_comment_at_first_column = true
ij_kotlin_method_annotation_wrap = split_into_lines
ij_kotlin_method_call_chain_wrap = off
ij_kotlin_method_parameters_new_line_after_left_paren = false
ij_kotlin_method_parameters_right_paren_on_new_line = false
ij_kotlin_method_parameters_wrap = off
ij_kotlin_name_count_to_use_star_import = 5
ij_kotlin_name_count_to_use_star_import_for_members = 3
ij_kotlin_parameter_annotation_wrap = off
ij_kotlin_space_after_comma = true
ij_kotlin_space_after_extend_colon = true
ij_kotlin_space_after_type_colon = true
ij_kotlin_space_before_catch_parentheses = true
ij_kotlin_space_before_comma = false
ij_kotlin_space_before_extend_colon = true
ij_kotlin_space_before_for_parentheses = true
ij_kotlin_space_before_if_parentheses = true
ij_kotlin_space_before_lambda_arrow = true
ij_kotlin_space_before_type_colon = false
ij_kotlin_space_before_when_parentheses = true
ij_kotlin_space_before_while_parentheses = true
ij_kotlin_spaces_around_additive_operators = true
ij_kotlin_spaces_around_assignment_operators = true
ij_kotlin_spaces_around_equality_operators = true
ij_kotlin_spaces_around_function_type_arrow = true
ij_kotlin_spaces_around_logical_operators = true
ij_kotlin_spaces_around_multiplicative_operators = true
ij_kotlin_spaces_around_range = false
ij_kotlin_spaces_around_relational_operators = true
ij_kotlin_spaces_around_unary_operator = false
ij_kotlin_spaces_around_when_arrow = true
ij_kotlin_variable_annotation_wrap = off
ij_kotlin_while_on_new_line = false
ij_kotlin_wrap_elvis_expressions = 1
ij_kotlin_wrap_expression_body_functions = 0
ij_kotlin_wrap_first_method_in_call_chain = false
[*.json]
indent_size = 2
ij_json_keep_blank_lines_in_code = 0
ij_json_keep_indents_on_empty_lines = false
ij_json_keep_line_breaks = true
ij_json_space_after_colon = true
ij_json_space_after_comma = true
ij_json_space_before_colon = true
ij_json_space_before_comma = false
ij_json_spaces_within_braces = false
ij_json_spaces_within_brackets = false
ij_json_wrap_long_lines = false
[{*.htm, *.html, *.sht, *.shtm, *.shtml}]
ij_html_add_new_line_before_tags = body, div, p, form, h1, h2, h3
ij_html_align_attributes = true
ij_html_align_text = false
ij_html_attribute_wrap = normal
ij_html_block_comment_at_first_column = true
ij_html_do_not_align_children_of_min_lines = 0
ij_html_do_not_break_if_inline_tags = title, h1, h2, h3, h4, h5, h6, p
ij_html_do_not_indent_children_of_tags = html, body, thead, tbody, tfoot
ij_html_enforce_quotes = false
ij_html_inline_tags = a, abbr, acronym, b, basefont, bdo, big, br, cite, cite, code, dfn, em, font, i, img, input, kbd, label, q, s, samp, select, small, span, strike, strong, sub, sup, textarea, tt, u, var
ij_html_keep_blank_lines = 2
ij_html_keep_indents_on_empty_lines = false
ij_html_keep_line_breaks = true
ij_html_keep_line_breaks_in_text = true
ij_html_keep_whitespaces = false
ij_html_keep_whitespaces_inside = span, pre, textarea
ij_html_line_comment_at_first_column = true
ij_html_new_line_after_last_attribute = never
ij_html_new_line_before_first_attribute = never
ij_html_quote_style = double
ij_html_remove_new_line_before_tags = br
ij_html_space_after_tag_name = false
ij_html_space_around_equality_in_attribute = false
ij_html_space_inside_empty_tag = false
ij_html_text_wrap = normal
ij_html_uniform_ident = false
[{*.yaml, *.yml}]
indent_size = 2
ij_yaml_keep_indents_on_empty_lines = false
ij_yaml_keep_line_breaks = true
ij_yaml_space_before_colon = false
ij_yaml_spaces_within_braces = true
ij_yaml_spaces_within_brackets = true

4
.gitattributes vendored Normal file
View File

@ -0,0 +1,4 @@
* text=auto
*.java text
*.jar binary

1
.github/CODEOWNERS vendored Normal file
View File

@ -0,0 +1 @@
* @IntellectualSites/plotsquared-team

View File

@ -1,2 +0,0 @@
### Bugs
Please provide a `/plot debugpaste` if you are reporting a bug.

View File

@ -1,12 +0,0 @@
# Bug report template (Follow this template unless you are making a feature request.)
**Debug paste link**:
**Description of the problem:**
**How to replicate**:
Make sure you've completed the following steps (put an X between of brackets):
- [] Include `/plot debugpaste`
- [] Made sure there aren't duplicates of this report [(Use Search)](https://github.com/IntellectualSites/PlotSquared/issues?utf8=%E2%9C%93&q=is%3Aissue)
- [] Made sure you're using an up-to-date version of PlotSquared
- [] Made sure the bug/error isn't caused by any other plugin

105
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@ -0,0 +1,105 @@
name: Bug report
description: Create a report to help us improve
labels: 'Requires Testing'
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report for PlotSquared! Fill out the following form to your best ability to help us fix the problem.
Only use this if you're absolutely sure that you found a bug and can reproduce it. For anything else, use: [our Discord server](https://discord.gg/intellectualsites) or [the wiki](https://intellectualsites.github.io/plotsquared-documentation/).
Do NOT use the public issue tracker to report security vulnerabilities! They are disclosed using [this](https://forms.gle/btgdRn9yhGtzEiGW8) form!
- type: dropdown
attributes:
label: Server Implementation
description: Which server Implementation are you using? If your server implementation is not listed, it is not supported. Switch to a supported version first.
multiple: false
options:
- Paper
- Spigot
validations:
required: true
- type: dropdown
attributes:
label: Server Version
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
options:
- '1.19.3'
- '1.19.2'
- '1.19.1'
- '1.19'
- '1.18.2'
- '1.18.1'
- '1.17.1'
- '1.16.5'
validations:
required: true
- type: textarea
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
attributes:
label: To Reproduce
description: Steps to reproduce this behaviour
placeholder: |
1. Go to '...'
2. Click on '...'
3. Scroll down to '...'
4. See error
validations:
required: true
- type: textarea
attributes:
label: Expected behaviour
description: A clear and concise description of what you expected to happen.
validations:
required: true
- type: textarea
attributes:
label: Screenshots / Videos
description: If applicable, add screenshots to help explain your problem.
- type: input
attributes:
label: Error log (if applicable)
description: If you are reporting a console error, upload any relevant log excerpts to either https://paste.gg/ or https://gist.github.com, save and the paste the link in this box.
- type: input
attributes:
label: Plot Debugpaste
description: Run `/plot debugpaste` in your console or ingame and provide the output link here.
validations:
required: true
- type: input
attributes:
label: PlotSquared Version
description: What version of PlotSquared are you running? (`/version PlotSquared`)
placeholder: "For example: PlotSquared version 5.13.11-Premium"
validations:
required: true
- type: checkboxes
attributes:
label: Checklist
description: Make sure you have followed each of the steps outlined here.
options:
- label: I have included a Plot debugpaste.
required: true
- label: I am using the newest build from https://www.spigotmc.org/resources/77506/ and the issue still persists.
required: true
- type: textarea
attributes:
label: Anything else?
description: You can provide additional context below.

8
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: IntellectualSites Discord
url: https://discord.gg/intellectualsites
about: Our support Discord, please ask questions and seek support here.
- name: PlotSquared Wiki
url: https://intellectualsites.github.io/plotsquared-documentation/
about: Take a look at the wiki page for instructions how to setup PlotSquared and use its commands.

View File

@ -0,0 +1,29 @@
name: Feature request
description: Suggest an idea for this project
labels: 'Enhancement'
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request for PlotSquared! Fill out the following form to your best ability to help us understand your feature request and greately improve the change of it getting added.
For anything else than a feature request, use: [our Discord server](https://discord.gg/intellectualsites) or [the wiki](https://intellectualsites.github.io/plotsquared-documentation/).
- type: textarea
attributes:
label: What feature do you want to see added?
description: A clear and concise description of your feature request.
validations:
required: true
- type: textarea
attributes:
label: Are there any alternatives?
description: List any alternatives you might have tried
validations:
required: true
- type: textarea
attributes:
label: Anything else?
description: You can provide additional context below.

1
.github/release-drafter.yml vendored Normal file
View File

@ -0,0 +1 @@
_extends: .github

18
.github/stale.yml vendored Normal file
View File

@ -0,0 +1,18 @@
daysUntilStale: 30
daysUntilClose: 7
only: issues
exemptLabels:
- "Bug"
- "Enhancement"
- "Approved"
- "Priority"
- "Under investigation"
staleLabel: "resolution: stale"
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. If the issue is still present and can be reproduced, please let the team know.
Thank you for your contributions.
closeComment: >
This issue has been automatically closed because it has not had activity in
a long time. If the issue still applies to the most recent supported
version, please reply to this issue and the team will reopen it.

View File

@ -0,0 +1,24 @@
name: Announce release on discord
on:
release:
types: [published]
jobs:
send_announcement:
runs-on: ubuntu-latest
steps:
- name: send custom message with args
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_USERNAME: PlotSquared Release
DISCORD_AVATAR: https://raw.githubusercontent.com/IntellectualSites/Assets/main/plugins/PlotSquared/PlotSquared.png
uses: Ilshidur/action-discord@08d9328877d6954120eef2b07abbc79249bb6210 # ratchet:Ilshidur/action-discord@0.3.2
with:
args: |
"<@&525015541815967744> <@&679322738552471574> <@&699293353862496266>"
""
"<:plotsquared:730750385886593039> **PlotSquared ${{ github.event.release.tag_name }} has been released!**"
""
"Click here to view changelog: https://github.com/IntellectualSites/PlotSquared/releases/tag/${{ github.event.release.tag_name }}"
""
"The download is available at:"
"- Spigot: <https://www.spigotmc.org/resources/77506/>"

21
.github/workflows/build-pr.yml vendored Normal file
View File

@ -0,0 +1,21 @@
name: Build PR
on: [pull_request]
jobs:
build_pr:
if: github.repository_owner == 'IntellectualSites'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@55e685c48d84285a5b0418cd094606e199cca3b6 # v1
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Clean Build
run: ./gradlew clean build

67
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,67 @@
name: build
on:
push:
branches:
- v6
jobs:
build:
if: github.repository_owner == 'IntellectualSites'
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@55e685c48d84285a5b0418cd094606e199cca3b6 # v1
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Clean Build
run: ./gradlew clean build
- name: Determine release status
if: ${{ runner.os == 'Linux' }}
run: |
if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then
echo "STATUS=snapshot" >> $GITHUB_ENV
else
echo "STATUS=release" >> $GITHUB_ENV
fi
- name: Publish Release
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6'}}
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
- name: Publish Snapshot
if: ${{ runner.os == 'Linux' && env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6' }}
run: ./gradlew publishToSonatype
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
- name: Publish core javadoc
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6'}}
uses: cpina/github-action-push-to-another-repository@0a14457bb28b04dfa1652e0ffdfda866d2845c73 # main
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
with:
source-directory: 'Core/build/docs/javadoc'
destination-github-username: 'IntellectualSites'
destination-repository-name: 'plotsquared-javadocs'
user-email: ${{ secrets.USER_EMAIL }}
target-branch: main
target-directory: core
- name: Publish bukkit javadoc
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6'}}
uses: cpina/github-action-push-to-another-repository@0a14457bb28b04dfa1652e0ffdfda866d2845c73 # main
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
with:
source-directory: 'Bukkit/build/docs/javadoc'
destination-github-username: 'IntellectualSites'
destination-repository-name: 'plotsquared-javadocs'
user-email: ${{ secrets.USER_EMAIL }}
target-branch: main
target-directory: bukkit

28
.github/workflows/codeql.yml vendored Normal file
View File

@ -0,0 +1,28 @@
name: "CodeQL"
on:
pull_request:
# The branches below must be a subset of the branches above
branches: [v6]
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ['java']
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@32dc499307d133bb5085bae78498c0ac2cf762d5 # v2
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@32dc499307d133bb5085bae78498c0ac2cf762d5 # v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@32dc499307d133bb5085bae78498c0ac2cf762d5 # v2

17
.github/workflows/release-drafter.yml vendored Normal file
View File

@ -0,0 +1,17 @@
name: draft release
on:
push:
branches:
- v6
pull_request:
types: [opened, reopened, synchronize]
pull_request_target:
types: [opened, reopened, synchronize]
jobs:
update_release_draft:
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

277
.gitignore vendored
View File

@ -1,138 +1,139 @@
### Others ###
*.cmd
*.sh
*.prefs
Sponge/build
Core/build
Bukkit/build
### Maven ###
/target/lib
/target/maven-archiver
/target/classes
/target/maven-status
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
### Java ###
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
*.iml
## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:
# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries
# .idea/shelf
# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml
# Gradle:
# .idea/gradle.xml
# .idea/libraries
.gradle
# Mongo Explorer plugin:
# .idea/mongoSettings.xml
## File-based project format:
*.ipr
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### Eclipse ###
*.pydevproject
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
# Eclipse Core
.project
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# JDT-specific (Eclipse Java Development Tools)
.classpath
# Java annotation processor (APT)
.factorypath
# PDT-specific
.buildpath
# sbteclipse plugin
.target
# TeXlipse plugin
.texlipse
# STS (Spring Tool Suite)
.springBeans
/target/
Nukkit/build/classes/
Nukkit/build/dependency-cache/
checkstyle.xml
classes/
p2error.txt
### Others ###
*.cmd
*.sh
*.prefs
Core/build
### Maven ###
/mvn
/target/lib
/target/maven-archiver
/target/classes
/target/maven-status
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
out/
### Java ###
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.war
*.ear
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
*.iml
## Directory-based project format:
/.idea/*
!/.idea/icon.svg
# if you remove the above rule, at least ignore the following:
# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries
# .idea/shelf
# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml
# Gradle:
# .idea/gradle.xml
# .idea/libraries
.gradle
# Mongo Explorer plugin:
# .idea/mongoSettings.xml
## File-based project format:
*.ipr
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### Eclipse ###
*.pydevproject
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
# Eclipse Core
.project
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# JDT-specific (Eclipse Java Development Tools)
.classpath
# Java annotation processor (APT)
.factorypath
# PDT-specific
.buildpath
# sbteclipse plugin
.target
# TeXlipse plugin
.texlipse
# STS (Spring Tool Suite)
.springBeans
/target/
checkstyle.xml
classes/
*.bat
# Other
docs/
build/
.DS_Store

50
.idea/icon.svg generated Normal file
View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" id="svg2" xml:space="preserve" width="4000" height="3333.3333" viewBox="0 0 4000 3333.3333" sodipodi:docname="PlotSquared.ai">
<metadata id="metadata8">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs id="defs6">
<clipPath clipPathUnits="userSpaceOnUse" id="clipPath18">
<path d="M 0,2500 H 3000 V 0 H 0 Z" id="path16" />
</clipPath>
</defs>
<sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="640" inkscape:window-height="480" id="namedview4" />
<g id="g10" inkscape:groupmode="layer" inkscape:label="PlotSquared" transform="matrix(1.3333333,0,0,-1.3333333,0,3333.3333)">
<g id="g12">
<g id="g14" clip-path="url(#clipPath18)">
<g id="g20" transform="translate(1486.1511,2242.6453)">
<path d="m 0,0 c 16.533,10.846 33.211,21.453 50.104,31.699 78.972,-48.281 153.985,-102.704 227.269,-159.144 148.61,-115.422 287.884,-243.01 414.393,-382.333 111.39,-122.861 212.751,-255.152 298.898,-396.971 52.744,-87.322 100.544,-177.884 139.514,-272.214 -11.638,-3.551 -23.108,-7.655 -34.362,-12.286 l -0.24,0.288 c -11.135,12.982 -24.141,24.212 -34.915,37.506 -22.557,23.013 -45.425,45.737 -68.03,68.678 -19.725,20.253 -40.601,39.45 -58.958,60.974 -36.355,36.451 -72.517,73.093 -108.944,109.471 -22.628,26.013 -48.064,49.385 -71.965,74.197 -19.029,19.485 -38.706,38.346 -57.519,57.999 -12.166,14.998 -26.684,27.716 -39.93,41.658 -27.668,27.524 -54.903,55.479 -82.571,82.979 -23.924,27.956 -51.664,52.264 -76.692,79.164 -4.68,4.487 -8.855,10.774 -15.886,11.326 -22.34,34.027 -58.311,57.327 -97.377,67.502 -104.312,99.153 -215.487,191.202 -332.661,274.782 -117.942,-83.94 -229.476,-176.781 -334.484,-276.39 -26.684,-0.024 -53.368,0.024 -80.076,-0.024 0.024,-26.564 0.048,-53.104 0,-79.668 -72.229,-73.021 -139.491,-150.937 -202.385,-232.092 -63.758,-82.619 -121.973,-169.51 -173.541,-260.264 131.932,-69.061 257.864,-149.521 375.926,-240.275 0.096,-26.444 -0.12,-52.888 0.096,-79.332 l 0.744,-0.984 c 20.109,-24.14 43.409,-45.233 65.126,-67.861 15.118,-15.382 30.571,-30.404 45.569,-45.881 17.565,-20.733 37.698,-39.042 56.607,-58.503 19.917,-20.781 41.25,-40.218 59.967,-62.151 29.156,-29.299 58.167,-58.815 87.515,-87.922 29.155,-33.043 61.502,-63.111 92.169,-94.738 13.726,-12.67 25.124,-27.571 38.634,-40.457 25.029,-25.365 50.129,-50.657 75.325,-75.853 -37.914,-51.208 -73.741,-103.952 -107.192,-158.183 -167.83,273.317 -397.235,507.305 -662.37,687.158 -81.875,55.335 -167.23,105.584 -255.681,149.641 -52.815,26.276 -106.831,50.248 -162.239,70.381 99.393,233.628 242.795,446.715 410.289,636.79 93.562,106.088 194.634,205.433 301.466,298.13 C -217.335,-155.808 -111.439,-73.789 0,0" style="fill:#062f4c;fill-opacity:1;fill-rule:nonzero;stroke:none" id="path22" />
</g>
<g id="g24" transform="translate(1201.7948,1741.5303)">
<path d="M 0,0 C 105.008,99.609 216.543,192.45 334.485,276.39 451.659,192.81 562.833,100.76 667.146,1.608 c -34.987,8.83 -71.51,9.718 -107.264,6.431 -41.202,-4.296 -82.907,-19.077 -112.543,-48.953 -33.019,-32.155 -49.456,-77.604 -55.311,-122.501 -28.124,27.908 -56.104,55.983 -84.035,84.083 -2.976,2.976 -6.839,4.823 -10.391,6.911 -19.029,26.348 -45.953,46.673 -76.62,57.495 C 187.555,-2.472 151.513,-0.12 116.166,0 Z" style="fill:#4c8fcc;fill-opacity:1;fill-rule:nonzero;stroke:none" id="path26" />
</g>
<g id="g28" transform="translate(919.3342,1429.7462)">
<path d="m 0,0 c 62.894,81.156 130.156,159.072 202.385,232.092 0.048,-244.21 0.024,-488.421 0,-732.631 C 84.323,-409.785 -41.61,-329.325 -173.541,-260.264 -121.973,-169.51 -63.758,-82.619 0,0" style="fill:#4c8fcc;fill-opacity:1;fill-rule:nonzero;stroke:none" id="path30" />
</g>
<g id="g32" transform="translate(1649.134,1700.6166)">
<path d="m 0,0 c 29.635,29.875 71.341,44.657 112.543,48.952 35.754,3.288 72.277,2.4 107.263,-6.431 39.066,-10.174 75.037,-33.474 97.377,-67.501 11.879,-17.661 20.181,-37.411 26.42,-57.687 10.871,-38.802 11.95,-79.356 11.446,-119.358 -44.345,-0.072 -88.69,0.048 -133.035,-0.072 -1.032,30.907 3.263,63.686 -10.175,92.626 -9.526,20.325 -32.107,31.243 -53.751,32.131 -21.453,1.44 -45.065,-4.32 -59.175,-21.597 -12.79,-15.861 -15.382,-37.002 -16.558,-56.655 -1.295,-29.132 3.696,-59.031 17.518,-84.923 16.821,-30.619 39.378,-57.783 64.526,-81.9 31.387,-32.634 67.501,-60.374 97.857,-94.041 27.332,-28.988 51.256,-61.479 68.005,-97.785 20.541,-41.13 26.972,-87.827 25.82,-133.372 -0.912,-32.107 -5.231,-64.406 -16.149,-94.737 -11.59,-31.699 -31.123,-61.047 -58.335,-81.371 -25.124,-19.125 -55.696,-29.852 -86.651,-34.771 -49.552,-6.743 -101.888,-4.847 -148.465,14.854 -35.227,14.829 -64.238,42.689 -81.708,76.548 -20.996,40.242 -27.115,86.339 -27.259,131.212 0.048,17.829 0,35.658 0.048,53.463 44.345,0.048 88.69,-0.023 133.059,0.048 1.728,-35.538 -4.055,-72.06 5.663,-106.807 5.783,-22.173 26.204,-37.794 48.185,-41.754 20.733,-3.431 43.577,-2.015 61.622,9.791 15.502,9.43 23.949,26.78 26.78,44.225 5.903,35.922 1.872,74.293 -15.381,106.688 -16.918,30.595 -39.474,57.711 -64.55,81.899 -33.187,34.099 -71.173,63.254 -102.585,99.081 -26.756,28.867 -49.408,61.646 -65.486,97.641 -24.572,52.48 -26.731,112.422 -20.18,169.102 C -49.456,-77.604 -33.019,-32.155 0,0" style="fill:#feeeee;fill-opacity:1;fill-rule:nonzero;stroke:none" id="path34" />
</g>
<g id="g36" transform="translate(1262.7214,1613.126)">
<path d="m 0,0 v -301.13 c 23.204,0.024 46.409,-0.048 69.613,0.024 18.525,0.288 38.202,6.575 50.153,21.429 12.43,17.277 13.917,39.522 14.613,60.111 0.024,43.985 -0.048,87.994 0.024,131.979 -0.48,23.637 -0.983,50.369 -17.277,69.23 C 104.864,-5.711 86.867,-0.24 69.589,0 46.385,0.048 23.204,0.024 0,0 m -141.002,128.38 c 26.708,0.048 53.392,0 80.075,0.024 H 55.24 c 35.346,-0.12 71.389,-2.471 104.815,-14.925 30.668,-10.823 57.592,-31.148 76.621,-57.496 26.852,-39.09 36.69,-87.202 38.058,-133.947 0.024,-48.833 0.096,-97.689 -0.024,-146.521 -1.728,-47.993 -11.974,-97.953 -41.514,-136.971 -22.748,-30.644 -57.495,-50.801 -94.281,-59.583 -45.377,-11.878 -92.578,-6.791 -138.891,-7.847 -0.072,-111.799 0,-223.574 -0.024,-335.373 -13.942,0 -27.86,0.024 -41.778,-0.024 -32.802,0.072 -65.605,0 -98.384,0.048 l -0.744,0.984 c -0.216,26.444 0,52.888 -0.096,79.332 0.024,244.211 0.048,488.421 0,732.632 0.048,26.563 0.024,53.103 0,79.667" style="fill:#feeeee;fill-opacity:1;fill-rule:nonzero;stroke:none" id="path38" />
</g>
<g id="g40" transform="translate(1966.3174,1675.6364)">
<path d="m 0,0 c 7.031,-0.552 11.206,-6.839 15.885,-11.326 25.029,-26.9 52.768,-51.208 76.693,-79.164 27.667,-27.5 54.903,-55.456 82.571,-82.979 13.246,-13.942 27.764,-26.66 39.93,-41.658 18.813,-19.653 38.49,-38.514 57.519,-57.999 23.9,-24.812 49.337,-48.185 71.965,-74.197 36.427,-36.378 72.589,-73.02 108.943,-109.471 18.358,-21.524 39.234,-40.722 58.959,-60.974 22.605,-22.941 45.473,-45.665 68.03,-68.678 10.774,-13.294 23.78,-24.524 34.914,-37.506 -103.904,-41.97 -203.488,-94.114 -298.922,-152.761 -246.994,-152.28 -466.224,-350.298 -639.333,-583.398 -25.197,25.196 -50.297,50.488 -75.325,75.852 -13.51,12.886 -24.908,27.788 -38.634,40.458 -30.667,31.627 -63.014,61.695 -92.17,94.738 -29.347,29.107 -58.359,58.623 -87.514,87.922 -18.717,21.933 -40.05,41.37 -59.967,62.151 -18.909,19.461 -39.042,37.77 -56.607,58.503 -14.998,15.477 -30.452,30.499 -45.569,45.88 -21.717,22.629 -45.017,43.722 -65.126,67.862 32.779,-0.048 65.582,0.024 98.384,-0.048 114.391,-98.097 220.407,-205.984 315.384,-322.99 92.914,114.318 196.242,220.022 307.753,316.271 30.955,4.919 61.526,15.646 86.65,34.771 27.212,20.325 46.745,49.672 58.335,81.371 107.312,77.988 219.327,149.929 337.509,210.376 -35.299,64.67 -75.829,126.437 -118.254,186.643 C 176.253,-228.037 104.24,-140.115 26.42,-57.687 20.181,-37.41 11.878,-17.661 0,0" style="fill:#042338;fill-opacity:1;fill-rule:nonzero;stroke:none" id="path42" />
</g>
<g id="g44" transform="translate(1499.3971,1669.1094)">
<path d="m 0,0 c 3.551,-2.088 7.415,-3.935 10.39,-6.911 27.932,-28.1 55.912,-56.175 84.036,-84.083 -6.551,-56.679 -4.392,-116.622 20.18,-169.102 16.078,-35.994 38.73,-68.774 65.486,-97.641 31.412,-35.826 69.398,-64.982 102.585,-99.081 25.076,-24.188 47.632,-51.304 64.55,-81.899 17.253,-32.395 21.284,-70.765 15.381,-106.688 -2.831,-17.445 -11.278,-34.794 -26.78,-44.225 -18.045,-11.806 -40.889,-13.222 -61.622,-9.79 -21.981,3.959 -42.402,19.58 -48.185,41.753 -9.718,34.747 -3.935,71.269 -5.663,106.808 -44.369,-0.072 -88.714,0 -133.059,-0.048 -0.048,-17.806 0,-35.635 -0.048,-53.464 0.144,-44.873 6.263,-90.97 27.259,-131.212 17.47,-33.859 46.481,-61.718 81.708,-76.548 46.577,-19.701 98.913,-21.597 148.465,-14.854 -111.511,-96.249 -214.839,-201.953 -307.753,-316.271 -94.977,117.006 -200.993,224.893 -315.383,322.99 13.918,0.048 27.836,0.024 41.777,0.024 0.024,111.799 -0.048,223.574 0.024,335.372 46.313,1.056 93.514,-4.031 138.891,7.847 36.786,8.783 71.533,28.94 94.282,59.583 29.539,39.018 39.785,88.978 41.513,136.971 0.12,48.833 0.048,97.689 0.024,146.522 C 36.69,-87.203 26.852,-39.09 0,0" style="fill:#1c72ba;fill-opacity:1;fill-rule:nonzero;stroke:none" id="path46" />
</g>
<g id="g48" transform="translate(1748.0469,1601.6797)">
<path d="M 0,0 C 14.11,17.277 37.722,23.036 59.175,21.597 80.82,20.709 103.4,9.791 112.927,-10.534 c 13.438,-28.94 9.142,-61.719 10.174,-92.626 44.345,0.12 88.691,0 133.036,0.072 0.504,40.002 -0.576,80.556 -11.447,119.358 77.82,-82.428 149.833,-170.35 215.583,-262.664 42.426,-60.207 82.956,-121.973 118.254,-186.643 -118.182,-60.447 -230.196,-132.388 -337.508,-210.376 10.918,30.331 15.238,62.63 16.149,94.737 1.152,45.545 -5.279,92.242 -25.82,133.372 -16.749,36.306 -40.673,68.797 -68.005,97.785 -30.355,33.667 -66.47,61.406 -97.857,94.041 -25.148,24.117 -47.705,51.28 -64.526,81.9 -13.822,25.892 -18.813,55.791 -17.517,84.923 C -15.382,-37.002 -12.79,-15.862 0,0" style="fill:#1c72ba;fill-opacity:1;fill-rule:nonzero;stroke:none" id="path50" />
</g>
<g id="g52" transform="translate(1262.7214,1613.126)">
<path d="m 0,0 c 23.204,0.024 46.385,0.048 69.589,0 17.278,-0.24 35.275,-5.711 47.537,-18.357 16.294,-18.861 16.797,-45.593 17.277,-69.23 -0.072,-43.985 0,-87.994 -0.024,-131.979 -0.696,-20.589 -2.183,-42.834 -14.613,-60.111 -11.951,-14.854 -31.628,-21.141 -50.153,-21.429 -23.204,-0.072 -46.409,0 -69.613,-0.024 z" style="fill:#1c72ba;fill-opacity:1;fill-rule:nonzero;stroke:none" id="path54" />
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -1,45 +0,0 @@
repositories {
maven {url "https://hub.spigotmc.org/nexus/content/groups/public/"}
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/"}
maven {url "http://nexus.hc.to/content/repositories/pub_releases"}
mavenLocal()
}
dependencies {
compile project(':Core')
compile 'org.spigotmc:spigot-api:1.11-R0.1-SNAPSHOT'
compile("net.milkbowl.vault:VaultAPI:1.6") {
exclude module: 'bukkit'
}
}
sourceCompatibility = 1.7
targetCompatibility = 1.7
processResources {
from('src/main/resources') {
include 'plugin.yml'
expand(
name: project.parent.name,
version: project.parent.version
)
}
}
// We only want the shadow jar produced
jar.enabled = false
shadowJar {
dependencies {
include(dependency(':Core'))
}
relocate('org.mcstats', 'com.plotsquared.stats')
archiveName = "${parent.name}-${project.name}-${parent.version}.jar"
destinationDir = file '../target'
}
shadowJar.doLast {
task ->
ant.checksum file: task.archivePath
}
build.dependsOn(shadowJar);

116
Bukkit/build.gradle.kts Normal file
View File

@ -0,0 +1,116 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
repositories {
maven {
name = "PlaceholderAPI"
url = uri("https://repo.extendedclip.com/content/repositories/placeholderapi/")
}
maven {
name = "PaperMC"
url = uri("https://repo.papermc.io/repository/maven-public/")
}
maven {
name = "EssentialsX"
url = uri("https://repo.essentialsx.net/releases/")
}
}
dependencies {
api(projects.plotSquaredCore)
// Metrics
implementation("org.bstats:bstats-bukkit")
// Paper
compileOnly("io.papermc.paper:paper-api")
implementation("io.papermc:paperlib")
// Plugins
compileOnly(libs.worldeditBukkit) {
exclude(group = "org.bukkit")
exclude(group = "org.spigotmc")
}
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit") { isTransitive = false }
testImplementation("com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit") { isTransitive = false }
compileOnly("com.github.MilkBowl:VaultAPI") {
exclude(group = "org.bukkit")
}
compileOnly(libs.placeholderapi)
compileOnly(libs.luckperms)
compileOnly(libs.essentialsx)
compileOnly(libs.mvdwapi) { isTransitive = false }
// Other libraries
implementation(libs.squirrelid) { isTransitive = false }
implementation("dev.notmyfault.serverlib:ServerLib")
// Our libraries
implementation(libs.arkitektonika)
implementation(libs.http4j)
implementation("com.intellectualsites.paster:Paster")
implementation("com.intellectualsites.informative-annotations:informative-annotations")
// Adventure
implementation("net.kyori:adventure-platform-bukkit")
}
tasks.processResources {
filesMatching("plugin.yml") {
expand("version" to project.version)
}
}
tasks.named<ShadowJar>("shadowJar") {
dependencies {
exclude(dependency("org.checkerframework:"))
}
relocate("net.kyori.adventure", "com.plotsquared.core.configuration.adventure")
relocate("net.kyori.examination", "com.plotsquared.core.configuration.examination")
relocate("io.papermc.lib", "com.plotsquared.bukkit.paperlib")
relocate("org.bstats", "com.plotsquared.metrics")
relocate("org.enginehub", "com.plotsquared.squirrelid")
relocate("org.khelekore.prtree", "com.plotsquared.prtree")
relocate("com.google.inject", "com.plotsquared.google")
relocate("org.aopalliance", "com.plotsquared.core.aopalliance")
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.http", "com.plotsquared.core.http")
relocate("com.intellectualsites.paster", "com.plotsquared.core.paster")
relocate("org.incendo.serverlib", "com.plotsquared.bukkit.serverlib")
relocate("org.jetbrains", "com.plotsquared.core.annotations")
relocate("org.intellij.lang", "com.plotsquared.core.intellij.annotations")
relocate("javax.annotation", "com.plotsquared.core.annotation")
relocate("com.github.spotbugs", "com.plotsquared.core.spotbugs")
relocate("javax.inject", "com.plotsquared.core.annotation.inject")
relocate("net.jcip", "com.plotsquared.core.annotations.jcip")
relocate("edu.umd.cs.findbugs", "com.plotsquared.core.annotations.findbugs")
relocate("com.intellectualsites.informative-annotations", "com.plotsquared.core.annotation.informative")
// Get rid of all the libs which are 100% unused.
minimize()
mergeServiceFiles()
}
tasks {
withType<Javadoc> {
val isRelease = if (rootProject.version.toString().endsWith("-SNAPSHOT")) "TODO" else rootProject.version.toString()
val opt = options as StandardJavadocDocletOptions
opt.links("https://jd.papermc.io/paper/1.18/")
opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-bukkit/" + libs.worldeditBukkit.get().versionConstraint.toString())
opt.links("https://intellectualsites.github.io/plotsquared-javadocs/core/")
opt.links("https://jd.adventure.kyori.net/api/4.9.3/")
opt.links("https://google.github.io/guice/api-docs/" + libs.guice.get().versionConstraint.toString() + "/javadoc/")
opt.links("https://checkerframework.org/api/")
opt.isLinkSource = true
opt.bottom(File("$rootDir/javadocfooter.html").readText())
opt.isUse = true
opt.encoding("UTF-8")
opt.keyWords()
opt.addStringOption("-since", isRelease)
}
}

View File

@ -1,733 +0,0 @@
package com.intellectualcrafters.plot.api;
import com.intellectualcrafters.configuration.file.YamlConfiguration;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.commands.SubCommand;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.flag.Flag;
import com.intellectualcrafters.plot.flag.FlagManager;
import com.intellectualcrafters.plot.flag.Flags;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotArea;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.PlotManager;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.ChunkManager;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.SchematicHandler;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.intellectualcrafters.plot.util.block.GlobalBlockQueue;
import com.intellectualcrafters.plot.uuid.UUIDWrapper;
import com.plotsquared.bukkit.util.BukkitUtil;
import org.bukkit.Location;
import org.bukkit.OfflinePlayer;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
* PlotSquared API.
*
* <p>Useful classes:
* <ul>
* <li>{@link BukkitUtil}</li>
* <li>{@link PlotPlayer}</li>
* <li>{@link Plot}</li>
* <li>{@link com.intellectualcrafters.plot.object.Location}</li>
* <li>{@link PlotArea}</li>
* <li>{@link PS}</li>
* </ul>
* @version 3.3.3
*/
public class PlotAPI {
/**
* Deprecated, does nothing.
* @param plugin not needed
* @deprecated Not needed
*/
@Deprecated
public PlotAPI(JavaPlugin plugin) {}
public PlotAPI(){}
/**
* Get all plots.
*
* @return all plots
*
* @see PS#getPlots()
*/
public Set<Plot> getAllPlots() {
return PS.get().getPlots();
}
/**
* Return all plots for a player.
*
* @param player Player, whose plots to search for
*
* @return all plots that a player owns
*/
public Set<Plot> getPlayerPlots(Player player) {
return PS.get().getPlots(BukkitUtil.getPlayer(player));
}
/**
* Add a plot world.
*
* @param plotArea Plot World Object
* @see PS#addPlotArea(PlotArea)
*/
public void addPlotArea(PlotArea plotArea) {
PS.get().addPlotArea(plotArea);
}
/**
* Returns the PlotSquared configurations file.
* @return main configuration
*
* @see PS#config
*/
public YamlConfiguration getConfig() {
return PS.get().config;
}
/**
* Get the PlotSquared storage file.
* @return storage configuration
*
* @see PS#storage
*/
public YamlConfiguration getStorage() {
return PS.get().storage;
}
/**
* Get the main class for this plugin. Only use this if you really need it.
*
* @return PlotSquared PlotSquared Main Class
*
* @see PS
*/
public PS getMain() {
return PS.get();
}
/**
* ChunkManager class contains several useful methods.
* <ul>
* <li>Chunk deletion</li>
* <li>Moving or copying regions</li>
* <li>Plot swapping</li>
* <li>Entity Tracking</li>
* <li>Region Regeneration</li>
* </ul>
*
* @return ChunkManager
*
* @see ChunkManager
*/
public ChunkManager getChunkManager() {
return ChunkManager.manager;
}
/**
* Get the block/biome set queue
* @return GlobalBlockQueue.IMP
*/
public GlobalBlockQueue getBlockQueue() {
return GlobalBlockQueue.IMP;
}
/**
* UUIDWrapper class has basic methods for getting UUIDS. It's recommended
* to use the UUIDHandler class instead.
*
* @return UUIDWrapper
*
* @see UUIDWrapper
*/
public UUIDWrapper getUUIDWrapper() {
return UUIDHandler.getUUIDWrapper();
}
/**
* Do not use this. Instead use FlagManager.[method] in your code.
* - Flag related stuff
*
* @return FlagManager
*
* @deprecated Use {@link FlagManager} directly
*/
@Deprecated
public FlagManager getFlagManager() {
return new FlagManager();
}
/**
* Do not use this. Instead use MainUtil.[method] in your code.
*
* @return MainUtil
* @deprecated Use {@link MainUtil} directly
*/
@Deprecated
public MainUtil getMainUtil() {
return new MainUtil();
}
/**
* Do not use this. Instead use C.PERMISSION_[method] in your code.
*
* @return Array of strings
*
* @see Permissions
* @deprecated Use {@link C} to list all the permissions
*/
@Deprecated
public String[] getPermissions() {
ArrayList<String> perms = new ArrayList<>();
for (C caption : C.values()) {
if ("static.permissions".equals(caption.getCategory())) {
perms.add(caption.s());
}
}
return perms.toArray(new String[perms.size()]);
}
/**
* SchematicHandler class contains methods related to pasting, reading
* and writing schematics.
*
* @return SchematicHandler
*
* @see SchematicHandler
*/
public SchematicHandler getSchematicHandler() {
return SchematicHandler.manager;
}
/**
* Use C.[caption] instead
*
* @return C
* @deprecated Use {@link C}
*/
@Deprecated
public C[] getCaptions() {
return C.values();
}
/**
* Get the plot manager for a world. Most of these methods can be accessed
* through the MainUtil.
*
* @param world the world to retrieve the manager from
*
* @return PlotManager
*
* @see PlotManager
* @see PS#getPlotManager(Plot)
*/
@SuppressWarnings("deprecation")
@Deprecated
public PlotManager getPlotManager(World world) {
if (world == null) {
return null;
}
return getPlotManager(world.getName());
}
/**
* Get a list of PlotAreas in the world.
* @param world The world to check for plot areas
* @return A set of PlotAreas
*/
public Set<PlotArea> getPlotAreas(World world) {
if (world == null) {
return Collections.emptySet();
}
return PS.get().getPlotAreas(world.getName());
}
/**
* Get the plot manager for a world. Contains useful low level methods for
* plot merging, clearing, and tessellation.
*
* @param world The world
*
* @return PlotManager
*
* @see PS#getPlotManager(Plot)
* @see PlotManager
*/
@Deprecated
public PlotManager getPlotManager(String world) {
Set<PlotArea> areas = PS.get().getPlotAreas(world);
switch (areas.size()) {
case 0:
return null;
case 1:
return areas.iterator().next().manager;
default:
PS.debug("PlotAPI#getPlotManager(org.bukkit.World) is deprecated and doesn't support multi plot area worlds.");
return null;
}
}
/**
* Get the settings for a world (settings bundled in PlotArea class). You
* will need to downcast for the specific settings a Generator has. e.g.
* DefaultPlotWorld class implements PlotArea
*
* @param world The World
*
* @return The {@link PlotArea} for the world or null if not in plotworld
*
* @see #getPlotAreas(World)
* @see PlotArea
*/
@SuppressWarnings("deprecation")
@Deprecated
public PlotArea getWorldSettings(World world) {
if (world == null) {
return null;
}
return getWorldSettings(world.getName());
}
/**
* Get the settings for a world.
*
* @param world the world to retrieve settings from
*
* @return The {@link PlotArea} for the world or null if not in plotworld
*
* @see PS#getPlotArea(String, String)
* @see PlotArea
*/
@Deprecated
public PlotArea getWorldSettings(String world) {
if (world == null) {
return null;
}
Set<PlotArea> areas = PS.get().getPlotAreas(world);
switch (areas.size()) {
case 0:
return null;
case 1:
return areas.iterator().next();
default:
PS.debug("PlotAPI#getWorldSettings(org.bukkit.World) is deprecated and doesn't support multi plot area worlds.");
return null;
}
}
/**
* Send a message to a player.
*
* @param player the recipient of the message
* @param caption the message
*
* @see MainUtil#sendMessage(PlotPlayer, C, String...)
*/
public void sendMessage(Player player, C caption) {
MainUtil.sendMessage(BukkitUtil.getPlayer(player), caption);
}
/**
* Send a message to a player. The message supports color codes.
*
* @param player the recipient of the message
* @param string the message
*
* @see MainUtil#sendMessage(PlotPlayer, String)
*/
public void sendMessage(Player player, String string) {
MainUtil.sendMessage(BukkitUtil.getPlayer(player), string);
}
/**
* Send a message to the console. The message supports color codes.
*
* @param message the message
*
* @see MainUtil#sendConsoleMessage(C, String...)
*/
public void sendConsoleMessage(String message) {
PS.log(message);
}
/**
* Send a message to the console.
*
* @param caption the message
*
* @see #sendConsoleMessage(String)
* @see C
*/
public void sendConsoleMessage(C caption) {
sendConsoleMessage(caption.s());
}
/**
* Registers a flag for use in plots.
*
* @param flag the flag to register
*
*/
public void addFlag(Flag<?> flag) {
Flags.registerFlag(flag);
}
/**
* Gets a plot based on the ID.
*
* @param world the world the plot is located in
* @param x The PlotID x coordinate
* @param z The PlotID y coordinate
*
* @return plot, null if ID is wrong
*
* @see PlotArea#getPlot(PlotId)
*/
@SuppressWarnings("deprecation")
@Deprecated
public Plot getPlot(World world, int x, int z) {
if (world == null) {
return null;
}
PlotArea area = getWorldSettings(world);
if (area == null) {
return null;
}
return area.getPlot(new PlotId(x, z));
}
/**
* Get a plot based on the location.
*
* @param location the location to check
*
* @return plot if found, otherwise it creates a temporary plot
*
* @see Plot
*/
public Plot getPlot(Location location) {
if (location == null) {
return null;
}
return BukkitUtil.getLocation(location).getPlot();
}
/**
* Get a plot based on the player location.
*
* @param player the player to check
*
* @return plot if found, otherwise it creates a temporary plot
*
* @see #getPlot(Location)
* @see Plot
*/
public Plot getPlot(Player player) {
return this.getPlot(player.getLocation());
}
/**
* Check whether or not a player has a plot.
*
* @param player Player that you want to check for
* @param world The world to check
* @return true if player has a plot, false if not.
*
* @see #getPlots(World, Player, boolean)
*/
@SuppressWarnings("deprecation")
@Deprecated
public boolean hasPlot(World world, Player player) {
return getPlots(world, player, true).length > 0;
}
/**
* Get all plots for the player.
*
* @param world The world to retrieve plots from
* @param player The player to search for
* @param justOwner should we just search for owner? Or with rights?
* @return An array of plots for the player
*/
@Deprecated
public Plot[] getPlots(World world, Player player, boolean justOwner) {
ArrayList<Plot> pPlots = new ArrayList<>();
UUID uuid = BukkitUtil.getPlayer(player).getUUID();
for (Plot plot : PS.get().getPlots(world.getName())) {
if (justOwner) {
if (plot.hasOwner() && plot.isOwner(uuid)) {
pPlots.add(plot);
}
} else if (plot.isAdded(uuid)) {
pPlots.add(plot);
}
}
return pPlots.toArray(new Plot[pPlots.size()]);
}
/**
* Get all plots for the world.
*
* @param world to get plots of
*
* @return Plot[] - array of plot objects in world
*
* @see PS#getPlots(String)
* @see Plot
*/
@Deprecated
public Plot[] getPlots(World world) {
if (world == null) {
return new Plot[0];
}
Collection<Plot> plots = PS.get().getPlots(world.getName());
return plots.toArray(new Plot[plots.size()]);
}
/**
* Get all plot worlds.
*
* @return World[] - array of plot worlds
*
*/
@SuppressWarnings("deprecation")
@Deprecated
public String[] getPlotWorlds() {
Set<String> plotWorldStrings = PS.get().getPlotWorldStrings();
return plotWorldStrings.toArray(new String[plotWorldStrings.size()]);
}
/**
* Get if plotworld.
*
* @param world The world to check
*
* @return boolean (if plot world or not)
*
* @see PS#hasPlotArea(String)
*/
@Deprecated
public boolean isPlotWorld(World world) {
return PS.get().hasPlotArea(world.getName());
}
/**
* Get plot locations.
*
* @param plot Plot to get the locations for
*
* @return [0] = bottomLc, [1] = topLoc, [2] = home
*
* @deprecated As merged plots may not have a rectangular shape
*
* @see Plot
*/
@SuppressWarnings("deprecation")
@Deprecated
public Location[] getLocations(Plot plot) {
Location bukkitBottom = BukkitUtil.getLocation(plot.getCorners()[0]);
Location bukkitTop = BukkitUtil.getLocation(plot.getCorners()[1]);
Location bukkitHome = BukkitUtil.getLocation(plot.getHome());
return new Location[]{bukkitBottom, bukkitTop, bukkitHome};
}
/**
* Get home location.
*
* @param plot Plot that you want to get the location for
*
* @return plot bottom location
*
* @see Plot
*/
public Location getHomeLocation(Plot plot) {
return BukkitUtil.getLocation(plot.getHome());
}
/**
* Get Bottom Location (min, min, min).
*
* @param plot Plot that you want to get the location for
*
* @return plot bottom location
*
* @deprecated As merged plots may not have a rectangular shape
*
* @see Plot
*/
@SuppressWarnings("deprecation")
@Deprecated
public Location getBottomLocation(Plot plot) {
return BukkitUtil.getLocation(plot.getCorners()[0]);
}
/**
* Get Top Location (max, max, max).
*
* @param plot Plot that you want to get the location for
*
* @return plot top location
*
* @deprecated As merged plots may not have a rectangular shape
*
* @see Plot
*/
@SuppressWarnings("deprecation")
@Deprecated
public Location getTopLocation(Plot plot) {
return BukkitUtil.getLocation(plot.getCorners()[1]);
}
/**
* Check whether or not a player is in a plot.
*
* @param player who we're checking for
*
* @return true if the player is in a plot, false if not-
*
*/
public boolean isInPlot(Player player) {
return getPlot(player) != null;
}
/**
* Register a subcommand.
* @deprecated Command registration is done on object creation
* @param c SubCommand, that we want to register
* @see SubCommand
*/
@Deprecated
public void registerCommand(SubCommand c) {
PS.debug("SubCommands are now registered on creation");
}
/**
* Gets the PlotSquared class.
*
* @return PlotSquared Class
*
* @see PS
*/
public PS getPlotSquared() {
return PS.get();
}
/**
* Gets the player plot count.
*
* @param world Specify the world we want to select the plots from
* @param player Player, for whom we're getting the plot count
*
* @return the number of plots the player has
*
*/
public int getPlayerPlotCount(World world, Player player) {
if (world == null) {
return 0;
}
return BukkitUtil.getPlayer(player).getPlotCount(world.getName());
}
/**
* Gets a collection containing the players plots.
*
* @param world Specify the world we want to select the plots from
* @param player Player, for whom we're getting the plots
*
* @return a set containing the players plots
*
* @see PS#getPlots(String, PlotPlayer)
*
* @see Plot
*/
public Set<Plot> getPlayerPlots(World world, Player player) {
if (world == null) {
return new HashSet<>();
}
return PlotPlayer.wrap(player).getPlots(world.getName());
}
/**
* Gets the number of plots, which the player is able to build in.
*
* @param player player, for whom we're getting the plots
*
* @return the number of allowed plots
*
*/
public int getAllowedPlots(Player player) {
PlotPlayer plotPlayer = PlotPlayer.wrap(player);
return plotPlayer.getAllowedPlots();
}
/**
* Gets the PlotPlayer for a player. The PlotPlayer is usually cached and
* will provide useful functions relating to players.
*
* @see PlotPlayer#wrap(Object)
*
* @param player the player to wrap
* @return a {@code PlotPlayer}
*/
public PlotPlayer wrapPlayer(Player player) {
return PlotPlayer.wrap(player);
}
/**
* Get the PlotPlayer for a UUID.
*
* <p><i>Please note that PlotSquared can be configured to provide
* different UUIDs than bukkit</i>
*
* @see PlotPlayer#wrap(Object)
*
* @param uuid the uuid of the player to wrap
* @return a {@code PlotPlayer}
*/
public PlotPlayer wrapPlayer(UUID uuid) {
return PlotPlayer.wrap(uuid);
}
/**
* Get the PlotPlayer for a username.
*
* @see PlotPlayer#wrap(Object)
*
* @param player the player to wrap
* @return a {@code PlotPlayer}
*/
public PlotPlayer wrapPlayer(String player) {
return PlotPlayer.wrap(player);
}
/**
* Get the PlotPlayer for an offline player.
*
* <p>Note that this will work if the player is offline, however not all
* functionality will work.
*
* @see PlotPlayer#wrap(Object)
*
* @param player the player to wrap
* @return a {@code PlotPlayer}
*/
public PlotPlayer wrapPlayer(OfflinePlayer player) {
return PlotPlayer.wrap(player);
}
}

View File

@ -0,0 +1,86 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit;
import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.core.command.MainCommand;
import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.player.ConsolePlayer;
import com.plotsquared.core.player.PlotPlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.command.ProxiedCommandSender;
import org.bukkit.command.RemoteConsoleCommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
public class BukkitCommand implements CommandExecutor, TabCompleter {
@Override
public boolean onCommand(
CommandSender commandSender, Command command, String commandLabel,
String[] args
) {
if (commandSender instanceof Player) {
return MainCommand.onCommand(BukkitUtil.adapt((Player) commandSender), args);
}
if (commandSender instanceof ConsoleCommandSender
|| commandSender instanceof ProxiedCommandSender
|| commandSender instanceof RemoteConsoleCommandSender) {
return MainCommand.onCommand(ConsolePlayer.getConsole(), args);
}
return false;
}
@Override
public List<String> onTabComplete(
CommandSender commandSender, Command command, String label,
String[] args
) {
if (!(commandSender instanceof Player)) {
return null;
}
PlotPlayer<?> player = BukkitUtil.adapt((Player) commandSender);
if (args.length == 0) {
return Collections.singletonList("plots");
}
if (!Settings.Enabled_Components.TAB_COMPLETED_ALIASES.contains(label.toLowerCase(Locale.ENGLISH))) {
return List.of();
}
Collection<com.plotsquared.core.command.Command> objects =
MainCommand.getInstance().tab(player, args, label.endsWith(" "));
if (objects == null) {
return null;
}
List<String> result = new ArrayList<>();
for (com.plotsquared.core.command.Command o : objects) {
result.add(o.toString());
}
return result;
}
}

View File

@ -1,759 +0,0 @@
package com.plotsquared.bukkit;
import com.intellectualcrafters.configuration.ConfigurationSection;
import com.intellectualcrafters.plot.IPlotMain;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.ConfigurationNode;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.generator.GeneratorWrapper;
import com.intellectualcrafters.plot.generator.HybridGen;
import com.intellectualcrafters.plot.generator.HybridUtils;
import com.intellectualcrafters.plot.generator.IndependentPlotGenerator;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotArea;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.RunnableVal;
import com.intellectualcrafters.plot.object.SetupObject;
import com.intellectualcrafters.plot.object.chat.PlainChatManager;
import com.intellectualcrafters.plot.util.AbstractTitle;
import com.intellectualcrafters.plot.util.ChatManager;
import com.intellectualcrafters.plot.util.ChunkManager;
import com.intellectualcrafters.plot.util.ConsoleColors;
import com.intellectualcrafters.plot.util.EconHandler;
import com.intellectualcrafters.plot.util.EventUtil;
import com.intellectualcrafters.plot.util.InventoryUtil;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.SchematicHandler;
import com.intellectualcrafters.plot.util.SetupUtils;
import com.intellectualcrafters.plot.util.StringMan;
import com.intellectualcrafters.plot.util.TaskManager;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.intellectualcrafters.plot.util.UUIDHandlerImplementation;
import com.intellectualcrafters.plot.util.WorldUtil;
import com.intellectualcrafters.plot.util.block.QueueProvider;
import com.intellectualcrafters.plot.uuid.UUIDWrapper;
import com.plotsquared.bukkit.database.plotme.ClassicPlotMeConnector;
import com.plotsquared.bukkit.database.plotme.LikePlotMeConverter;
import com.plotsquared.bukkit.database.plotme.PlotMeConnector_017;
import com.plotsquared.bukkit.generator.BukkitPlotGenerator;
import com.plotsquared.bukkit.listeners.ChunkListener;
import com.plotsquared.bukkit.listeners.EntitySpawnListener;
import com.plotsquared.bukkit.listeners.PlayerEvents;
import com.plotsquared.bukkit.listeners.PlayerEvents183;
import com.plotsquared.bukkit.listeners.PlayerEvents_1_8;
import com.plotsquared.bukkit.listeners.PlayerEvents_1_9;
import com.plotsquared.bukkit.listeners.PlotPlusListener;
import com.plotsquared.bukkit.listeners.WorldEvents;
import com.plotsquared.bukkit.titles.DefaultTitle_19;
import com.plotsquared.bukkit.util.BukkitChatManager;
import com.plotsquared.bukkit.util.BukkitChunkManager;
import com.plotsquared.bukkit.util.BukkitCommand;
import com.plotsquared.bukkit.util.BukkitEconHandler;
import com.plotsquared.bukkit.util.BukkitEventUtil;
import com.plotsquared.bukkit.util.BukkitHybridUtils;
import com.plotsquared.bukkit.util.BukkitInventoryUtil;
import com.plotsquared.bukkit.util.BukkitSchematicHandler;
import com.plotsquared.bukkit.util.BukkitSetupUtils;
import com.plotsquared.bukkit.util.BukkitTaskManager;
import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.bukkit.util.BukkitVersion;
import com.plotsquared.bukkit.util.Metrics;
import com.plotsquared.bukkit.util.SendChunk;
import com.plotsquared.bukkit.util.SetGenCB;
import com.plotsquared.bukkit.util.block.BukkitLocalQueue;
import com.plotsquared.bukkit.util.block.BukkitLocalQueue_1_7;
import com.plotsquared.bukkit.util.block.BukkitLocalQueue_1_8;
import com.plotsquared.bukkit.util.block.BukkitLocalQueue_1_8_3;
import com.plotsquared.bukkit.util.block.BukkitLocalQueue_1_9;
import com.plotsquared.bukkit.uuid.DefaultUUIDWrapper;
import com.plotsquared.bukkit.uuid.FileUUIDHandler;
import com.plotsquared.bukkit.uuid.LowerOfflineUUIDWrapper;
import com.plotsquared.bukkit.uuid.OfflineUUIDWrapper;
import com.plotsquared.bukkit.uuid.SQLUUIDHandler;
import com.sk89q.worldedit.WorldEdit;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.OfflinePlayer;
import org.bukkit.World;
import org.bukkit.command.PluginCommand;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.generator.ChunkGenerator;
import org.bukkit.metadata.MetadataValue;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import java.io.File;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
private static ConcurrentHashMap<String, Plugin> pluginMap;
static {
// Disable AWE as otherwise both fail to load
PluginManager manager = Bukkit.getPluginManager();
try {
Settings.load(new File("plugins/PlotSquared/config/settings.yml"));
if (Settings.Enabled_Components.PLOTME_CONVERTER) { // Only disable PlotMe if conversion is enabled
Field pluginsField = manager.getClass().getDeclaredField("plugins");
Field lookupNamesField = manager.getClass().getDeclaredField("lookupNames");
pluginsField.setAccessible(true);
lookupNamesField.setAccessible(true);
List<Plugin> plugins = (List<Plugin>) pluginsField.get(manager);
Iterator<Plugin> iter = plugins.iterator();
while (iter.hasNext()) {
if (iter.next().getName().startsWith("PlotMe")) {
iter.remove();
}
}
Map<String, Plugin> lookupNames = (Map<String, Plugin>) lookupNamesField.get(manager);
lookupNames.remove("PlotMe");
lookupNames.remove("PlotMe-DefaultGenerator");
pluginsField.set(manager, new ArrayList<Plugin>(plugins) {
@Override
public boolean add(Plugin plugin) {
if (plugin.getName().startsWith("PlotMe")) {
System.out.print("Disabling `" + plugin.getName() + "` for PlotMe conversion (configure in PlotSquared settings.yml)");
} else {
return super.add(plugin);
}
return false;
}
});
pluginMap = new ConcurrentHashMap<String, Plugin>(lookupNames) {
@Override
public Plugin put(String key, Plugin plugin) {
if (!plugin.getName().startsWith("PlotMe")) {
return super.put(key, plugin);
}
return null;
}
};
lookupNamesField.set(manager, pluginMap);
}
} catch (Throwable ignore) {}
}
public static WorldEdit worldEdit;
private int[] version;
private String name;
@Override
public int[] getServerVersion() {
if (this.version == null) {
try {
this.version = new int[3];
String[] split = Bukkit.getBukkitVersion().split("-")[0].split("\\.");
this.version[0] = Integer.parseInt(split[0]);
this.version[1] = Integer.parseInt(split[1]);
if (split.length == 3) {
this.version[2] = Integer.parseInt(split[2]);
}
} catch (NumberFormatException e) {
e.printStackTrace();
PS.debug(StringMan.getString(Bukkit.getBukkitVersion()));
PS.debug(StringMan.getString(Bukkit.getBukkitVersion().split("-")[0].split("\\.")));
return new int[]{1, 10, 0};
}
}
return this.version;
}
@Override
public void onEnable() {
if (pluginMap != null) {
pluginMap.put("PlotMe-DefaultGenerator", this);
}
this.name = getDescription().getName();
getServer().getName();
new PS(this, "Bukkit");
if (Settings.Enabled_Components.METRICS) {
new Metrics(this).start();
PS.log(C.PREFIX + "&6Metrics enabled.");
} else {
PS.log(C.CONSOLE_PLEASE_ENABLE_METRICS.f(getPluginName()));
}
}
@Override
public void onDisable() {
PS.get().disable();
Bukkit.getScheduler().cancelTasks(this);
}
@Override
public void log(String message) {
try {
message = C.color(message);
if (!Settings.Chat.CONSOLE_COLOR) {
message = ChatColor.stripColor(message);
}
this.getServer().getConsoleSender().sendMessage(message);
} catch (Throwable ignored) {
System.out.println(ConsoleColors.fromString(message));
}
}
@Override
public void disable() {
onDisable();
}
@Override
public int[] getPluginVersion() {
String ver = getDescription().getVersion();
if (ver.contains("-")) {
ver = ver.split("-")[0];
}
String[] split = ver.split("\\.");
return new int[]{Integer.parseInt(split[0]), Integer.parseInt(split[1]), Integer.parseInt(split[2])};
}
@Override public String getPluginVersionString() {
return getDescription().getVersion();
}
@Override
public String getPluginName() {
return name;
}
@Override
public void registerCommands() {
BukkitCommand bukkitCommand = new BukkitCommand();
PluginCommand plotCommand = getCommand("plots");
plotCommand.setExecutor(bukkitCommand);
plotCommand.setAliases(Arrays.asList("p", "ps", "plotme", "plot"));
plotCommand.setTabCompleter(bukkitCommand);
}
@Override
public File getDirectory() {
return getDataFolder();
}
@Override
public File getWorldContainer() {
return Bukkit.getWorldContainer();
}
@Override
public TaskManager getTaskManager() {
return new BukkitTaskManager(this);
}
@Override
public void runEntityTask() {
PS.log(C.PREFIX + "KillAllEntities started.");
TaskManager.runTaskRepeat(new Runnable() {
@Override
public void run() {
PS.get().foreachPlotArea(new RunnableVal<PlotArea>() {
@Override
public void run(PlotArea plotArea) {
World world = Bukkit.getWorld(plotArea.worldname);
try {
if (world == null) {
return;
}
List<Entity> entities = world.getEntities();
Iterator<Entity> iterator = entities.iterator();
while (iterator.hasNext()) {
Entity entity = iterator.next();
switch (entity.getType()) {
case EGG:
case COMPLEX_PART:
case FISHING_HOOK:
case ENDER_SIGNAL:
case LINGERING_POTION:
case AREA_EFFECT_CLOUD:
case EXPERIENCE_ORB:
case LEASH_HITCH:
case FIREWORK:
case WEATHER:
case LIGHTNING:
case WITHER_SKULL:
case UNKNOWN:
case PLAYER:
// non moving / unmovable
continue;
case THROWN_EXP_BOTTLE:
case SPLASH_POTION:
case SNOWBALL:
case SHULKER_BULLET:
case SPECTRAL_ARROW:
case TIPPED_ARROW:
case ENDER_PEARL:
case ARROW:
case LLAMA_SPIT:
// managed elsewhere | projectile
continue;
case ITEM_FRAME:
case PAINTING:
// Not vehicles
continue;
case ARMOR_STAND:
// Temporarily classify as vehicle
case MINECART:
case MINECART_CHEST:
case MINECART_COMMAND:
case MINECART_FURNACE:
case MINECART_HOPPER:
case MINECART_MOB_SPAWNER:
case ENDER_CRYSTAL:
case MINECART_TNT:
case BOAT:
if (Settings.Enabled_Components.KILL_ROAD_VEHICLES) {
com.intellectualcrafters.plot.object.Location location = BukkitUtil.getLocation(entity.getLocation());
Plot plot = location.getPlot();
if (plot == null) {
if (location.isPlotArea()) {
iterator.remove();
entity.remove();
}
continue;
}
List<MetadataValue> meta = entity.getMetadata("plot");
if (meta.isEmpty()) {
continue;
}
Plot origin = (Plot) meta.get(0).value();
if (!plot.equals(origin.getBasePlot(false))) {
iterator.remove();
entity.remove();
}
continue;
} else {
continue;
}
case SMALL_FIREBALL:
case FIREBALL:
case DRAGON_FIREBALL:
case DROPPED_ITEM:
// dropped item
continue;
case PRIMED_TNT:
case FALLING_BLOCK:
// managed elsewhere
continue;
case LLAMA:
case DONKEY:
case MULE:
case ZOMBIE_HORSE:
case SKELETON_HORSE:
case HUSK:
case ELDER_GUARDIAN:
case WITHER_SKELETON:
case STRAY:
case ZOMBIE_VILLAGER:
case EVOKER:
case EVOKER_FANGS:
case VEX:
case VINDICATOR:
case POLAR_BEAR:
case BAT:
case BLAZE:
case CAVE_SPIDER:
case CHICKEN:
case COW:
case CREEPER:
case ENDERMAN:
case ENDERMITE:
case ENDER_DRAGON:
case GHAST:
case GIANT:
case GUARDIAN:
case HORSE:
case IRON_GOLEM:
case MAGMA_CUBE:
case MUSHROOM_COW:
case OCELOT:
case PIG:
case PIG_ZOMBIE:
case RABBIT:
case SHEEP:
case SILVERFISH:
case SKELETON:
case SLIME:
case SNOWMAN:
case SPIDER:
case SQUID:
case VILLAGER:
case WITCH:
case WITHER:
case WOLF:
case ZOMBIE:
case SHULKER:
default:
if (Settings.Enabled_Components.KILL_ROAD_MOBS) {
Location location = entity.getLocation();
if (BukkitUtil.getLocation(location).isPlotRoad()) {
if (entity instanceof LivingEntity) {
LivingEntity livingEntity = (LivingEntity) entity;
if (!livingEntity.isLeashed() || !entity.hasMetadata("keep")) {
Entity passenger = entity.getPassenger();
if (!(passenger instanceof Player) && entity.getMetadata("keep").isEmpty()) {
iterator.remove();
entity.remove();
}
}
} else {
Entity passenger = entity.getPassenger();
if (!(passenger instanceof Player) && entity.getMetadata("keep").isEmpty()) {
iterator.remove();
entity.remove();
}
}
}
}
}
}
} catch (Throwable e) {
e.printStackTrace();
}
}
});
}
}, 20);
}
@Override
public final ChunkGenerator getDefaultWorldGenerator(String world, String id) {
if (Settings.Enabled_Components.PLOTME_CONVERTER) {
initPlotMeConverter();
Settings.Enabled_Components.PLOTME_CONVERTER = false;
}
IndependentPlotGenerator result = PS.get().IMP.getDefaultGenerator();
if (!PS.get().setupPlotWorld(world, id, result)) {
return null;
}
return (ChunkGenerator) result.specify(world);
}
@Override
public void registerPlayerEvents() {
PlayerEvents main = new PlayerEvents();
getServer().getPluginManager().registerEvents(main, this);
try {
getServer().getClass().getMethod("spigot");
getServer().getPluginManager().registerEvents(new EntitySpawnListener(), this);
} catch (NoSuchMethodException ignored) {
PS.debug("Not running Spigot. Skipping EntitySpawnListener event.");
}
if (PS.get().checkVersion(getServerVersion(), BukkitVersion.v1_8_0)) {
try {
getServer().getPluginManager().registerEvents(new PlayerEvents_1_8(), this);
} catch (Throwable e) {
e.printStackTrace();
}
}
if (PS.get().checkVersion(getServerVersion(), BukkitVersion.v1_8_3)) {
try {
getServer().getPluginManager().registerEvents(new PlayerEvents183(), this);
} catch (Throwable e) {
e.printStackTrace();
}
}
if (PS.get().checkVersion(getServerVersion(), BukkitVersion.v1_9_0)) {
try {
getServer().getPluginManager().registerEvents(new PlayerEvents_1_9(main), this);
} catch (Throwable e) {
e.printStackTrace();
}
}
}
@Override
public void registerInventoryEvents() {
// Part of PlayerEvents - can be moved if necessary
}
@Override
public void registerPlotPlusEvents() {
PlotPlusListener.startRunnable(this);
getServer().getPluginManager().registerEvents(new PlotPlusListener(), this);
}
@Override
public void registerForceFieldEvents() {
}
@Override
public boolean initWorldEdit() {
if (getServer().getPluginManager().getPlugin("WorldEdit") != null) {
worldEdit = WorldEdit.getInstance();
return true;
}
return false;
}
@Override
public EconHandler getEconomyHandler() {
try {
BukkitEconHandler econ = new BukkitEconHandler();
if (econ.init()) {
return econ;
}
} catch (Throwable ignored) {
PS.debug("No economy detected!");
}
return null;
}
@Override
public QueueProvider initBlockQueue() {
try {
new SendChunk();
MainUtil.canSendChunk = true;
} catch (ClassNotFoundException | NoSuchFieldException | NoSuchMethodException e) {
PS.debug(SendChunk.class + " does not support " + StringMan.getString(getServerVersion()));
MainUtil.canSendChunk = false;
}
if (PS.get().checkVersion(getServerVersion(), BukkitVersion.v1_9_0)) {
return QueueProvider.of(BukkitLocalQueue_1_9.class, BukkitLocalQueue.class);
}
if (PS.get().checkVersion(getServerVersion(), BukkitVersion.v1_8_3)) {
return QueueProvider.of(BukkitLocalQueue_1_8_3.class, BukkitLocalQueue.class);
}
if (PS.get().checkVersion(getServerVersion(), BukkitVersion.v1_8_0)) {
return QueueProvider.of(BukkitLocalQueue_1_8.class, BukkitLocalQueue.class);
}
return QueueProvider.of(BukkitLocalQueue_1_7.class, BukkitLocalQueue.class);
}
@Override
public WorldUtil initWorldUtil() {
return new BukkitUtil();
}
@Override
public boolean initPlotMeConverter() {
if (new LikePlotMeConverter("PlotMe").run(new ClassicPlotMeConnector())) {
return true;
} else if (new LikePlotMeConverter("PlotMe").run(new PlotMeConnector_017())) {
return true;
}
return false;
}
@Override
public GeneratorWrapper<?> getGenerator(String world, String name) {
if (name == null) {
return null;
}
Plugin genPlugin = Bukkit.getPluginManager().getPlugin(name);
if (genPlugin != null && genPlugin.isEnabled()) {
ChunkGenerator gen = genPlugin.getDefaultWorldGenerator(world, "");
if (gen instanceof GeneratorWrapper<?>) {
return (GeneratorWrapper<?>) gen;
}
return new BukkitPlotGenerator(world, gen);
} else {
return new BukkitPlotGenerator(PS.get().IMP.getDefaultGenerator());
}
}
@Override
public HybridUtils initHybridUtils() {
return new BukkitHybridUtils();
}
@Override
public SetupUtils initSetupUtils() {
return new BukkitSetupUtils();
}
@Override
public UUIDHandlerImplementation initUUIDHandler() {
boolean checkVersion = PS.get().checkVersion(getServerVersion(), BukkitVersion.v1_7_6);
UUIDWrapper wrapper;
if (Settings.UUID.OFFLINE) {
if (Settings.UUID.FORCE_LOWERCASE) {
wrapper = new LowerOfflineUUIDWrapper();
} else {
wrapper = new OfflineUUIDWrapper();
}
Settings.UUID.OFFLINE = true;
} else if (checkVersion) {
wrapper = new DefaultUUIDWrapper();
Settings.UUID.OFFLINE = false;
} else {
if (Settings.UUID.FORCE_LOWERCASE) {
wrapper = new LowerOfflineUUIDWrapper();
} else {
wrapper = new OfflineUUIDWrapper();
}
Settings.UUID.OFFLINE = true;
}
if (!checkVersion) {
PS.log(C.PREFIX + " &c[WARN] Titles are disabled - please update your version of Bukkit to support this feature.");
Settings.TITLES = false;
} else {
AbstractTitle.TITLE_CLASS = new DefaultTitle_19();
if (wrapper instanceof DefaultUUIDWrapper || wrapper.getClass() == OfflineUUIDWrapper.class && !Bukkit.getOnlineMode()) {
Settings.UUID.NATIVE_UUID_PROVIDER = true;
}
}
if (Settings.UUID.OFFLINE) {
PS.log(C.PREFIX
+ " &6" + getPluginName() + " is using Offline Mode UUIDs either because of user preference, or because you are using an old version of "
+ "Bukkit");
} else {
PS.log(C.PREFIX + " &6" + getPluginName() + " is using online UUIDs");
}
if (Settings.UUID.USE_SQLUUIDHANDLER) {
return new SQLUUIDHandler(wrapper);
} else {
return new FileUUIDHandler(wrapper);
}
}
@Override
public ChunkManager initChunkManager() {
return new BukkitChunkManager();
}
@Override
public EventUtil initEventUtil() {
return new BukkitEventUtil();
}
@Override
public void unregister(PlotPlayer player) {
BukkitUtil.removePlayer(player.getName());
}
@Override
public void registerChunkProcessor() {
getServer().getPluginManager().registerEvents(new ChunkListener(), this);
}
@Override
public void registerWorldEvents() {
getServer().getPluginManager().registerEvents(new WorldEvents(), this);
}
@Override
public IndependentPlotGenerator getDefaultGenerator() {
return new HybridGen();
}
@Override
public InventoryUtil initInventoryUtil() {
return new BukkitInventoryUtil();
}
@Override
public void startMetrics() {
new Metrics(this).start();
PS.log(C.PREFIX + "&6Metrics enabled.");
}
@Override
public void setGenerator(String worldName) {
World world = BukkitUtil.getWorld(worldName);
if (world == null) {
// create world
ConfigurationSection worldConfig = PS.get().worlds.getConfigurationSection("worlds." + worldName);
String manager = worldConfig.getString("generator.plugin", getPluginName());
SetupObject setup = new SetupObject();
setup.plotManager = manager;
setup.setupGenerator = worldConfig.getString("generator.init", manager);
setup.type = worldConfig.getInt("generator.type");
setup.terrain = worldConfig.getInt("generator.terrain");
setup.step = new ConfigurationNode[0];
setup.world = worldName;
SetupUtils.manager.setupWorld(setup);
world = Bukkit.getWorld(worldName);
} else {
try {
if (!PS.get().hasPlotArea(worldName)) {
SetGenCB.setGenerator(BukkitUtil.getWorld(worldName));
}
} catch (Exception ignored) {
PS.log("Failed to reload world: " + world + " | " + ignored.getMessage());
Bukkit.getServer().unloadWorld(world, false);
return;
}
}
ChunkGenerator gen = world.getGenerator();
if (gen instanceof BukkitPlotGenerator) {
PS.get().loadWorld(worldName, (BukkitPlotGenerator) gen);
} else if (gen != null) {
PS.get().loadWorld(worldName, new BukkitPlotGenerator(worldName, gen));
} else if (PS.get().worlds.contains("worlds." + worldName)) {
PS.get().loadWorld(worldName, null);
}
}
@Override
public SchematicHandler initSchematicHandler() {
return new BukkitSchematicHandler();
}
@Override
public AbstractTitle initTitleManager() {
// Already initialized in UUID handler
return AbstractTitle.TITLE_CLASS;
}
@Override
public PlotPlayer wrapPlayer(Object player) {
if (player instanceof Player) {
return BukkitUtil.getPlayer((Player) player);
}
if (player instanceof OfflinePlayer) {
return BukkitUtil.getPlayer((OfflinePlayer) player);
}
if (player instanceof String) {
return UUIDHandler.getPlayer((String) player);
}
if (player instanceof UUID) {
return UUIDHandler.getPlayer((UUID) player);
}
return null;
}
@Override
public String getNMSPackage() {
String name = Bukkit.getServer().getClass().getPackage().getName();
return name.substring(name.lastIndexOf('.') + 1);
}
@Override
public ChatManager<?> initChatManager() {
if (Settings.Chat.INTERACTIVE) {
return new BukkitChatManager();
} else {
return new PlainChatManager();
}
}
@Override
public GeneratorWrapper<?> wrapPlotGenerator(String world, IndependentPlotGenerator generator) {
return new BukkitPlotGenerator(generator);
}
@Override
public List<String> getPluginIds() {
ArrayList<String> names = new ArrayList<>();
for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
names.add(plugin.getName() + ';' + plugin.getDescription().getVersion() + ':' + plugin.isEnabled());
}
return names;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,111 +0,0 @@
package com.plotsquared.bukkit.chat;
import org.apache.commons.lang.Validate;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Collection;
/**
* Represents a wrapper around an array class of an arbitrary reference type,
* which properly implements "value" hash code and equality functions.
* <p>
* This class is intended for use as a key to a map.
* </p>
*
* @param <E> The type of elements in the array.
* @author Glen Husman
* @see Arrays
*/
public final class ArrayWrapper<E> {
/**
* Creates an array wrapper with some elements.
*
* @param elements The elements of the array.
*/
public ArrayWrapper(E... elements) {
setArray(elements);
}
private E[] _array;
/**
* Retrieves a reference to the wrapped array instance.
*
* @return The array wrapped by this instance.
*/
public E[] getArray() {
return _array;
}
/**
* Set this wrapper to wrap a new array instance.
*
* @param array The new wrapped array.
*/
public void setArray(E[] array) {
Validate.notNull(array, "The array must not be null.");
_array = array;
}
/**
* Determines if this object has a value equivalent to another object.
*
* @see Arrays#equals(Object[], Object[])
*/
@SuppressWarnings("rawtypes")
@Override
public boolean equals(Object other) {
if (!(other instanceof ArrayWrapper)) {
return false;
}
return Arrays.equals(_array, ((ArrayWrapper) other)._array);
}
/**
* Gets the hash code represented by this objects value.
*
* @return This object's hash code.
* @see Arrays#hashCode(Object[])
*/
@Override
public int hashCode() {
return Arrays.hashCode(_array);
}
/**
* Converts an iterable element collection to an array of elements.
* The iteration order of the specified object will be used as the array element order.
*
* @param list The iterable of objects which will be converted to an array.
* @param c The type of the elements of the array.
* @return An array of elements in the specified iterable.
*/
@SuppressWarnings("unchecked")
public static <T> T[] toArray(Iterable<? extends T> list, Class<T> c) {
int size = -1;
if (list instanceof Collection<?>) {
@SuppressWarnings("rawtypes")
Collection coll = (Collection) list;
size = coll.size();
}
if (size < 0) {
size = 0;
// Ugly hack: Count it ourselves
for (@SuppressWarnings("unused") T element : list) {
size++;
}
}
T[] result = (T[]) Array.newInstance(c, size);
int i = 0;
for (T element : list) { // Assumes iteration order is consistent
result[i++] = element; // Assign array element at index THEN increment counter
}
return result;
}
}

View File

@ -1,886 +0,0 @@
package com.plotsquared.bukkit.chat;
import static com.plotsquared.bukkit.chat.TextualComponent.rawText;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.stream.JsonWriter;
import org.bukkit.Achievement;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Statistic;
import org.bukkit.Statistic.Type;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.configuration.serialization.ConfigurationSerialization;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import java.io.IOException;
import java.io.StringWriter;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
/**
* Represents a formattable message. Such messages can use elements such as colors, formatting codes, hover and click data, and other features provided by the vanilla Minecraft <a href="http://minecraft.gamepedia.com/Tellraw#Raw_JSON_Text">JSON message formatter</a>.
* This class allows plugins to emulate the functionality of the vanilla Minecraft <a href="http://minecraft.gamepedia.com/Commands#tellraw">tellraw command</a>.
* <p>
* This class follows the builder pattern, allowing for method chaining.
* It is set up such that invocations of property-setting methods will affect the current editing component,
* and a call to {@link #then()} or {@link #then(String)} will append a new editing component to the end of the message,
* optionally initializing it with text. Further property-setting method calls will affect that editing component.
* </p>
*/
public class FancyMessage implements JsonRepresentedObject, Cloneable, Iterable<MessagePart>, ConfigurationSerializable {
static {
ConfigurationSerialization.registerClass(FancyMessage.class);
}
private List<MessagePart> messageParts;
private String jsonString;
private boolean dirty;
private static Constructor<?> nmsPacketPlayOutChatConstructor;
@Override
public FancyMessage clone() throws CloneNotSupportedException {
FancyMessage instance = (FancyMessage) super.clone();
instance.messageParts = new ArrayList<>(messageParts.size());
for (int i = 0; i < messageParts.size(); i++) {
instance.messageParts.add(i, messageParts.get(i).clone());
}
instance.dirty = false;
instance.jsonString = null;
return instance;
}
/**
* Creates a JSON message with text.
*
* @param firstPartText The existing text in the message.
*/
public FancyMessage(final String firstPartText) {
this(rawText(firstPartText));
}
private FancyMessage(final TextualComponent firstPartText) {
messageParts = new ArrayList<>();
messageParts.add(new MessagePart(firstPartText));
jsonString = null;
dirty = false;
if (nmsPacketPlayOutChatConstructor == null) {
try {
nmsPacketPlayOutChatConstructor = Reflection.getNMSClass("PacketPlayOutChat").getDeclaredConstructor(Reflection.getNMSClass("IChatBaseComponent"));
nmsPacketPlayOutChatConstructor.setAccessible(true);
} catch (NoSuchMethodException e) {
Bukkit.getLogger().log(Level.SEVERE, "Could not find Minecraft method or constructor.", e);
} catch (SecurityException e) {
Bukkit.getLogger().log(Level.WARNING, "Could not access constructor.", e);
}
}
}
/**
* Creates a JSON message without text.
*/
public FancyMessage() {
this((TextualComponent) null);
}
/**
* Sets the text of the current editing component to a value.
*
* @param text The new text of the current editing component.
* @return This builder instance.
*/
public FancyMessage text(String text) {
MessagePart latest = latest();
latest.text = rawText(text);
dirty = true;
return this;
}
/**
* Sets the text of the current editing component to a value.
*
* @param text The new text of the current editing component.
* @return This builder instance.
*/
public FancyMessage text(TextualComponent text) {
MessagePart latest = latest();
latest.text = text;
dirty = true;
return this;
}
/**
* Sets the color of the current editing component to a value.
*
* @param color The new color of the current editing component.
* @return This builder instance.
* @throws IllegalArgumentException If the specified {@code ChatColor} enumeration value is not a color (but a format value).
*/
public FancyMessage color(final ChatColor color) {
if (!color.isColor()) {
throw new IllegalArgumentException(color.name() + " is not a color");
}
latest().color = color;
dirty = true;
return this;
}
/**
* Sets the stylization of the current editing component.
*
* @param styles The array of styles to apply to the editing component.
* @return This builder instance.
* @throws IllegalArgumentException If any of the enumeration values in the array do not represent formatters.
*/
public FancyMessage style(ChatColor... styles) {
for (final ChatColor style : styles) {
if (!style.isFormat()) {
throw new IllegalArgumentException(style.name() + " is not a style");
}
}
latest().styles.addAll(Arrays.asList(styles));
dirty = true;
return this;
}
/**
* Set the behavior of the current editing component to instruct the client to open a file on the client side filesystem when the currently edited part of the {@code FancyMessage} is clicked.
*
* @param path The path of the file on the client filesystem.
* @return This builder instance.
*/
public FancyMessage file(final String path) {
onClick("open_file", path);
return this;
}
/**
* Set the behavior of the current editing component to instruct the client to open a webpage in the client's web browser when the currently edited part of the {@code FancyMessage} is clicked.
*
* @param url The URL of the page to open when the link is clicked.
* @return This builder instance.
*/
public FancyMessage link(final String url) {
onClick("open_url", url);
return this;
}
/**
* Set the behavior of the current editing component to instruct the client to replace the chat input box content with the specified string when the currently edited part of the {@code FancyMessage} is clicked.
* The client will not immediately send the command to the server to be executed unless the client player submits the command/chat message, usually with the enter key.
*
* @param command The text to display in the chat bar of the client.
* @return This builder instance.
*/
public FancyMessage suggest(final String command) {
onClick("suggest_command", command);
return this;
}
/**
* Set the behavior of the current editing component to instruct the client to append the chat input box content with the specified string when the currently edited part of the {@code FancyMessage} is SHIFT-CLICKED.
* The client will not immediately send the command to the server to be executed unless the client player submits the command/chat message, usually with the enter key.
*
* @param command The text to append to the chat bar of the client.
* @return This builder instance.
*/
public FancyMessage insert(final String command) {
latest().insertionData = command;
dirty = true;
return this;
}
/**
* Set the behavior of the current editing component to instruct the client to send the specified string to the server as a chat message when the currently edited part of the {@code FancyMessage} is clicked.
* The client <b>will</b> immediately send the command to the server to be executed when the editing component is clicked.
*
* @param command The text to display in the chat bar of the client.
* @return This builder instance.
*/
public FancyMessage command(final String command) {
onClick("run_command", command);
return this;
}
/**
* Set the behavior of the current editing component to display information about an achievement when the client hovers over the text.
* <p>Tooltips do not inherit display characteristics, such as color and styles, from the message component on which they are applied.</p>
*
* @param name The name of the achievement to display, excluding the "achievement." prefix.
* @return This builder instance.
*/
public FancyMessage achievementTooltip(final String name) {
onHover("show_achievement", new JsonString("achievement." + name));
return this;
}
/**
* Set the behavior of the current editing component to display information about an achievement when the client hovers over the text.
* <p>Tooltips do not inherit display characteristics, such as color and styles, from the message component on which they are applied.</p>
*
* @param which The achievement to display.
* @return This builder instance.
*/
public FancyMessage achievementTooltip(final Achievement which) {
try {
Object achievement = Reflection.getMethod(Reflection.getOBCClass("CraftStatistic"), "getNMSAchievement", Achievement.class).invoke(null, which);
return achievementTooltip((String) Reflection.getField(Reflection.getNMSClass("Achievement"), "name").get(achievement));
} catch (IllegalAccessException e) {
Bukkit.getLogger().log(Level.WARNING, "Could not access method.", e);
return this;
} catch (IllegalArgumentException e) {
Bukkit.getLogger().log(Level.WARNING, "Argument could not be passed.", e);
return this;
} catch (InvocationTargetException e) {
Bukkit.getLogger().log(Level.WARNING, "A error has occurred during invoking of method.", e);
return this;
}
}
/**
* Set the behavior of the current editing component to display information about a parameterless statistic when the client hovers over the text.
* <p>Tooltips do not inherit display characteristics, such as color and styles, from the message component on which they are applied.</p>
*
* @param which The statistic to display.
* @return This builder instance.
* @throws IllegalArgumentException If the statistic requires a parameter which was not supplied.
*/
public FancyMessage statisticTooltip(final Statistic which) {
Type type = which.getType();
if (type != Type.UNTYPED) {
throw new IllegalArgumentException("That statistic requires an additional " + type + " parameter!");
}
try {
Object statistic = Reflection.getMethod(Reflection.getOBCClass("CraftStatistic"), "getNMSStatistic", Statistic.class).invoke(null, which);
return achievementTooltip((String) Reflection.getField(Reflection.getNMSClass("Statistic"), "name").get(statistic));
} catch (IllegalAccessException e) {
Bukkit.getLogger().log(Level.WARNING, "Could not access method.", e);
return this;
} catch (IllegalArgumentException e) {
Bukkit.getLogger().log(Level.WARNING, "Argument could not be passed.", e);
return this;
} catch (InvocationTargetException e) {
Bukkit.getLogger().log(Level.WARNING, "A error has occurred during invoking of method.", e);
return this;
}
}
/**
* Set the behavior of the current editing component to display information about a statistic parameter with a material when the client hovers over the text.
* <p>Tooltips do not inherit display characteristics, such as color and styles, from the message component on which they are applied.</p>
*
* @param which The statistic to display.
* @param item The sole material parameter to the statistic.
* @return This builder instance.
* @throws IllegalArgumentException If the statistic requires a parameter which was not supplied, or was supplied a parameter that was not required.
*/
public FancyMessage statisticTooltip(final Statistic which, Material item) {
Type type = which.getType();
if (type == Type.UNTYPED) {
throw new IllegalArgumentException("That statistic needs no additional parameter!");
}
if ((type == Type.BLOCK && item.isBlock()) || type == Type.ENTITY) {
throw new IllegalArgumentException("Wrong parameter type for that statistic - needs " + type + "!");
}
try {
Object statistic = Reflection.getMethod(Reflection.getOBCClass("CraftStatistic"), "getMaterialStatistic", Statistic.class, Material.class).invoke(null, which, item);
return achievementTooltip((String) Reflection.getField(Reflection.getNMSClass("Statistic"), "name").get(statistic));
} catch (IllegalAccessException e) {
Bukkit.getLogger().log(Level.WARNING, "Could not access method.", e);
return this;
} catch (IllegalArgumentException e) {
Bukkit.getLogger().log(Level.WARNING, "Argument could not be passed.", e);
return this;
} catch (InvocationTargetException e) {
Bukkit.getLogger().log(Level.WARNING, "A error has occurred during invoking of method.", e);
return this;
}
}
/**
* Set the behavior of the current editing component to display information about a statistic parameter with an entity type when the client hovers over the text.
* <p>Tooltips do not inherit display characteristics, such as color and styles, from the message component on which they are applied.</p>
*
* @param which The statistic to display.
* @param entity The sole entity type parameter to the statistic.
* @return This builder instance.
* @throws IllegalArgumentException If the statistic requires a parameter which was not supplied, or was supplied a parameter that was not required.
*/
public FancyMessage statisticTooltip(final Statistic which, EntityType entity) {
Type type = which.getType();
if (type == Type.UNTYPED) {
throw new IllegalArgumentException("That statistic needs no additional parameter!");
}
if (type != Type.ENTITY) {
throw new IllegalArgumentException("Wrong parameter type for that statistic - needs " + type + "!");
}
try {
Object statistic = Reflection.getMethod(Reflection.getOBCClass("CraftStatistic"), "getEntityStatistic", Statistic.class, EntityType.class).invoke(null, which, entity);
return achievementTooltip((String) Reflection.getField(Reflection.getNMSClass("Statistic"), "name").get(statistic));
} catch (IllegalAccessException e) {
Bukkit.getLogger().log(Level.WARNING, "Could not access method.", e);
return this;
} catch (IllegalArgumentException e) {
Bukkit.getLogger().log(Level.WARNING, "Argument could not be passed.", e);
return this;
} catch (InvocationTargetException e) {
Bukkit.getLogger().log(Level.WARNING, "A error has occurred during invoking of method.", e);
return this;
}
}
/**
* Set the behavior of the current editing component to display information about an item when the client hovers over the text.
* <p>Tooltips do not inherit display characteristics, such as color and styles, from the message component on which they are applied.</p>
*
* @param itemJSON A string representing the JSON-serialized NBT data tag of an {@link ItemStack}.
* @return This builder instance.
*/
public FancyMessage itemTooltip(final String itemJSON) {
onHover("show_item", new JsonString(itemJSON)); // Seems a bit hacky, considering we have a JSON object as a parameter
return this;
}
/**
* Set the behavior of the current editing component to display information about an item when the client hovers over the text.
* <p>Tooltips do not inherit display characteristics, such as color and styles, from the message component on which they are applied.</p>
*
* @param itemStack The stack for which to display information.
* @return This builder instance.
*/
public FancyMessage itemTooltip(final ItemStack itemStack) {
try {
Object nmsItem = Reflection.getMethod(Reflection.getOBCClass("inventory.CraftItemStack"), "asNMSCopy", ItemStack.class).invoke(null, itemStack);
return itemTooltip(Reflection.getMethod(Reflection.getNMSClass("ItemStack"), "save", Reflection.getNMSClass("NBTTagCompound")).invoke(nmsItem, Reflection.getNMSClass("NBTTagCompound").newInstance()).toString());
} catch (Exception e) {
e.printStackTrace();
return this;
}
}
/**
* Set the behavior of the current editing component to display raw text when the client hovers over the text.
* <p>Tooltips do not inherit display characteristics, such as color and styles, from the message component on which they are applied.</p>
*
* @param text The text, which supports newlines, which will be displayed to the client upon hovering.
* @return This builder instance.
*/
public FancyMessage tooltip(final String text) {
onHover("show_text", new JsonString(text));
return this;
}
/**
* Set the behavior of the current editing component to display raw text when the client hovers over the text.
* <p>Tooltips do not inherit display characteristics, such as color and styles, from the message component on which they are applied.</p>
*
* @param lines The lines of text which will be displayed to the client upon hovering. The iteration order of this object will be the order in which the lines of the tooltip are created.
* @return This builder instance.
*/
public FancyMessage tooltip(final Iterable<String> lines) {
tooltip(com.plotsquared.bukkit.chat.ArrayWrapper.toArray(lines, String.class));
return this;
}
/**
* Set the behavior of the current editing component to display raw text when the client hovers over the text.
* <p>Tooltips do not inherit display characteristics, such as color and styles, from the message component on which they are applied.</p>
*
* @param lines The lines of text which will be displayed to the client upon hovering.
* @return This builder instance.
*/
public FancyMessage tooltip(final String... lines) {
StringBuilder builder = new StringBuilder();
for (int i = 0; i < lines.length; i++) {
builder.append(lines[i]);
if (i != lines.length - 1) {
builder.append('\n');
}
}
tooltip(builder.toString());
return this;
}
/**
* Set the behavior of the current editing component to display formatted text when the client hovers over the text.
* <p>Tooltips do not inherit display characteristics, such as color and styles, from the message component on which they are applied.</p>
*
* @param text The formatted text which will be displayed to the client upon hovering.
* @return This builder instance.
*/
public FancyMessage formattedTooltip(FancyMessage text) {
for (MessagePart component : text.messageParts) {
if (component.clickActionData != null && component.clickActionName != null) {
throw new IllegalArgumentException("The tooltip text cannot have click data.");
} else if (component.hoverActionData != null && component.hoverActionName != null) {
throw new IllegalArgumentException("The tooltip text cannot have a tooltip.");
}
}
onHover("show_text", text);
return this;
}
/**
* Set the behavior of the current editing component to display the specified lines of formatted text when the client hovers over the text.
* <p>Tooltips do not inherit display characteristics, such as color and styles, from the message component on which they are applied.</p>
*
* @param lines The lines of formatted text which will be displayed to the client upon hovering.
* @return This builder instance.
*/
public FancyMessage formattedTooltip(FancyMessage... lines) {
if (lines.length < 1) {
onHover(null, null); // Clear tooltip
return this;
}
FancyMessage result = new FancyMessage();
result.messageParts.clear(); // Remove the one existing text component that exists by default, which destabilizes the object
for (int i = 0; i < lines.length; i++) {
try {
for (MessagePart component : lines[i]) {
if (component.clickActionData != null && component.clickActionName != null) {
throw new IllegalArgumentException("The tooltip text cannot have click data.");
} else if (component.hoverActionData != null && component.hoverActionName != null) {
throw new IllegalArgumentException("The tooltip text cannot have a tooltip.");
}
if (component.hasText()) {
result.messageParts.add(component.clone());
}
}
if (i != lines.length - 1) {
result.messageParts.add(new MessagePart(rawText("\n")));
}
} catch (CloneNotSupportedException e) {
Bukkit.getLogger().log(Level.WARNING, "Failed to clone object", e);
return this;
}
}
return formattedTooltip(result.messageParts.isEmpty() ? null : result); // Throws NPE if size is 0, intended
}
/**
* Set the behavior of the current editing component to display the specified lines of formatted text when the client hovers over the text.
* <p>Tooltips do not inherit display characteristics, such as color and styles, from the message component on which they are applied.</p>
*
* @param lines The lines of text which will be displayed to the client upon hovering. The iteration order of this object will be the order in which the lines of the tooltip are created.
* @return This builder instance.
*/
public FancyMessage formattedTooltip(final Iterable<FancyMessage> lines) {
return formattedTooltip(com.plotsquared.bukkit.chat.ArrayWrapper.toArray(lines, FancyMessage.class));
}
/**
* If the text is a translatable key, and it has replaceable values, this function can be used to set the replacements that will be used in the message.
*
* @param replacements The replacements, in order, that will be used in the language-specific message.
* @return This builder instance.
*/
public FancyMessage translationReplacements(final String... replacements) {
for (String str : replacements) {
latest().translationReplacements.add(new JsonString(str));
}
dirty = true;
return this;
}
/*
/**
* If the text is a translatable key, and it has replaceable values, this function can be used to set the replacements that will be used in the message.
* @param replacements The replacements, in order, that will be used in the language-specific message.
* @return This builder instance.
*/ /* ------------
public FancyMessage translationReplacements(final Iterable<? extends CharSequence> replacements){
for(CharSequence str : replacements){
latest().translationReplacements.add(new JsonString(str));
}
return this;
}
*/
/**
* If the text is a translatable key, and it has replaceable values, this function can be used to set the replacements that will be used in the message.
*
* @param replacements The replacements, in order, that will be used in the language-specific message.
* @return This builder instance.
*/
public FancyMessage translationReplacements(final FancyMessage... replacements) {
for (FancyMessage str : replacements) {
latest().translationReplacements.add(str);
}
dirty = true;
return this;
}
/**
* If the text is a translatable key, and it has replaceable values, this function can be used to set the replacements that will be used in the message.
*
* @param replacements The replacements, in order, that will be used in the language-specific message.
* @return This builder instance.
*/
public FancyMessage translationReplacements(final Iterable<FancyMessage> replacements) {
return translationReplacements(com.plotsquared.bukkit.chat.ArrayWrapper.toArray(replacements, FancyMessage.class));
}
/**
* Terminate construction of the current editing component, and begin construction of a new message component.
* After a successful call to this method, all setter methods will refer to a new message component, created as a result of the call to this method.
*
* @param text The text which will populate the new message component.
* @return This builder instance.
*/
public FancyMessage then(final String text) {
return then(rawText(text));
}
/**
* Terminate construction of the current editing component, and begin construction of a new message component.
* After a successful call to this method, all setter methods will refer to a new message component, created as a result of the call to this method.
*
* @param text The text which will populate the new message component.
* @return This builder instance.
*/
public FancyMessage then(final TextualComponent text) {
if (!latest().hasText()) {
throw new IllegalStateException("previous message part has no text");
}
messageParts.add(new MessagePart(text));
dirty = true;
return this;
}
/**
* Terminate construction of the current editing component, and begin construction of a new message component.
* After a successful call to this method, all setter methods will refer to a new message component, created as a result of the call to this method.
*
* @return This builder instance.
*/
public FancyMessage then() {
if (!latest().hasText()) {
throw new IllegalStateException("previous message part has no text");
}
messageParts.add(new MessagePart());
dirty = true;
return this;
}
@Override
public void writeJson(JsonWriter writer) throws IOException {
if (messageParts.size() == 1) {
latest().writeJson(writer);
} else {
writer.beginObject().name("text").value("").name("extra").beginArray();
for (final MessagePart part : this) {
part.writeJson(writer);
}
writer.endArray().endObject();
}
}
/**
* Serialize this fancy message, converting it into syntactically-valid JSON using a {@link JsonWriter}.
* This JSON should be compatible with vanilla formatter commands such as {@code /tellraw}.
*
* @return The JSON string representing this object.
*/
public String toJSONString() {
if (!dirty && jsonString != null) {
return jsonString;
}
StringWriter string = new StringWriter();
JsonWriter json = new JsonWriter(string);
try {
writeJson(json);
json.close();
} catch (IOException e) {
throw new RuntimeException("invalid message");
}
jsonString = string.toString();
dirty = false;
return jsonString;
}
/**
* Sends this message to a player. The player will receive the fully-fledged formatted display of this message.
*
* @param player The player who will receive the message.
*/
public void send(Player player) {
send(player, toJSONString());
}
private void send(CommandSender sender, String jsonString) {
if (!(sender instanceof Player)) {
sender.sendMessage(toOldMessageFormat());
return;
}
Player player = (Player) sender;
try {
Object handle = Reflection.getHandle(player);
Object connection = Reflection.getField(handle.getClass(), "playerConnection").get(handle);
Reflection.getMethod(connection.getClass(), "sendPacket", Reflection.getNMSClass("Packet")).invoke(connection, createChatPacket(jsonString));
} catch (IllegalArgumentException e) {
Bukkit.getLogger().log(Level.WARNING, "Argument could not be passed.", e);
} catch (IllegalAccessException e) {
Bukkit.getLogger().log(Level.WARNING, "Could not access method.", e);
} catch (InstantiationException e) {
Bukkit.getLogger().log(Level.WARNING, "Underlying class is abstract.", e);
} catch (InvocationTargetException e) {
Bukkit.getLogger().log(Level.WARNING, "A error has occurred during invoking of method.", e);
} catch (NoSuchMethodException e) {
Bukkit.getLogger().log(Level.WARNING, "Could not find method.", e);
} catch (ClassNotFoundException e) {
Bukkit.getLogger().log(Level.WARNING, "Could not find class.", e);
}
}
// The ChatSerializer's instance of Gson
private static Object nmsChatSerializerGsonInstance;
private static Method fromJsonMethod;
private Object createChatPacket(String json) throws IllegalArgumentException, IllegalAccessException, InstantiationException, InvocationTargetException, NoSuchMethodException, ClassNotFoundException {
if (nmsChatSerializerGsonInstance == null) {
// Find the field and its value, completely bypassing obfuscation
Class<?> chatSerializerClazz;
// Get the three parts of the version string (major version is currently unused)
// vX_Y_RZ
// X = major
// Y = minor
// Z = revision
final String version = Reflection.getVersion();
String[] split = version.substring(1, version.length() - 1).split("_"); // Remove trailing dot
//int majorVersion = Integer.parseInt(split[0]);
int minorVersion = Integer.parseInt(split[1]);
int revisionVersion = Integer.parseInt(split[2].substring(1)); // Substring to ignore R
if (minorVersion < 8 || (minorVersion == 8 && revisionVersion == 1)) {
chatSerializerClazz = Reflection.getNMSClass("ChatSerializer");
} else {
chatSerializerClazz = Reflection.getNMSClass("IChatBaseComponent$ChatSerializer");
}
if (chatSerializerClazz == null) {
throw new ClassNotFoundException("Can't find the ChatSerializer class");
}
for (Field declaredField : chatSerializerClazz.getDeclaredFields()) {
if (Modifier.isFinal(declaredField.getModifiers()) && Modifier.isStatic(declaredField.getModifiers()) && declaredField.getType().getName().endsWith("Gson")) {
// We've found our field
declaredField.setAccessible(true);
nmsChatSerializerGsonInstance = declaredField.get(null);
fromJsonMethod = nmsChatSerializerGsonInstance.getClass().getMethod("fromJson", String.class, Class.class);
break;
}
}
}
// Since the method is so simple, and all the obfuscated methods have the same name, it's easier to reimplement 'IChatBaseComponent a(String)' than to reflectively call it
// Of course, the implementation may change, but fuzzy matches might break with signature changes
Object serializedChatComponent = fromJsonMethod.invoke(nmsChatSerializerGsonInstance, json, Reflection.getNMSClass("IChatBaseComponent"));
return nmsPacketPlayOutChatConstructor.newInstance(serializedChatComponent);
}
/**
* Sends this message to a command sender.
* If the sender is a player, they will receive the fully-fledged formatted display of this message.
* Otherwise, they will receive a version of this message with less formatting.
*
* @param sender The command sender who will receive the message.
* @see #toOldMessageFormat()
*/
public void send(CommandSender sender) {
send(sender, toJSONString());
}
/**
* Sends this message to multiple command senders.
*
* @param senders The command senders who will receive the message.
* @see #send(CommandSender)
*/
public void send(final Iterable<? extends CommandSender> senders) {
String string = toJSONString();
for (final CommandSender sender : senders) {
send(sender, string);
}
}
/**
* Convert this message to a human-readable string with limited formatting.
* This method is used to send this message to clients without JSON formatting support.
* <p>
* Serialization of this message by using this message will include (in this order for each message part):
* <ol>
* <li>The color of each message part.</li>
* <li>The applicable stylizations for each message part.</li>
* <li>The core text of the message part.</li>
* </ol>
* The primary omissions are tooltips and clickable actions. Consequently, this method should be used only as a last resort.
* </p>
* <p>
* Color and formatting can be removed from the returned string by using {@link ChatColor#stripColor(String)}.</p>
*
* @return A human-readable string representing limited formatting in addition to the core text of this message.
*/
public String toOldMessageFormat() {
StringBuilder result = new StringBuilder();
for (MessagePart part : this) {
result.append(part.color == null ? "" : part.color);
for (ChatColor formatSpecifier : part.styles) {
result.append(formatSpecifier);
}
result.append(part.text);
}
return result.toString();
}
private MessagePart latest() {
return messageParts.get(messageParts.size() - 1);
}
private void onClick(final String name, final String data) {
final MessagePart latest = latest();
latest.clickActionName = name;
latest.clickActionData = data;
dirty = true;
}
private void onHover(final String name, final JsonRepresentedObject data) {
final MessagePart latest = latest();
latest.hoverActionName = name;
latest.hoverActionData = data;
dirty = true;
}
// Doc copied from interface
public Map<String, Object> serialize() {
HashMap<String, Object> map = new HashMap<>();
map.put("messageParts", messageParts);
// map.put("JSON", toJSONString());
return map;
}
/**
* Deserializes a JSON-represented message from a mapping of key-value pairs.
* This is called by the Bukkit serialization API.
* It is not intended for direct public API consumption.
*
* @param serialized The key-value mapping which represents a fancy message.
*/
@SuppressWarnings("unchecked")
public static FancyMessage deserialize(Map<String, Object> serialized) {
FancyMessage msg = new FancyMessage();
msg.messageParts = (List<MessagePart>) serialized.get("messageParts");
msg.jsonString = serialized.containsKey("JSON") ? serialized.get("JSON").toString() : null;
msg.dirty = !serialized.containsKey("JSON");
return msg;
}
/**
* <b>Internally called method. Not for API consumption.</b>
*/
public Iterator<MessagePart> iterator() {
return messageParts.iterator();
}
private static JsonParser _stringParser = new JsonParser();
/**
* Deserializes a fancy message from its JSON representation. This JSON representation is of the format of
* that returned by {@link #toJSONString()}, and is compatible with vanilla inputs.
*
* @param json The JSON string which represents a fancy message.
* @return A {@code FancyMessage} representing the parameterized JSON message.
*/
public static FancyMessage deserialize(String json) {
JsonObject serialized = _stringParser.parse(json).getAsJsonObject();
JsonArray extra = serialized.getAsJsonArray("extra"); // Get the extra component
FancyMessage returnVal = new FancyMessage();
returnVal.messageParts.clear();
for (JsonElement mPrt : extra) {
MessagePart component = new MessagePart();
JsonObject messagePart = mPrt.getAsJsonObject();
for (Map.Entry<String, JsonElement> entry : messagePart.entrySet()) {
// Deserialize text
if (TextualComponent.isTextKey(entry.getKey())) {
// The map mimics the YAML serialization, which has a "key" field and one or more "value" fields
Map<String, Object> serializedMapForm = new HashMap<>(); // Must be object due to Bukkit serializer API compliance
serializedMapForm.put("key", entry.getKey());
if (entry.getValue().isJsonPrimitive()) {
// Assume string
serializedMapForm.put("value", entry.getValue().getAsString());
} else {
// Composite object, but we assume each element is a string
for (Map.Entry<String, JsonElement> compositeNestedElement : entry.getValue().getAsJsonObject().entrySet()) {
serializedMapForm.put("value." + compositeNestedElement.getKey(), compositeNestedElement.getValue().getAsString());
}
}
component.text = TextualComponent.deserialize(serializedMapForm);
} else if (MessagePart.stylesToNames.inverse().containsKey(entry.getKey())) {
if (entry.getValue().getAsBoolean()) {
component.styles.add(MessagePart.stylesToNames.inverse().get(entry.getKey()));
}
} else if (entry.getKey().equals("color")) {
component.color = ChatColor.valueOf(entry.getValue().getAsString().toUpperCase());
} else if (entry.getKey().equals("clickEvent")) {
JsonObject object = entry.getValue().getAsJsonObject();
component.clickActionName = object.get("action").getAsString();
component.clickActionData = object.get("value").getAsString();
} else if (entry.getKey().equals("hoverEvent")) {
JsonObject object = entry.getValue().getAsJsonObject();
component.hoverActionName = object.get("action").getAsString();
if (object.get("value").isJsonPrimitive()) {
// Assume string
component.hoverActionData = new JsonString(object.get("value").getAsString());
} else {
// Assume composite type
// The only composite type we currently store is another FancyMessage
// Therefore, recursion time!
component.hoverActionData = deserialize(object.get("value").toString() /* This should properly serialize the JSON object as a JSON string */);
}
} else if (entry.getKey().equals("insertion")) {
component.insertionData = entry.getValue().getAsString();
} else if (entry.getKey().equals("with")) {
for (JsonElement object : entry.getValue().getAsJsonArray()) {
if (object.isJsonPrimitive()) {
component.translationReplacements.add(new JsonString(object.getAsString()));
} else {
// Only composite type stored in this array is - again - FancyMessages
// Recurse within this function to parse this as a translation replacement
component.translationReplacements.add(deserialize(object.toString()));
}
}
}
}
returnVal.messageParts.add(component);
}
return returnVal;
}
}

View File

@ -1,19 +0,0 @@
package com.plotsquared.bukkit.chat;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
/**
* Represents an object that can be serialized to a JSON writer instance.
*/
interface JsonRepresentedObject {
/**
* Writes the JSON representation of this object to the specified writer.
* @param writer The JSON writer which will receive the object.
* @throws IOException If an error occurs writing to the stream.
*/
public void writeJson(JsonWriter writer) throws IOException;
}

View File

@ -1,47 +0,0 @@
package com.plotsquared.bukkit.chat;
import com.google.gson.stream.JsonWriter;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
/**
* Represents a JSON string value.
* Writes by this object will not write name values nor begin/end objects in the JSON stream.
* All writes merely write the represented string value.
*/
final class JsonString implements JsonRepresentedObject, ConfigurationSerializable {
private String _value;
public JsonString(CharSequence value) {
_value = value == null ? null : value.toString();
}
@Override
public void writeJson(JsonWriter writer) throws IOException {
writer.value(getValue());
}
public String getValue() {
return _value;
}
public Map<String, Object> serialize() {
HashMap<String, Object> theSingleValue = new HashMap<String, Object>();
theSingleValue.put("stringValue", _value);
return theSingleValue;
}
public static JsonString deserialize(Map<String, Object> map) {
return new JsonString(map.get("stringValue").toString());
}
@Override
public String toString() {
return _value;
}
}

View File

@ -1,157 +0,0 @@
package com.plotsquared.bukkit.chat;
import com.google.common.collect.BiMap;
import com.google.common.collect.ImmutableBiMap;
import com.google.gson.stream.JsonWriter;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.configuration.serialization.ConfigurationSerialization;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
/**
* Internal class: Represents a component of a JSON-serializable {@link FancyMessage}.
*/
final class MessagePart implements JsonRepresentedObject, ConfigurationSerializable, Cloneable {
ChatColor color = ChatColor.WHITE;
ArrayList<ChatColor> styles = new ArrayList<>();
String clickActionName = null;
String clickActionData = null;
String hoverActionName = null;
JsonRepresentedObject hoverActionData = null;
TextualComponent text = null;
String insertionData = null;
ArrayList<JsonRepresentedObject> translationReplacements = new ArrayList<>();
MessagePart(final TextualComponent text) {
this.text = text;
}
MessagePart() {
this.text = null;
}
boolean hasText() {
return text != null;
}
@Override
@SuppressWarnings("unchecked")
public MessagePart clone() throws CloneNotSupportedException {
MessagePart obj = (MessagePart) super.clone();
obj.styles = (ArrayList<ChatColor>) styles.clone();
if (hoverActionData instanceof JsonString) {
obj.hoverActionData = new JsonString(((JsonString) hoverActionData).getValue());
} else if (hoverActionData instanceof FancyMessage) {
obj.hoverActionData = ((FancyMessage) hoverActionData).clone();
}
obj.translationReplacements = (ArrayList<JsonRepresentedObject>) translationReplacements.clone();
return obj;
}
static final BiMap<ChatColor, String> stylesToNames;
static {
ImmutableBiMap.Builder<ChatColor, String> builder = ImmutableBiMap.builder();
for (final ChatColor style : ChatColor.values()) {
if (!style.isFormat()) {
continue;
}
String styleName;
switch (style) {
case MAGIC:
styleName = "obfuscated";
break;
case UNDERLINE:
styleName = "underlined";
break;
default:
styleName = style.name().toLowerCase();
break;
}
builder.put(style, styleName);
}
stylesToNames = builder.build();
}
public void writeJson(JsonWriter json) {
try {
json.beginObject();
text.writeJson(json);
json.name("color").value(color.name().toLowerCase());
for (final ChatColor style : styles) {
json.name(stylesToNames.get(style)).value(true);
}
if (clickActionName != null && clickActionData != null) {
json.name("clickEvent")
.beginObject()
.name("action").value(clickActionName)
.name("value").value(clickActionData)
.endObject();
}
if (hoverActionName != null && hoverActionData != null) {
json.name("hoverEvent")
.beginObject()
.name("action").value(hoverActionName)
.name("value");
hoverActionData.writeJson(json);
json.endObject();
}
if (insertionData != null) {
json.name("insertion").value(insertionData);
}
if (translationReplacements.size() > 0 && text != null && TextualComponent.isTranslatableText(text)) {
json.name("with").beginArray();
for (JsonRepresentedObject obj : translationReplacements) {
obj.writeJson(json);
}
json.endArray();
}
json.endObject();
} catch (IOException e) {
Bukkit.getLogger().log(Level.WARNING, "A problem occured during writing of JSON string", e);
}
}
public Map<String, Object> serialize() {
HashMap<String, Object> map = new HashMap<>();
map.put("text", text);
map.put("styles", styles);
map.put("color", color.getChar());
map.put("hoverActionName", hoverActionName);
map.put("hoverActionData", hoverActionData);
map.put("clickActionName", clickActionName);
map.put("clickActionData", clickActionData);
map.put("insertion", insertionData);
map.put("translationReplacements", translationReplacements);
return map;
}
@SuppressWarnings("unchecked")
public static MessagePart deserialize(Map<String, Object> serialized) {
MessagePart part = new MessagePart((TextualComponent) serialized.get("text"));
part.styles = (ArrayList<ChatColor>) serialized.get("styles");
part.color = ChatColor.getByChar(serialized.get("color").toString());
part.hoverActionName = (String) serialized.get("hoverActionName");
part.hoverActionData = (JsonRepresentedObject) serialized.get("hoverActionData");
part.clickActionName = (String) serialized.get("clickActionName");
part.clickActionData = (String) serialized.get("clickActionData");
part.insertionData = (String) serialized.get("insertion");
part.translationReplacements = (ArrayList<JsonRepresentedObject>) serialized.get("translationReplacements");
return part;
}
static {
ConfigurationSerialization.registerClass(MessagePart.class);
}
}

View File

@ -1,206 +0,0 @@
package com.plotsquared.bukkit.chat;
import org.bukkit.Bukkit;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* A class containing static utility methods and caches which are intended as reflective conveniences.
* Unless otherwise noted, upon failure methods will return {@code null}.
*/
public final class Reflection {
/**
* Stores loaded classes from the {@code net.minecraft.server} package.
*/
private static final Map<String, Class<?>> _loadedNMSClasses = new HashMap<>();
/**
* Stores loaded classes from the {@code org.bukkit.craftbukkit} package (and subpackages).
*/
private static final Map<String, Class<?>> _loadedOBCClasses = new HashMap<>();
private static final Map<Class<?>, Map<String, Field>> _loadedFields = new HashMap<>();
/**
* Contains loaded methods in a cache.
* The map maps [types to maps of [method names to maps of [parameter types to method instances]]].
*/
private static final Map<Class<?>, Map<String, Map<ArrayWrapper<Class<?>>, Method>>> _loadedMethods = new HashMap<>();
private static String _versionString;
private Reflection() { }
/**
* Gets the version string from the package name of the CraftBukkit server implementation.
* This is needed to bypass the JAR package name changing on each update.
*
* @return The version string of the OBC and NMS packages, <em>including the trailing dot</em>.
*/
public synchronized static String getVersion() {
if (_versionString == null) {
if (Bukkit.getServer() == null) {
// The server hasn't started, static initializer call?
return null;
}
String name = Bukkit.getServer().getClass().getPackage().getName();
_versionString = name.substring(name.lastIndexOf('.') + 1) + ".";
}
return _versionString;
}
/**
* Gets a {@link Class} object representing a type contained within the {@code net.minecraft.server} versioned package.
* The class instances returned by this method are cached, such that no lookup will be done twice (unless multiple threads are accessing this method simultaneously).
*
* @param className The name of the class, excluding the package, within NMS.
* @return The class instance representing the specified NMS class, or {@code null} if it could not be loaded.
*/
public synchronized static Class<?> getNMSClass(String className) {
if (_loadedNMSClasses.containsKey(className)) {
return _loadedNMSClasses.get(className);
}
String fullName = "net.minecraft.server." + getVersion() + className;
Class<?> clazz;
try {
clazz = Class.forName(fullName);
} catch (ClassNotFoundException e) {
_loadedNMSClasses.put(className, null);
throw new RuntimeException(e);
}
_loadedNMSClasses.put(className, clazz);
return clazz;
}
/**
* Gets a {@link Class} object representing a type contained within the {@code org.bukkit.craftbukkit} versioned package.
* The class instances returned by this method are cached, such that no lookup will be done twice (unless multiple threads are accessing this method simultaneously).
*
* @param className The name of the class, excluding the package, within OBC. This name may contain a subpackage name, such as {@code inventory.CraftItemStack}.
* @return The class instance representing the specified OBC class, or {@code null} if it could not be loaded.
*/
public synchronized static Class<?> getOBCClass(String className) {
if (_loadedOBCClasses.containsKey(className)) {
return _loadedOBCClasses.get(className);
}
String fullName = "org.bukkit.craftbukkit." + getVersion() + className;
Class<?> clazz;
try {
clazz = Class.forName(fullName);
} catch (ClassNotFoundException e) {
_loadedOBCClasses.put(className, null);
throw new RuntimeException(e);
}
_loadedOBCClasses.put(className, clazz);
return clazz;
}
/**
* Attempts to get the NMS handle of a CraftBukkit object.
* <p>
* The only match currently attempted by this method is a retrieval by using a parameterless {@code getHandle()} method implemented by the runtime type of the specified object.
* </p>
*
* @param obj The object for which to retrieve an NMS handle.
* @return The NMS handle of the specified object, or {@code null} if it could not be retrieved using {@code getHandle()}.
*/
public synchronized static Object getHandle(Object obj) throws InvocationTargetException, IllegalAccessException, IllegalArgumentException {
return getMethod(obj.getClass(), "getHandle").invoke(obj);
}
/**
* Retrieves a {@link Field} instance declared by the specified class with the specified name.
* Java access modifiers are ignored during this retrieval. No guarantee is made as to whether the field
* returned will be an instance or static field.
* <p>
* A global caching mechanism within this class is used to store fields. Combined with synchronization, this guarantees that
* no field will be reflectively looked up twice.
* </p>
* <p>
* If a field is deemed suitable for return, {@link Field#setAccessible(boolean) setAccessible} will be invoked with an argument of {@code true} before it is returned.
* This ensures that callers do not have to check or worry about Java access modifiers when dealing with the returned instance.
* </p>
*
* @param clazz The class which contains the field to retrieve.
* @param name The declared name of the field in the class.
* @return A field object with the specified name declared by the specified class.
* @see Class#getDeclaredField(String)
*/
public synchronized static Field getField(Class<?> clazz, String name) {
Map<String, Field> loaded;
if (!_loadedFields.containsKey(clazz)) {
loaded = new HashMap<>();
_loadedFields.put(clazz, loaded);
} else {
loaded = _loadedFields.get(clazz);
}
if (loaded.containsKey(name)) {
// If the field is loaded (or cached as not existing), return the relevant value, which might be null
return loaded.get(name);
}
try {
Field field = clazz.getDeclaredField(name);
field.setAccessible(true);
loaded.put(name, field);
return field;
} catch (NoSuchFieldException | SecurityException e) {
// Error loading
e.printStackTrace();
// Cache field as not existing
loaded.put(name, null);
return null;
}
}
/**
* Retrieves a {@link Method} instance declared by the specified class with the specified name and argument types.
* Java access modifiers are ignored during this retrieval. No guarantee is made as to whether the field
* returned will be an instance or static field.
* <p>
* A global caching mechanism within this class is used to store method. Combined with synchronization, this guarantees that
* no method will be reflectively looked up twice.
* <p>
* If a method is deemed suitable for return, {@link Method#setAccessible(boolean) setAccessible} will be invoked with an argument of {@code true} before it is returned.
* This ensures that callers do not have to check or worry about Java access modifiers when dealing with the returned instance.
* <p>
* This method does <em>not</em> search superclasses of the specified type for methods with the specified signature.
* Callers wishing this behavior should use {@link Class#getDeclaredMethod(String, Class...)}.
*
* @param clazz The class which contains the method to retrieve.
* @param name The declared name of the method in the class.
* @param args The formal argument types of the method.
* @return A method object with the specified name declared by the specified class.
*/
public synchronized static Method getMethod(Class<?> clazz, String name, Class<?>... args) {
if (!_loadedMethods.containsKey(clazz)) {
_loadedMethods.put(clazz, new HashMap<String, Map<ArrayWrapper<Class<?>>, Method>>());
}
Map<String, Map<ArrayWrapper<Class<?>>, Method>> loadedMethodNames = _loadedMethods.get(clazz);
if (!loadedMethodNames.containsKey(name)) {
loadedMethodNames.put(name, new HashMap<ArrayWrapper<Class<?>>, Method>());
}
Map<ArrayWrapper<Class<?>>, Method> loadedSignatures = loadedMethodNames.get(name);
ArrayWrapper<Class<?>> wrappedArg = new ArrayWrapper<>(args);
if (loadedSignatures.containsKey(wrappedArg)) {
return loadedSignatures.get(wrappedArg);
}
for (Method m : clazz.getMethods()) {
if (m.getName().equals(name) && Arrays.equals(args, m.getParameterTypes())) {
m.setAccessible(true);
loadedSignatures.put(wrappedArg, m);
return m;
}
}
loadedSignatures.put(wrappedArg, null);
return null;
}
}

View File

@ -1,317 +0,0 @@
package com.plotsquared.bukkit.chat;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import com.google.gson.stream.JsonWriter;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.configuration.serialization.ConfigurationSerialization;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
/**
* Represents a textual component of a message part.
* This can be used to not only represent string literals in a JSON message,
* but also to represent localized strings and other text values.
* <p>Different instances of this class can be created with static constructor methods.</p>
*/
public abstract class TextualComponent implements Cloneable {
static {
ConfigurationSerialization.registerClass(TextualComponent.ArbitraryTextTypeComponent.class);
ConfigurationSerialization.registerClass(TextualComponent.ComplexTextTypeComponent.class);
}
static TextualComponent deserialize(Map<String, Object> map) {
if (map.containsKey("key") && map.size() == 2 && map.containsKey("value")) {
// Arbitrary text component
return ArbitraryTextTypeComponent.deserialize(map);
} else if (map.size() >= 2 && map.containsKey("key") && !map.containsKey("value") /* It contains keys that START WITH value */) {
// Complex JSON object
return ComplexTextTypeComponent.deserialize(map);
}
return null;
}
static boolean isTextKey(String key) {
return key.equals("translate") || key.equals("text") || key.equals("score") || key.equals("selector");
}
static boolean isTranslatableText(TextualComponent component) {
return component instanceof ComplexTextTypeComponent && component.getKey().equals("translate");
}
/**
* Create a textual component representing a string literal.
*
* <p>This is the default type of textual component when a single string
* literal is given to a method.
*
* @param textValue The text which will be represented.
* @return The text component representing the specified literal text.
*/
public static TextualComponent rawText(String textValue) {
return new ArbitraryTextTypeComponent("text", textValue);
}
/**
* Create a textual component representing a localized string.
* The client will see this text component as their localized version of the specified string <em>key</em>, which can be overridden by a
* resource pack.
* <p>
* If the specified translation key is not present on the client resource pack, the translation key will be displayed as a string literal to
* the client.
* </p>
*
* @param translateKey The string key which maps to localized text.
* @return The text component representing the specified localized text.
*/
public static TextualComponent localizedText(String translateKey) {
return new ArbitraryTextTypeComponent("translate", translateKey);
}
private static void throwUnsupportedSnapshot() {
throw new UnsupportedOperationException("This feature is only supported in snapshot releases.");
}
/**
* Create a textual component representing a scoreboard value.
* The client will see their own score for the specified objective as the text represented by this component.
* <p>
* <b>This method is currently guaranteed to throw an {@code UnsupportedOperationException} as it is only supported on snapshot clients.</b>
* </p>
*
* @param scoreboardObjective The name of the objective for which to display the score.
* @return The text component representing the specified scoreboard score (for the viewing player), or {@code null} if an error occurs during
* JSON serialization.
*/
public static TextualComponent objectiveScore(String scoreboardObjective) {
return objectiveScore("*", scoreboardObjective);
}
/**
* Create a textual component representing a scoreboard value.
* The client will see the score of the specified player for the specified objective as the text represented by this component.
*
* <p><b>This method is currently guaranteed to throw an {@code UnsupportedOperationException}
* as it is only supported on snapshot clients.</b>
*
* @param playerName The name of the player whos score will be shown. If
* this string represents the single-character sequence
* "*", the viewing player's score will be displayed.
* Standard minecraft selectors (@a, @p, etc)
* are <em>not</em> supported.
* @param scoreboardObjective The name of the objective for
* which to display the score.
* @return The text component representing the specified scoreboard score
* for the specified player, or {@code null} if an error occurs during JSON serialization.
*/
public static TextualComponent objectiveScore(String playerName, String scoreboardObjective) {
throwUnsupportedSnapshot(); // Remove this line when the feature is released to non-snapshot versions, in addition to updating ALL THE
// OVERLOADS documentation accordingly
return new ComplexTextTypeComponent("score", ImmutableMap.<String, String>builder()
.put("name", playerName)
.put("objective", scoreboardObjective)
.build());
}
/**
* Create a textual component representing a player name, retrievable by using a standard minecraft selector.
* The client will see the players or entities captured by the specified selector as the text represented by this component.
* <p>
* <b>This method is currently guaranteed to throw an {@code UnsupportedOperationException} as it is only supported on snapshot clients.</b>
* </p>
*
* @param selector The minecraft player or entity selector which will capture the entities whose string representations will be displayed in
* the place of this text component.
* @return The text component representing the name of the entities captured by the selector.
*/
public static TextualComponent selector(String selector) {
throwUnsupportedSnapshot(); // Remove this line when the feature is released to non-snapshot versions, in addition to updating ALL THE
// OVERLOADS documentation accordingly
return new ArbitraryTextTypeComponent("selector", selector);
}
@Override
public String toString() {
return getReadableString();
}
/**
* @return The JSON key used to represent text components of this type.
*/
public abstract String getKey();
/**
* @return A readable String
*/
public abstract String getReadableString();
/**
* Clones a textual component instance.
* The returned object should not reference this textual component instance, but should maintain the same key and value.
*/
@Override
public abstract TextualComponent clone() throws CloneNotSupportedException;
/**
* Writes the text data represented by this textual component to the specified JSON writer object.
* A new object within the writer is not started.
*
* @param writer The object to which to write the JSON data.
* @throws IOException If an error occurs while writing to the stream.
*/
public abstract void writeJson(JsonWriter writer) throws IOException;
/**
* Internal class used to represent all types of text components.
* Exception validating done is on keys and values.
*/
private static final class ArbitraryTextTypeComponent extends TextualComponent implements ConfigurationSerializable {
private String key;
private String value;
public ArbitraryTextTypeComponent(String key, String value) {
setKey(key);
setValue(value);
}
public static ArbitraryTextTypeComponent deserialize(Map<String, Object> map) {
return new ArbitraryTextTypeComponent(map.get("key").toString(), map.get("value").toString());
}
@Override
public String getKey() {
return key;
}
public void setKey(String key) {
Preconditions.checkArgument(key != null && !key.isEmpty(), "The key must be specified.");
this.key = key;
}
public String getValue() {
return value;
}
public void setValue(String value) {
Preconditions.checkArgument(value != null, "The value must be specified.");
this.value = value;
}
@Override
public TextualComponent clone() throws CloneNotSupportedException {
// Since this is a private and final class, we can just reinstantiate this class instead of casting super.clone
return new ArbitraryTextTypeComponent(getKey(), getValue());
}
@Override
public void writeJson(JsonWriter writer) throws IOException {
writer.name(getKey()).value(getValue());
}
@Override
@SuppressWarnings("serial")
public Map<String, Object> serialize() {
return new HashMap<String, Object>() {
{
put("key", getKey());
put("value", getValue());
}
};
}
@Override
public String getReadableString() {
return getValue();
}
}
/**
* Internal class used to represent a text component with a nested JSON
* value.
*
* <p>Exception validating done is on keys and values.
*/
private static final class ComplexTextTypeComponent extends TextualComponent implements ConfigurationSerializable {
private String key;
private Map<String, String> value;
public ComplexTextTypeComponent(String key, Map<String, String> values) {
setKey(key);
setValue(values);
}
public static ComplexTextTypeComponent deserialize(Map<String, Object> map) {
String key = null;
Map<String, String> value = new HashMap<>();
for (Map.Entry<String, Object> valEntry : map.entrySet()) {
if (valEntry.getKey().equals("key")) {
key = (String) valEntry.getValue();
} else if (valEntry.getKey().startsWith("value.")) {
value.put(valEntry.getKey().substring(6) /* Strips out the value prefix */, valEntry.getValue().toString());
}
}
return new ComplexTextTypeComponent(key, value);
}
@Override
public String getKey() {
return key;
}
public void setKey(String key) {
Preconditions.checkArgument(key != null && !key.isEmpty(), "The key must be specified.");
this.key = key;
}
public Map<String, String> getValue() {
return value;
}
public void setValue(Map<String, String> value) {
Preconditions.checkArgument(value != null, "The value must be specified.");
this.value = value;
}
@Override
public TextualComponent clone() {
// Since this is a private and final class, we can just reinstantiate this class instead of casting super.clone
return new ComplexTextTypeComponent(getKey(), getValue());
}
@Override
public void writeJson(JsonWriter writer) throws IOException {
writer.name(getKey());
writer.beginObject();
for (Map.Entry<String, String> jsonPair : value.entrySet()) {
writer.name(jsonPair.getKey()).value(jsonPair.getValue());
}
writer.endObject();
}
@Override
@SuppressWarnings("serial")
public Map<String, Object> serialize() {
return new java.util.HashMap<String, Object>() {
{
put("key", getKey());
for (Map.Entry<String, String> valEntry : getValue().entrySet()) {
put("value." + valEntry.getKey(), valEntry.getValue());
}
}
};
}
@Override
public String getReadableString() {
return getKey();
}
}
}

View File

@ -1,299 +0,0 @@
package com.plotsquared.bukkit.commands;
import com.google.common.collect.Sets;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.commands.CommandCategory;
import com.intellectualcrafters.plot.commands.RequiredType;
import com.intellectualcrafters.plot.commands.SubCommand;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.database.DBFunc;
import com.intellectualcrafters.plot.object.OfflinePlotPlayer;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.StringWrapper;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.StringMan;
import com.intellectualcrafters.plot.util.TaskManager;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.intellectualcrafters.plot.util.WorldUtil;
import com.intellectualcrafters.plot.uuid.UUIDWrapper;
import com.plotsquared.bukkit.uuid.DatFileFilter;
import com.plotsquared.bukkit.uuid.DefaultUUIDWrapper;
import com.plotsquared.bukkit.uuid.LowerOfflineUUIDWrapper;
import com.plotsquared.bukkit.uuid.OfflineUUIDWrapper;
import com.plotsquared.general.commands.Argument;
import com.plotsquared.general.commands.CommandDeclaration;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map.Entry;
import java.util.UUID;
@CommandDeclaration(
command = "uuidconvert",
permission = "plots.admin",
description = "Debug UUID conversion",
usage = "/plot uuidconvert <lower|offline|online>",
requiredType = RequiredType.CONSOLE,
category = CommandCategory.DEBUG)
public class DebugUUID extends SubCommand {
public DebugUUID() {
super(Argument.String);
}
@Override
public boolean onCommand(final PlotPlayer player, String[] args) {
final UUIDWrapper currentUUIDWrapper = UUIDHandler.getUUIDWrapper();
final UUIDWrapper newWrapper;
switch (args[0].toLowerCase()) {
case "lower":
newWrapper = new LowerOfflineUUIDWrapper();
break;
case "offline":
newWrapper = new OfflineUUIDWrapper();
break;
case "online":
newWrapper = new DefaultUUIDWrapper();
break;
default:
try {
Class<?> clazz = Class.forName(args[0]);
newWrapper = (UUIDWrapper) clazz.newInstance();
} catch (ClassNotFoundException | IllegalAccessException | InstantiationException ignored) {
MainUtil.sendMessage(player, C.COMMAND_SYNTAX, "/plot uuidconvert <lower|offline|online>");
return false;
}
}
if (args.length != 2 || !"-o".equals(args[1])) {
MainUtil.sendMessage(player, C.COMMAND_SYNTAX, "/plot uuidconvert " + args[0] + " - o");
MainUtil.sendMessage(player, "&cBe aware of the following!");
MainUtil.sendMessage(player, "&8 - &cUse the database command or another method to backup your plots beforehand");
MainUtil.sendMessage(player, "&8 - &cIf the process is interrupted, all plots could be deleted");
MainUtil.sendMessage(player, "&8 - &cIf an error occurs, all plots could be deleted");
MainUtil.sendMessage(player, "&8 - &cPlot settings WILL be lost upon conversion");
MainUtil.sendMessage(player, "&cTO REITERATE: BACK UP YOUR DATABASE BEFORE USING THIS!!!");
MainUtil.sendMessage(player, "&7Retype the command with the override parameter when ready :)");
return false;
}
if (currentUUIDWrapper.getClass().getCanonicalName().equals(newWrapper.getClass().getCanonicalName())) {
MainUtil.sendMessage(player, "&cUUID mode already in use!");
return false;
}
MainUtil.sendMessage(player, "&6Beginning UUID mode conversion");
MainUtil.sendMessage(player, "&7 - Disconnecting players");
for (Entry<String, PlotPlayer> entry : UUIDHandler.getPlayers().entrySet()) {
entry.getValue().kick("UUID conversion has been initiated. You may reconnect when finished.");
}
MainUtil.sendMessage(player, "&7 - Initializing map");
final HashMap<UUID, UUID> uCMap = new HashMap<>();
final HashMap<UUID, UUID> uCReverse = new HashMap<>();
MainUtil.sendMessage(player, "&7 - Collecting playerdata");
HashSet<String> worlds = Sets.newHashSet(WorldUtil.IMP.getMainWorld(), "world");
HashSet<UUID> uuids = new HashSet<>();
HashSet<String> names = new HashSet<>();
for (String worldName : worlds) {
File playerDataFolder = new File(worldName + File.separator + "playerdata");
String[] dat = playerDataFolder.list(new DatFileFilter());
if (dat != null) {
for (String current : dat) {
String s = current.replaceAll(".dat$", "");
try {
UUID uuid = UUID.fromString(s);
uuids.add(uuid);
} catch (Exception ignored) {
MainUtil.sendMessage(player, C.PREFIX + "Invalid playerdata: " + current);
}
}
}
File playersFolder = new File(worldName + File.separator + "players");
dat = playersFolder.list(new DatFileFilter());
if (dat != null) {
for (String current : dat) {
names.add(current.replaceAll(".dat$", ""));
}
}
}
MainUtil.sendMessage(player, "&7 - Populating map");
UUID uuid2;
UUIDWrapper wrapper = new DefaultUUIDWrapper();
for (UUID uuid : uuids) {
try {
OfflinePlotPlayer op = wrapper.getOfflinePlayer(uuid);
uuid = currentUUIDWrapper.getUUID(op);
uuid2 = newWrapper.getUUID(op);
if (!uuid.equals(uuid2) && !uCMap.containsKey(uuid) && !uCReverse.containsKey(uuid2)) {
uCMap.put(uuid, uuid2);
uCReverse.put(uuid2, uuid);
}
} catch (Throwable ignored) {
MainUtil.sendMessage(player, C.PREFIX + "&6Invalid playerdata: " + uuid.toString() + ".dat");
}
}
for (String name : names) {
UUID uuid = currentUUIDWrapper.getUUID(name);
uuid2 = newWrapper.getUUID(name);
if (!uuid.equals(uuid2)) {
uCMap.put(uuid, uuid2);
uCReverse.put(uuid2, uuid);
}
}
if (uCMap.isEmpty()) {
MainUtil.sendMessage(player, "&c - Error! Attempting to repopulate");
for (OfflinePlotPlayer op : currentUUIDWrapper.getOfflinePlayers()) {
if (op.getLastPlayed() != 0) {
// String name = op.getPluginName();
// StringWrapper wrap = new StringWrapper(name);
UUID uuid = currentUUIDWrapper.getUUID(op);
uuid2 = newWrapper.getUUID(op);
if (!uuid.equals(uuid2)) {
uCMap.put(uuid, uuid2);
uCReverse.put(uuid2, uuid);
}
}
}
if (uCMap.isEmpty()) {
MainUtil.sendMessage(player, "&cError. Failed to collect UUIDs!");
return false;
} else {
MainUtil.sendMessage(player, "&a - Successfully repopulated");
}
}
MainUtil.sendMessage(player, "&7 - Replacing cache");
TaskManager.runTaskAsync(new Runnable() {
@Override
public void run() {
for (Entry<UUID, UUID> entry : uCMap.entrySet()) {
String name = UUIDHandler.getName(entry.getKey());
if (name != null) {
UUIDHandler.add(new StringWrapper(name), entry.getValue());
}
}
MainUtil.sendMessage(player, "&7 - Scanning for applicable files (uuids.txt)");
File file = new File(PS.get().IMP.getDirectory(), "uuids.txt");
if (file.exists()) {
try {
List<String> lines = Files.readAllLines(file.toPath(), StandardCharsets.UTF_8);
for (String line : lines) {
try {
line = line.trim();
if (line.isEmpty()) {
continue;
}
line = line.replaceAll("[\\|][0-9]+[\\|][0-9]+[\\|]", "");
String[] split = line.split("\\|");
String name = split[0];
if (name.isEmpty() || name.length() > 16 || !StringMan.isAlphanumericUnd(name)) {
continue;
}
UUID old = currentUUIDWrapper.getUUID(name);
if (old == null) {
continue;
}
UUID now = newWrapper.getUUID(name);
UUIDHandler.add(new StringWrapper(name), now);
uCMap.put(old, now);
uCReverse.put(now, old);
} catch (Exception e2) {
e2.printStackTrace();
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
MainUtil.sendMessage(player, "&7 - Replacing wrapper");
UUIDHandler.setUUIDWrapper(newWrapper);
MainUtil.sendMessage(player, "&7 - Updating plot objects");
for (Plot plot : PS.get().getPlots()) {
UUID value = uCMap.get(plot.owner);
if (value != null) {
plot.owner = value;
}
plot.getTrusted().clear();
plot.getMembers().clear();
plot.getDenied().clear();
}
MainUtil.sendMessage(player, "&7 - Deleting database");
boolean result = DBFunc.deleteTables();
MainUtil.sendMessage(player, "&7 - Creating tables");
try {
DBFunc.createTables();
if (!result) {
MainUtil.sendMessage(player, "&cConversion failed! Attempting recovery");
for (Plot plot : PS.get().getPlots()) {
UUID value = uCReverse.get(plot.owner);
if (value != null) {
plot.owner = value;
}
}
DBFunc.createPlotsAndData(new ArrayList<>(PS.get().getPlots()), new Runnable() {
@Override
public void run() {
MainUtil.sendMessage(player, "&6Recovery was successful!");
}
});
return;
}
} catch (Exception e) {
e.printStackTrace();
return;
}
if (newWrapper instanceof OfflineUUIDWrapper) {
PS.get().worlds.set("UUID.force-lowercase", false);
PS.get().worlds.set("UUID.offline", true);
} else if (newWrapper instanceof DefaultUUIDWrapper) {
PS.get().worlds.set("UUID.force-lowercase", false);
PS.get().worlds.set("UUID.offline", false);
}
try {
PS.get().worlds.save(PS.get().worldsFile);
} catch (IOException ignored) {
MainUtil.sendMessage(player, "Could not save configuration. It will need to be manual set!");
}
MainUtil.sendMessage(player, "&7 - Populating tables");
TaskManager.runTaskAsync(new Runnable() {
@Override
public void run() {
ArrayList<Plot> plots = new ArrayList<>(PS.get().getPlots());
DBFunc.createPlotsAndData(plots, new Runnable() {
@Override
public void run() {
MainUtil.sendMessage(player, "&aConversion complete!");
}
});
}
});
MainUtil.sendMessage(player, "&aIt is now safe for players to join");
MainUtil.sendMessage(player, "&cConversion is still in progress, you will be notified when it is complete");
}
});
return true;
}
}

View File

@ -1,82 +0,0 @@
package com.plotsquared.bukkit.database.plotme;
import com.intellectualcrafters.configuration.file.FileConfiguration;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotId;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Collections;
import java.util.HashMap;
public abstract class APlotMeConnector {
public abstract Connection getPlotMeConnection(String plugin, FileConfiguration plotConfig, String dataFolder);
public abstract HashMap<String, HashMap<PlotId, Plot>> getPlotMePlots(Connection connection) throws SQLException;
public abstract boolean accepts(String version);
public boolean isValidConnection(Connection connection) {
return connection != null;
}
public void copyConfig(FileConfiguration plotConfig, String world, String actualWorldName) {
int pathWidth = plotConfig.getInt("worlds." + world + ".PathWidth"); //
PS.get().worlds.set("worlds." + actualWorldName + ".road.width", pathWidth);
int plotSize = plotConfig.getInt("worlds." + world + ".PlotSize"); //
PS.get().worlds.set("worlds." + actualWorldName + ".plot.size", plotSize);
String wallBlock = plotConfig.getString("worlds." + world + ".WallBlockId"); //
PS.get().worlds.set("worlds." + actualWorldName + ".wall.block", wallBlock);
String floor = plotConfig.getString("worlds." + world + ".PlotFloorBlockId"); //
PS.get().worlds.set("worlds." + actualWorldName + ".plot.floor", Collections.singletonList(floor));
String filling = plotConfig.getString("worlds." + world + ".PlotFillingBlockId"); //
PS.get().worlds.set("worlds." + actualWorldName + ".plot.filling", Collections.singletonList(filling));
String road = plotConfig.getString("worlds." + world + ".RoadMainBlockId");
PS.get().worlds.set("worlds." + actualWorldName + ".road.block", road);
int height = plotConfig.getInt("worlds." + world + ".RoadHeight"); //
PS.get().worlds.set("worlds." + actualWorldName + ".road.height", height);
PS.get().worlds.set("worlds." + actualWorldName + ".plot.height", height);
PS.get().worlds.set("worlds." + actualWorldName + ".wall.height", height);
}
public Location getPlotTopLocAbs(int path, int plot, PlotId plotId) {
int px = plotId.x;
int pz = plotId.y;
int x = px * (path + plot) - (int) Math.floor(path / 2) - 1;
int z = pz * (path + plot) - (int) Math.floor(path / 2) - 1;
return new Location(null, x, 256, z);
}
public Location getPlotBottomLocAbs(int path, int plot, PlotId plotId) {
int px = plotId.x;
int pz = plotId.y;
int x = px * (path + plot) - plot - (int) Math.floor(path / 2) - 1;
int z = pz * (path + plot) - plot - (int) Math.floor(path / 2) - 1;
return new Location(null, x, 1, z);
}
public void setMerged(HashMap<String, HashMap<PlotId, boolean[]>> merges, String world, PlotId id, int direction) {
HashMap<PlotId, boolean[]> plots = merges.get(world);
PlotId id2 = new PlotId(id.x, id.y);
boolean[] merge1;
if (plots.containsKey(id)) {
merge1 = plots.get(id);
} else {
merge1 = new boolean[] { false, false, false, false };
}
boolean[] merge2;
if (plots.containsKey(id2)) {
merge2 = plots.get(id2);
} else {
merge2 = new boolean[] { false, false, false, false };
}
merge1[direction] = true;
merge2[(direction + 2) % 4] = true;
plots.put(id, merge1);
plots.put(id2, merge1);
}
}

View File

@ -1,239 +0,0 @@
package com.plotsquared.bukkit.database.plotme;
import com.google.common.base.Charsets;
import com.intellectualcrafters.configuration.file.FileConfiguration;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.database.DBFunc;
import com.intellectualcrafters.plot.database.SQLite;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotArea;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.StringWrapper;
import com.intellectualcrafters.plot.util.UUIDHandler;
import java.io.File;
import java.nio.ByteBuffer;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.UUID;
public class ClassicPlotMeConnector extends APlotMeConnector {
private String plugin = "PlotMe";
private String prefix;
@Override
public Connection getPlotMeConnection(String plugin, FileConfiguration plotConfig, String dataFolder) {
this.plugin = plugin.toLowerCase();
this.prefix = plotConfig.getString("mySQLprefix", this.plugin.toLowerCase());
try {
if (plotConfig.getBoolean("usemySQL")) {
String user = plotConfig.getString("mySQLuname");
String password = plotConfig.getString("mySQLpass");
String con = plotConfig.getString("mySQLconn");
return DriverManager.getConnection(con, user, password);
} else {
return new SQLite(new File(dataFolder + File.separator + "plots.db")).openConnection();
}
} catch (SQLException | ClassNotFoundException e) {
e.printStackTrace();
}
return null;
}
@Override
public HashMap<String, HashMap<PlotId, Plot>> getPlotMePlots(Connection connection) throws SQLException {
HashMap<String, Integer> plotWidth = new HashMap<>();
HashMap<String, Integer> roadWidth = new HashMap<>();
HashMap<String, HashMap<PlotId, Plot>> plots = new HashMap<>();
HashMap<String, HashMap<PlotId, boolean[]>> merges = new HashMap<>();
PreparedStatement statement = connection.prepareStatement("SELECT * FROM `" + this.prefix + "Plots`");
ResultSet resultSet = statement.executeQuery();
String column = null;
boolean checkUUID = DBFunc.hasColumn(resultSet, "ownerid");
boolean checkUUID2 = DBFunc.hasColumn(resultSet, "ownerId");
if (checkUUID) {
column = "ownerid";
} else if (checkUUID2) {
column = "ownerId";
}
boolean merge = !"plotme".equalsIgnoreCase(this.plugin) && Settings.Enabled_Components.PLOTME_CONVERTER;
int missing = 0;
while (resultSet.next()) {
PlotId id = new PlotId(resultSet.getInt("idX"), resultSet.getInt("idZ"));
String name = resultSet.getString("owner");
String world = LikePlotMeConverter.getWorld(resultSet.getString("world"));
if (!plots.containsKey(world)) {
plots.put(world, new HashMap<PlotId, Plot>());
if (merge) {
int plot = PS.get().worlds.getInt("worlds." + world + ".plot.size");
int path = PS.get().worlds.getInt("worlds." + world + ".road.width");
plotWidth.put(world, plot);
roadWidth.put(world, path);
merges.put(world, new HashMap<PlotId, boolean[]>());
}
}
if (merge) {
int tx = resultSet.getInt("topX");
int tz = resultSet.getInt("topZ");
int bx = resultSet.getInt("bottomX") - 1;
int bz = resultSet.getInt("bottomZ") - 1;
int path = roadWidth.get(world);
int plot = plotWidth.get(world);
Location top = getPlotTopLocAbs(path, plot, id);
Location bot = getPlotBottomLocAbs(path, plot, id);
if (tx > top.getX()) {
setMerged(merges, world, id, 1);
}
if (tz > top.getZ()) {
setMerged(merges, world, id, 2);
}
if (bx < bot.getX()) {
setMerged(merges, world, id, 3);
}
if (bz > bot.getZ()) {
setMerged(merges, world, id, 0);
}
}
UUID owner = UUIDHandler.getUUID(name, null);
if (owner == null) {
if ("*".equals(name)) {
owner = DBFunc.everyone;
} else {
if (checkUUID || checkUUID2) {
byte[] bytes = resultSet.getBytes(column);
if (bytes != null) {
ByteBuffer bb = ByteBuffer.wrap(bytes);
long high = bb.getLong();
long low = bb.getLong();
owner = new UUID(high, low);
UUIDHandler.add(new StringWrapper(name), owner);
}
}
if (name.isEmpty()) {
PS.log("&cCould not identify owner for plot: " + id + " -> '" + name + "'");
missing++;
continue;
}
owner = UUID.nameUUIDFromBytes(("OfflinePlayer:" + name.toLowerCase()).getBytes(Charsets.UTF_8));
}
} else {
UUIDHandler.add(new StringWrapper(name), owner);
}
Plot plot = new Plot(PlotArea.createGeneric(world), id, owner);
plots.get(world).put(id, plot);
}
if (missing > 0) {
PS.log("&cSome names could not be identified:");
PS.log("&7 - Empty quotes mean PlotMe just stored an unowned plot in the database");
PS.log("&7 - Names you have never seen before could be from people mistyping commands");
PS.log("&7 - Converting from a non-uuid version of PlotMe can't identify owners if the playerdata files are deleted (these plots will "
+ "remain unknown until the player connects)");
}
for (Entry<String, HashMap<PlotId, boolean[]>> entry : merges.entrySet()) {
String world = entry.getKey();
for (Entry<PlotId, boolean[]> entry2 : entry.getValue().entrySet()) {
HashMap<PlotId, Plot> newPlots = plots.get(world);
Plot plot = newPlots.get(entry2.getKey());
if (plot != null) {
plot.setMerged(entry2.getValue());
}
}
}
resultSet.close();
statement.close();
try {
PS.log(" - " + this.prefix + "Denied");
statement = connection.prepareStatement("SELECT * FROM `" + this.prefix + "Denied`");
resultSet = statement.executeQuery();
while (resultSet.next()) {
PlotId id = new PlotId(resultSet.getInt("idX"), resultSet.getInt("idZ"));
String name = resultSet.getString("player");
String world = LikePlotMeConverter.getWorld(resultSet.getString("world"));
UUID denied = UUIDHandler.getUUID(name, null);
if (denied == null) {
if ("*".equals(name)) {
denied = DBFunc.everyone;
} else if (DBFunc.hasColumn(resultSet, "playerid")) {
byte[] bytes = resultSet.getBytes("playerid");
if (bytes != null) {
ByteBuffer bb = ByteBuffer.wrap(bytes);
long mostSigBits = bb.getLong();
long leastSigBits = bb.getLong();
denied = new UUID(mostSigBits, leastSigBits);
UUIDHandler.add(new StringWrapper(name), denied);
}
}
if (denied == null) {
PS.log("&6Could not identify denied for plot: " + id);
continue;
}
}
HashMap<PlotId, Plot> worldMap = plots.get(world);
if (worldMap != null) {
Plot plot = worldMap.get(id);
if (plot != null) {
plot.getDenied().add(denied);
}
}
}
statement = connection.prepareStatement("SELECT * FROM `" + this.plugin + "Allowed`");
resultSet = statement.executeQuery();
while (resultSet.next()) {
PlotId id = new PlotId(resultSet.getInt("idX"), resultSet.getInt("idZ"));
String name = resultSet.getString("player");
String world = LikePlotMeConverter.getWorld(resultSet.getString("world"));
UUID helper = UUIDHandler.getUUID(name, null);
if (helper == null) {
if ("*".equals(name)) {
helper = DBFunc.everyone;
} else if (DBFunc.hasColumn(resultSet, "playerid")) {
byte[] bytes = resultSet.getBytes("playerid");
if (bytes != null) {
ByteBuffer bb = ByteBuffer.wrap(bytes);
long mostSigBits = bb.getLong();
long leastSigBits = bb.getLong();
helper = new UUID(mostSigBits, leastSigBits);
UUIDHandler.add(new StringWrapper(name), helper);
}
}
if (helper == null) {
PS.log("&6Could not identify helper for plot: " + id);
continue;
}
}
HashMap<PlotId, Plot> worldMap = plots.get(world);
if (worldMap != null) {
Plot plot = worldMap.get(id);
if (plot != null) {
plot.getTrusted().add(helper);
}
}
}
resultSet.close();
statement.close();
} catch (SQLException ignored) {}
return plots;
}
@Override
public boolean accepts(String version) {
return version == null || PS.get().canUpdate(version, "0.17.0") || PS.get().canUpdate("0.999.999", version);
}
}

View File

@ -1,362 +0,0 @@
package com.plotsquared.bukkit.database.plotme;
import com.intellectualcrafters.configuration.ConfigurationSection;
import com.intellectualcrafters.configuration.MemorySection;
import com.intellectualcrafters.configuration.file.FileConfiguration;
import com.intellectualcrafters.configuration.file.YamlConfiguration;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.database.DBFunc;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotArea;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.util.TaskManager;
import com.plotsquared.bukkit.generator.BukkitPlotGenerator;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.WorldCreator;
import org.bukkit.command.CommandException;
public class LikePlotMeConverter {
private final String plugin;
public LikePlotMeConverter(String plugin) {
this.plugin = plugin;
}
public static String getWorld(String world) {
for (World newWorld : Bukkit.getWorlds()) {
if (newWorld.getName().equalsIgnoreCase(world)) {
return newWorld.getName();
}
}
return world;
}
private void sendMessage(String message) {
PS.debug("&3PlotMe&8->&3" + PS.imp().getPluginName() + "&8: &7" + message);
}
public String getPlotMePath() {
return new File(".").getAbsolutePath() + File.separator + "plugins" + File.separator + plugin + File.separator;
}
public FileConfiguration getPlotMeConfig(String dataFolder) {
File plotMeFile = new File(dataFolder + "config.yml");
if (!plotMeFile.exists()) {
return null;
}
return YamlConfiguration.loadConfiguration(plotMeFile);
}
public Set<String> getPlotMeWorlds(FileConfiguration plotConfig) {
return plotConfig.getConfigurationSection("worlds").getKeys(false);
}
public void mergeWorldYml(FileConfiguration plotConfig) {
try {
File genConfig =
new File("plugins" + File.separator + plugin + File.separator + "PlotMe-DefaultGenerator" + File.separator + "config.yml");
if (genConfig.exists()) {
YamlConfiguration yml = YamlConfiguration.loadConfiguration(genConfig);
for (String key : yml.getKeys(true)) {
if (!plotConfig.contains(key)) {
Object value = yml.get(key);
if (!(value instanceof MemorySection)) {
plotConfig.set(key, value);
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
public void updateWorldYml(String location) {
try {
Path path = Paths.get(location);
File file = new File(location);
if (!file.exists()) {
return;
}
String content = new String(Files.readAllBytes(path), StandardCharsets.UTF_8);
String pluginName = PS.imp().getPluginName();
content = content.replace("PlotMe-DefaultGenerator", pluginName);
content = content.replace("PlotMe", pluginName);
content = content.replace("AthionPlots", pluginName);
content = content.replace("PlotZWorld", pluginName);
Files.write(path, content.getBytes(StandardCharsets.UTF_8));
} catch (IOException ignored) {}
}
private void copyConfig(ConfigurationSection plotmeDgYml, String world) throws IOException {
String actualWorldName = getWorld(world);
String plotMeWorldName = world.toLowerCase();
Integer pathWidth = plotmeDgYml.getInt("worlds." + plotMeWorldName + ".PathWidth"); //
PS.get().worlds.set("worlds." + world + ".road.width", pathWidth);
int height = plotmeDgYml.getInt("worlds." + plotMeWorldName + ".RoadHeight", plotmeDgYml.getInt("worlds." + plotMeWorldName + ".GroundHeight", 64)); //
PS.get().worlds.set("worlds." + world + ".road.height", height);
PS.get().worlds.set("worlds." + world + ".wall.height", height);
PS.get().worlds.set("worlds." + world + ".plot.height", height);
int plotSize = plotmeDgYml.getInt("worlds." + plotMeWorldName + ".PlotSize", 32); //
PS.get().worlds.set("worlds." + world + ".plot.size", plotSize);
String wallblock = plotmeDgYml.getString("worlds." + plotMeWorldName + ".UnclaimedBorder", plotmeDgYml.getString("worlds." + plotMeWorldName + ".WallBlock", "44")); //
PS.get().worlds.set("worlds." + world + ".wall.block", wallblock);
String claimed = plotmeDgYml.getString("worlds." + plotMeWorldName + ".ProtectedWallBlock", "44:1"); //
PS.get().worlds.set("worlds." + world + ".wall.block_claimed", claimed);
String floor = plotmeDgYml.getString("worlds." + plotMeWorldName + ".PlotFloorBlock", "2"); //
PS.get().worlds.set("worlds." + world + ".plot.floor", Collections.singletonList(floor));
String filling = plotmeDgYml.getString("worlds." + plotMeWorldName + ".FillBlock", "3"); //
PS.get().worlds.set("worlds." + world + ".plot.filling", Collections.singletonList(filling));
String road = plotmeDgYml.getString("worlds." + plotMeWorldName + ".RoadMainBlock", "5");
PS.get().worlds.set("worlds." + world + ".road.block", road);
PS.get().worlds.set("worlds." + actualWorldName + ".road.height", height);
PS.get().worlds.set("worlds." + actualWorldName + ".plot.height", height);
PS.get().worlds.set("worlds." + actualWorldName + ".wall.height", height);
PS.get().worlds.save(PS.get().worldsFile);
}
public boolean run(APlotMeConnector connector) {
try {
String dataFolder = getPlotMePath();
FileConfiguration plotConfig = getPlotMeConfig(dataFolder);
if (plotConfig == null) {
return false;
}
String version = plotConfig.getString("Version");
if (version == null) {
version = plotConfig.getString("version");
}
if (!connector.accepts(version)) {
return false;
}
PS.debug("&3Using connector: " + connector.getClass().getCanonicalName());
Connection connection = connector.getPlotMeConnection(plugin,plotConfig, dataFolder);
if (!connector.isValidConnection(connection)) {
sendMessage("Cannot connect to PlotMe DB. Conversion process will not continue");
return false;
}
sendMessage("PlotMe conversion has started. To disable this, please set 'enabled-components -> plotme-converter' to false in the 'settings.yml'");
mergeWorldYml(plotConfig);
sendMessage("Connecting to PlotMe DB");
ArrayList<Plot> createdPlots = new ArrayList<>();
sendMessage("Collecting plot data");
String dbPrefix = "PlotMe".toLowerCase();
sendMessage(" - " + dbPrefix + "Plots");
final Set<String> worlds = getPlotMeWorlds(plotConfig);
if (Settings.Enabled_Components.PLOTME_CONVERTER) {
sendMessage("Updating bukkit.yml");
updateWorldYml("bukkit.yml");
updateWorldYml("plugins/Multiverse-Core/worlds.yml");
for (String world : plotConfig.getConfigurationSection("worlds").getKeys(false)) {
sendMessage("Copying config for: " + world);
try {
String actualWorldName = getWorld(world);
connector.copyConfig(plotConfig, world, actualWorldName);
PS.get().worlds.save(PS.get().worldsFile);
} catch (IOException e) {
e.printStackTrace();
sendMessage("&c-- &lFailed to save configuration for world '" + world
+ "'\nThis will need to be done using the setup command, or manually");
}
}
}
HashMap<String, HashMap<PlotId, Plot>> plots = connector.getPlotMePlots(connection);
int plotCount = 0;
for (Entry<String, HashMap<PlotId, Plot>> entry : plots.entrySet()) {
plotCount += entry.getValue().size();
}
if (!Settings.Enabled_Components.PLOTME_CONVERTER) {
return false;
}
sendMessage(" - " + dbPrefix + "Allowed");
sendMessage("Collected " + plotCount + " plots from PlotMe");
File plotmeDgFile = new File(dataFolder + File.separator + "PlotMe-DefaultGenerator" + File.separator + "config.yml");
if (plotmeDgFile.exists()) {
YamlConfiguration plotmeDgYml = YamlConfiguration.loadConfiguration(plotmeDgFile);
try {
HashSet<String> allWorlds = new HashSet<>(plots.keySet());
allWorlds.addAll(worlds);
for (String world : allWorlds) {
copyConfig(plotmeDgYml, world);
}
} catch (IOException ignored) {
ignored.printStackTrace();
}
}
for (Entry<String, HashMap<PlotId, Plot>> entry : plots.entrySet()) {
String world = entry.getKey();
PlotArea area = PS.get().getPlotArea(world, null);
int duplicate = 0;
if (area != null) {
for (Entry<PlotId, Plot> entry2 : entry.getValue().entrySet()) {
if (area.getOwnedPlotAbs(entry2.getKey()) != null) {
duplicate++;
} else {
createdPlots.add(entry2.getValue());
}
}
if (duplicate > 0) {
PS.debug("&c[WARNING] Found " + duplicate + " duplicate plots already in DB for world: '" + world
+ "'. Have you run the converter already?");
}
} else {
if (PS.get().plots_tmp != null) {
HashMap<PlotId, Plot> map = PS.get().plots_tmp.get(world);
if (map != null) {
for (Entry<PlotId, Plot> entry2 : entry.getValue().entrySet()) {
if (map.containsKey(entry2.getKey())) {
duplicate++;
} else {
createdPlots.add(entry2.getValue());
}
}
if (duplicate > 0) {
PS.debug("&c[WARNING] Found " + duplicate + " duplicate plots already in DB for world: '" + world
+ "'. Have you run the converter already?");
}
continue;
}
}
createdPlots.addAll(entry.getValue().values());
}
}
sendMessage("Creating plot DB");
Thread.sleep(1000);
final AtomicBoolean done = new AtomicBoolean(false);
DBFunc.createPlotsAndData(createdPlots, new Runnable() {
@Override
public void run() {
if (done.get()) {
done();
sendMessage("&aDatabase conversion is now complete!");
PS.debug("&c - Stop the server");
PS.debug("&c - Disable 'plotme-converter' and 'plotme-convert.cache-uuids' in the settings.yml");
PS.debug("&c - Correct any generator settings that haven't copied to 'settings.yml' properly");
PS.debug("&c - Start the server");
PS.get().setPlots(DBFunc.getPlots());
} else {
sendMessage("&cPlease wait until database conversion is complete. You will be notified with instructions when this happens!");
done.set(true);
}
}
});
sendMessage("Saving configuration...");
try {
PS.get().worlds.save(PS.get().worldsFile);
} catch (IOException ignored) {
sendMessage(" - &cFailed to save configuration.");
}
TaskManager.runTask(new Runnable() {
@Override
public void run() {
try {
boolean mv = false;
boolean mw = false;
if ((Bukkit.getPluginManager().getPlugin("Multiverse-Core") != null) && Bukkit.getPluginManager().getPlugin("Multiverse-Core")
.isEnabled()) {
mv = true;
} else if ((Bukkit.getPluginManager().getPlugin("MultiWorld") != null) && Bukkit.getPluginManager().getPlugin("MultiWorld")
.isEnabled()) {
mw = true;
}
for (String worldName : worlds) {
World world = Bukkit.getWorld(getWorld(worldName));
if (world == null) {
sendMessage("&cInvalid world in PlotMe configuration: " + worldName);
continue;
}
String actualWorldName = world.getName();
sendMessage("Reloading generator for world: '" + actualWorldName + "'...");
if (!Bukkit.getWorlds().isEmpty() && Bukkit.getWorlds().get(0).getName().equals(worldName)) {
sendMessage("&cYou need to stop the server to reload this world properly");
} else {
PS.get().removePlotAreas(actualWorldName);
if (mv) {
// unload world with MV
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "mv unload " + actualWorldName);
try {
Thread.sleep(1000);
} catch (InterruptedException ignored) {
Thread.currentThread().interrupt();
}
// load world with MV
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(),
"mv import " + actualWorldName + " normal -g " + PS.imp().getPluginName());
} else if (mw) {
// unload world with MW
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "mw unload " + actualWorldName);
try {
Thread.sleep(1000);
} catch (InterruptedException ignored) {
Thread.currentThread().interrupt();
}
// load world with MW
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(),
"mw create " + actualWorldName + " plugin:" + PS.imp().getPluginName());
} else {
// Load using Bukkit API
// - User must set generator manually
Bukkit.getServer().unloadWorld(world, true);
World myWorld = WorldCreator.name(actualWorldName).generator(new BukkitPlotGenerator(PS.get().IMP.getDefaultGenerator())).createWorld();
myWorld.save();
}
}
}
} catch (CommandException e) {
e.printStackTrace();
}
if (done.get()) {
done();
sendMessage("&aDatabase conversion is now complete!");
PS.debug("&c - Stop the server");
PS.debug("&c - Disable 'plotme-converter' and 'plotme-convert.cache-uuids' in the settings.yml");
PS.debug("&c - Correct any generator settings that haven't copied to 'settings.yml' properly");
PS.debug("&c - Start the server");
} else {
sendMessage("&cPlease wait until database conversion is complete. You will be notified with instructions when this happens!");
done.set(true);
}
}
});
} catch (InterruptedException | SQLException e) {
e.printStackTrace();
PS.debug("&/end/");
}
return true;
}
public void done() {
PS.get().setPlots(DBFunc.getPlots());
}
}

View File

@ -1,194 +0,0 @@
package com.plotsquared.bukkit.database.plotme;
import com.intellectualcrafters.configuration.file.FileConfiguration;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.database.DBFunc;
import com.intellectualcrafters.plot.database.SQLite;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotArea;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.StringWrapper;
import com.intellectualcrafters.plot.util.UUIDHandler;
import java.io.File;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.UUID;
public class PlotMeConnector_017 extends APlotMeConnector {
private String plugin;
@Override
public Connection getPlotMeConnection(String plugin, FileConfiguration plotConfig, String dataFolder) {
this.plugin = plugin.toLowerCase();
try {
if (plotConfig.getBoolean("usemySQL")) {
String user = plotConfig.getString("mySQLuname");
String password = plotConfig.getString("mySQLpass");
String con = plotConfig.getString("mySQLconn");
return DriverManager.getConnection(con, user, password);
} else {
File file = new File(dataFolder + File.separator + "plotmecore.db");
if (file.exists()) {
return new SQLite(file).openConnection();
}
return new SQLite(new File(dataFolder + File.separator + "plots.db")).openConnection();
}
} catch (SQLException | ClassNotFoundException e) {
e.printStackTrace();
}
return null;
}
@Override
public HashMap<String, HashMap<PlotId, Plot>> getPlotMePlots(Connection connection) throws SQLException {
ResultSet resultSet;
PreparedStatement statement;
HashMap<String, Integer> plotWidth = new HashMap<>();
HashMap<String, Integer> roadWidth = new HashMap<>();
HashMap<Integer, Plot> plots = new HashMap<>();
HashMap<String, HashMap<PlotId, boolean[]>> merges = new HashMap<>();
try {
statement = connection.prepareStatement("SELECT * FROM `" + this.plugin + "core_plots`");
resultSet = statement.executeQuery();
} catch (SQLException e) {
PS.debug("========= Table does not exist =========");
e.printStackTrace();
PS.debug("=======================================");
PS.debug("&8 - &7The database does not match the version specified in the PlotMe config");
PS.debug("&8 - &7Please correct this, or if you are unsure, the most common is 0.16.3");
return null;
}
boolean checkUUID = DBFunc.hasColumn(resultSet, "ownerID");
boolean merge = !"plotme".equals(this.plugin) && Settings.Enabled_Components.PLOTME_CONVERTER;
while (resultSet.next()) {
int key = resultSet.getInt("plot_id");
PlotId id = new PlotId(resultSet.getInt("plotX"), resultSet.getInt("plotZ"));
String name = resultSet.getString("owner");
String world = LikePlotMeConverter.getWorld(resultSet.getString("world"));
if (!plots.containsKey(world) && merge) {
int plot = PS.get().worlds.getInt("worlds." + world + ".plot.size");
int path = PS.get().worlds.getInt("worlds." + world + ".road.width");
plotWidth.put(world, plot);
roadWidth.put(world, path);
merges.put(world, new HashMap<PlotId, boolean[]>());
}
if (merge) {
int tx = resultSet.getInt("topX");
int tz = resultSet.getInt("topZ");
int bx = resultSet.getInt("bottomX") - 1;
int bz = resultSet.getInt("bottomZ") - 1;
int path = roadWidth.get(world);
int plot = plotWidth.get(world);
Location top = getPlotTopLocAbs(path, plot, id);
Location bot = getPlotBottomLocAbs(path, plot, id);
if (tx > top.getX()) {
setMerged(merges, world, id, 1);
}
if (tz > top.getZ()) {
setMerged(merges, world, id, 2);
}
if (bx < bot.getX()) {
setMerged(merges, world, id, 3);
}
if (bz > bot.getZ()) {
setMerged(merges, world, id, 0);
}
}
UUID owner = UUIDHandler.getUUID(name, null);
if (owner == null) {
if (name.equals("*")) {
owner = DBFunc.everyone;
} else {
if (checkUUID) {
byte[] bytes = resultSet.getBytes("ownerid");
if (bytes != null) {
owner = UUID.nameUUIDFromBytes(bytes);
UUIDHandler.add(new StringWrapper(name), owner);
}
}
if (owner == null) {
PS.log("&cCould not identify owner for plot: " + id + " -> '" + name + '\'');
continue;
}
}
} else {
UUIDHandler.add(new StringWrapper(name), owner);
}
Plot plot = new Plot(PlotArea.createGeneric(world), id, owner);
plots.put(key, plot);
}
for (Plot plot : plots.values()) {
HashMap<PlotId, boolean[]> mergeMap = merges.get(plot.getArea().worldname);
if (mergeMap != null) {
if (mergeMap.containsKey(plot.getId())) {
plot.setMerged(mergeMap.get(plot.getId()));
}
}
}
resultSet.close();
statement.close();
try {
PS.log(" - " + this.plugin + "core_denied");
statement = connection.prepareStatement("SELECT * FROM `" + this.plugin + "core_denied`");
resultSet = statement.executeQuery();
while (resultSet.next()) {
int key = resultSet.getInt("plot_id");
Plot plot = plots.get(key);
if (plot == null) {
PS.log("&6Denied (" + key + ") references deleted plot; ignoring entry.");
continue;
}
UUID denied = UUID.fromString(resultSet.getString("player"));
plot.getDenied().add(denied);
}
PS.log(" - " + this.plugin + "core_allowed");
statement = connection.prepareStatement("SELECT * FROM `" + this.plugin + "core_allowed`");
resultSet = statement.executeQuery();
while (resultSet.next()) {
int key = resultSet.getInt("plot_id");
Plot plot = plots.get(key);
if (plot == null) {
PS.log("&6Allowed (" + key + ") references deleted plot; ignoring entry.");
continue;
}
UUID allowed = UUID.fromString(resultSet.getString("player"));
plot.getTrusted().add(allowed);
}
resultSet.close();
statement.close();
} catch (SQLException e) {
e.printStackTrace();
}
HashMap<String, HashMap<PlotId, Plot>> processed = new HashMap<>();
for (Plot plot : plots.values()) {
HashMap<PlotId, Plot> map = processed.get(plot.getArea().worldname);
if (map == null) {
map = new HashMap<>();
processed.put(plot.getArea().worldname, map);
}
map.put(plot.getId(), plot);
}
return processed;
}
@Override
public boolean accepts(String version) {
if (version == null) {
return false;
}
return !PS.get().canUpdate(version, "0.17");
}
}

View File

@ -0,0 +1,27 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.entity;
class AgeableStats {
int age;
boolean locked;
boolean adult;
}

View File

@ -0,0 +1,34 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.entity;
class ArmorStandStats {
final float[] head = new float[3];
final float[] body = new float[3];
final float[] leftLeg = new float[3];
final float[] rightLeg = new float[3];
final float[] leftArm = new float[3];
final float[] rightArm = new float[3];
boolean arms;
boolean noPlate;
boolean invisible;
boolean small;
}

View File

@ -0,0 +1,31 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.entity;
class EntityBaseStats {
EntityWrapper passenger;
float fall;
short fire;
int age;
double vZ;
double vY;
double vX;
}

View File

@ -0,0 +1,87 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.entity;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.checkerframework.checker.nullness.qual.NonNull;
public abstract class EntityWrapper {
protected final float yaw;
protected final float pitch;
private final Entity entity;
private final EntityType type;
public double x;
public double y;
public double z;
EntityWrapper(final @NonNull Entity entity) {
this.entity = entity;
this.type = entity.getType();
final Location location = entity.getLocation();
this.x = location.getX();
this.y = location.getY();
this.z = location.getZ();
this.yaw = location.getYaw();
this.pitch = location.getPitch();
}
@SuppressWarnings("deprecation")
@Override
public String toString() {
return String.format("[%s, x=%s, y=%s, z=%s]", type.getName(), x, y, z);
}
public abstract Entity spawn(World world, int xOffset, int zOffset);
public abstract void saveEntity();
public float getYaw() {
return this.yaw;
}
public float getPitch() {
return this.pitch;
}
public Entity getEntity() {
return this.entity;
}
public EntityType getType() {
return this.type;
}
public double getX() {
return this.x;
}
public double getY() {
return this.y;
}
public double getZ() {
return this.z;
}
}

View File

@ -0,0 +1,31 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.entity;
import org.bukkit.entity.Horse;
class HorseStats {
double jump;
boolean chest;
Horse.Variant variant;
Horse.Color color;
Horse.Style style;
}

View File

@ -0,0 +1,47 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.entity;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
import java.util.Collection;
class LivingEntityStats {
boolean loot;
String name;
boolean visible;
float health;
short air;
boolean persistent;
boolean leashed;
short leashX;
short leashY;
short leashZ;
boolean equipped;
ItemStack mainHand;
ItemStack helmet;
ItemStack boots;
ItemStack leggings;
ItemStack chestplate;
Collection<PotionEffect> potions;
ItemStack offHand;
}

View File

@ -1,7 +1,26 @@
package com.plotsquared.bukkit.object.entity;
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.entity;
import com.intellectualcrafters.plot.PS;
import com.plotsquared.bukkit.util.BukkitVersion;
import com.plotsquared.core.configuration.Settings;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bukkit.Art;
import org.bukkit.DyeColor;
import org.bukkit.Location;
@ -9,25 +28,21 @@ import org.bukkit.Rotation;
import org.bukkit.TreeSpecies;
import org.bukkit.World;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.AbstractHorse;
import org.bukkit.entity.Ageable;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Bat;
import org.bukkit.entity.Boat;
import org.bukkit.entity.ChestedHorse;
import org.bukkit.entity.EnderDragon;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Guardian;
import org.bukkit.entity.Horse;
import org.bukkit.entity.IronGolem;
import org.bukkit.entity.Item;
import org.bukkit.entity.ItemFrame;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Painting;
import org.bukkit.entity.Rabbit;
import org.bukkit.entity.Rabbit.Type;
import org.bukkit.entity.Sheep;
import org.bukkit.entity.Skeleton;
import org.bukkit.entity.Skeleton.SkeletonType;
import org.bukkit.entity.Slime;
import org.bukkit.entity.Tameable;
import org.bukkit.inventory.EntityEquipment;
@ -36,18 +51,17 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.util.EulerAngle;
import org.bukkit.util.Vector;
public class EntityWrapper {
import java.util.List;
public final class ReplicatingEntityWrapper extends EntityWrapper {
private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + ReplicatingEntityWrapper.class.getSimpleName());
private final EntityType type;
private final float yaw;
private final float pitch;
private final short depth;
private final int hash;
private final EntityBaseStats base = new EntityBaseStats();
public double x;
public double y;
public double z;
public ItemStack[] inventory;
private ItemStack[] inventory;
// Extended
private ItemStack stack;
private byte dataByte;
@ -60,22 +74,18 @@ public class EntityWrapper {
private HorseStats horse;
private boolean noGravity;
public EntityWrapper(Entity entity, short depth) {
public ReplicatingEntityWrapper(Entity entity, short depth) {
super(entity);
this.hash = entity.getEntityId();
this.depth = depth;
Location location = entity.getLocation();
this.yaw = location.getYaw();
this.pitch = location.getPitch();
this.x = location.getX();
this.y = location.getY();
this.z = location.getZ();
this.type = entity.getType();
if (depth == 0) {
return;
}
Entity passenger = entity.getPassenger();
if (passenger != null) {
this.base.passenger = new EntityWrapper(passenger, depth);
List<Entity> passengers = entity.getPassengers();
if (passengers.size() > 0) {
this.base.passenger = new ReplicatingEntityWrapper(passengers.get(0), depth);
}
this.base.fall = entity.getFallDistance();
this.base.fire = (short) entity.getFireTicks();
@ -87,73 +97,65 @@ public class EntityWrapper {
if (depth == 1) {
return;
}
if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), BukkitVersion.v1_10_0) || entity instanceof ArmorStand) {
if (!entity.hasGravity()) {
this.noGravity = true;
}
if (!entity.hasGravity()) {
this.noGravity = true;
}
switch (entity.getType()) {
case ARROW:
case BOAT:
if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), BukkitVersion.v1_9_0)) {
Boat boat = (Boat) entity;
this.dataByte = getOrdinal(TreeSpecies.values(), boat.getWoodType());
}
case COMPLEX_PART:
case EGG:
case ENDER_CRYSTAL:
case ENDER_PEARL:
case ENDER_SIGNAL:
case EXPERIENCE_ORB:
case FALLING_BLOCK:
case FIREBALL:
case FIREWORK:
case FISHING_HOOK:
case LEASH_HITCH:
case LIGHTNING:
case MINECART:
case MINECART_COMMAND:
case MINECART_MOB_SPAWNER:
case MINECART_TNT:
case PLAYER:
case PRIMED_TNT:
case SLIME:
case SMALL_FIREBALL:
case SNOWBALL:
case MINECART_FURNACE:
case SPLASH_POTION:
case THROWN_EXP_BOTTLE:
case WEATHER:
case WITHER_SKULL:
case UNKNOWN:
case TIPPED_ARROW:
case SPECTRAL_ARROW:
case SHULKER_BULLET:
case DRAGON_FIREBALL:
case LINGERING_POTION:
case AREA_EFFECT_CLOUD:
switch (entity.getType().toString()) {
case "BOAT":
Boat boat = (Boat) entity;
this.dataByte = getOrdinal(TreeSpecies.values(), boat.getWoodType());
return;
case "ARROW":
case "EGG":
case "ENDER_CRYSTAL":
case "ENDER_PEARL":
case "ENDER_SIGNAL":
case "EXPERIENCE_ORB":
case "FALLING_BLOCK":
case "FIREBALL":
case "FIREWORK":
case "FISHING_HOOK":
case "LEASH_HITCH":
case "LIGHTNING":
case "MINECART":
case "MINECART_COMMAND":
case "MINECART_MOB_SPAWNER":
case "MINECART_TNT":
case "PLAYER":
case "PRIMED_TNT":
case "SLIME":
case "SMALL_FIREBALL":
case "SNOWBALL":
case "MINECART_FURNACE":
case "SPLASH_POTION":
case "THROWN_EXP_BOTTLE":
case "WITHER_SKULL":
case "UNKNOWN":
case "SPECTRAL_ARROW":
case "SHULKER_BULLET":
case "DRAGON_FIREBALL":
case "AREA_EFFECT_CLOUD":
case "TRIDENT":
case "LLAMA_SPIT":
// Do this stuff later
return;
default:
PS.debug("&cCOULD NOT IDENTIFY ENTITY: " + entity.getType());
return;
// MISC //
case DROPPED_ITEM:
case "DROPPED_ITEM":
Item item = (Item) entity;
this.stack = item.getItemStack();
return;
case ITEM_FRAME:
this.x = Math.floor(this.x);
this.y = Math.floor(this.y);
this.z = Math.floor(this.z);
case "ITEM_FRAME":
this.x = Math.floor(this.getX());
this.y = Math.floor(this.getY());
this.z = Math.floor(this.getZ());
ItemFrame itemFrame = (ItemFrame) entity;
this.dataByte = getOrdinal(Rotation.values(), itemFrame.getRotation());
this.stack = itemFrame.getItem().clone();
return;
case PAINTING:
this.x = Math.floor(this.x);
this.y = Math.floor(this.y);
this.z = Math.floor(this.z);
case "PAINTING":
this.x = Math.floor(this.getX());
this.y = Math.floor(this.getY());
this.z = Math.floor(this.getZ());
Painting painting = (Painting) entity;
Art art = painting.getArt();
this.dataByte = getOrdinal(BlockFace.values(), painting.getFacing());
@ -165,68 +167,75 @@ public class EntityWrapper {
return;
// END MISC //
// INVENTORY HOLDER //
case MINECART_CHEST:
case MINECART_HOPPER:
case "MINECART_CHEST":
case "MINECART_HOPPER":
storeInventory((InventoryHolder) entity);
return;
// START LIVING ENTITY //
// START AGEABLE //
// START TAMEABLE //
case HORSE:
Horse horse = (Horse) entity;
case "HORSE":
case "DONKEY":
case "LLAMA":
case "MULE":
case "SKELETON_HORSE":
AbstractHorse horse = (AbstractHorse) entity;
this.horse = new HorseStats();
this.horse.jump = horse.getJumpStrength();
this.horse.chest = horse.isCarryingChest();
this.horse.variant = horse.getVariant();
this.horse.style = horse.getStyle();
this.horse.color = horse.getColor();
if (horse instanceof ChestedHorse horse1) {
this.horse.chest = horse1.isCarryingChest();
}
//todo these horse features need fixing
//this.horse.variant = horse.getVariant();
//this.horse.style = horse.getStyle();
//this.horse.color = horse.getColor();
storeTameable(horse);
storeAgeable(horse);
storeLiving(horse);
storeInventory(horse);
return;
// END INVENTORY HOLDER //
case WOLF:
case OCELOT:
case "WOLF":
case "OCELOT":
storeTameable((Tameable) entity);
storeAgeable((Ageable) entity);
storeLiving((LivingEntity) entity);
return;
// END TAMEABLE //
case SHEEP:
//todo fix sheep
case "SHEEP":
Sheep sheep = (Sheep) entity;
this.dataByte = (byte) (sheep.isSheared() ? 1 : 0);
if (sheep.isSheared()) {
this.dataByte = (byte) 1;
} else {
this.dataByte = (byte) 0;
}
this.dataByte2 = sheep.getColor().getDyeData();
storeAgeable(sheep);
storeLiving(sheep);
return;
case VILLAGER:
case CHICKEN:
case COW:
case MUSHROOM_COW:
case PIG:
case POLAR_BEAR:
case "VILLAGER":
case "CHICKEN":
case "COW":
case "MUSHROOM_COW":
case "PIG":
case "TURTLE":
case "POLAR_BEAR":
storeAgeable((Ageable) entity);
storeLiving((LivingEntity) entity);
return;
case RABBIT:
this.dataByte = getOrdinal(Type.values(), ((Rabbit) entity).getRabbitType());
case "RABBIT":
this.dataByte = getOrdinal(Rabbit.Type.values(), ((Rabbit) entity).getRabbitType());
storeAgeable((Ageable) entity);
storeLiving((LivingEntity) entity);
return;
// END AGEABLE //
case GUARDIAN:
this.dataByte = (byte) (((Guardian) entity).isElder() ? 1 : 0);
storeLiving((LivingEntity) entity);
return;
case SKELETON:
this.dataByte = getOrdinal(SkeletonType.values(),((Skeleton)entity).getSkeletonType());
storeLiving((LivingEntity) entity);
return;
case ARMOR_STAND:
case "ARMOR_STAND":
ArmorStand stand = (ArmorStand) entity;
this.inventory = new ItemStack[]{stand.getItemInHand().clone(), stand.getHelmet().clone(), stand.getChestplate().clone(),
stand.getLeggings().clone(), stand.getBoots().clone()};
this.inventory =
new ItemStack[]{stand.getItemInHand().clone(), stand.getHelmet().clone(),
stand.getChestplate().clone(), stand.getLeggings().clone(),
stand.getBoots().clone()};
storeLiving(stand);
this.stand = new ArmorStandStats();
@ -273,38 +282,46 @@ public class EntityWrapper {
this.stand.small = true;
}
return;
case ENDERMITE:
case "ENDERMITE":
return;
case BAT:
case "BAT":
if (((Bat) entity).isAwake()) {
this.dataByte = (byte) 1;
} else {
this.dataByte = (byte) 0;
}
return;
case ENDER_DRAGON:
case "ENDER_DRAGON":
EnderDragon entity1 = (EnderDragon) entity;
this.dataByte = (byte) entity1.getPhase().ordinal();
return;
case GHAST:
case MAGMA_CUBE:
case SQUID:
case PIG_ZOMBIE:
case ZOMBIE:
case WITHER:
case WITCH:
case SPIDER:
case CAVE_SPIDER:
case SILVERFISH:
case GIANT:
case ENDERMAN:
case CREEPER:
case BLAZE:
case SHULKER:
case SNOWMAN:
case "SKELETON":
case "WITHER_SKELETON":
case "GUARDIAN":
case "ELDER_GUARDIAN":
case "GHAST":
case "MAGMA_CUBE":
case "SQUID":
case "PIG_ZOMBIE":
case "HOGLIN":
case "ZOMBIFIED_PIGLIN":
case "PIGLIN":
case "PIGLIN_BRUTE":
case "ZOMBIE":
case "WITHER":
case "WITCH":
case "SPIDER":
case "CAVE_SPIDER":
case "SILVERFISH":
case "GIANT":
case "ENDERMAN":
case "CREEPER":
case "BLAZE":
case "SHULKER":
case "SNOWMAN":
storeLiving((LivingEntity) entity);
return;
case IRON_GOLEM:
case "IRON_GOLEM":
if (((IronGolem) entity).isPlayerCreated()) {
this.dataByte = (byte) 1;
} else {
@ -346,35 +363,34 @@ public class EntityWrapper {
if (this.lived.leashed) {
// TODO leashes
// World world = entity.getWorld();
// Entity leash = world.spawnEntity(new Location(world, Math.floor(x) + lived.leashX, Math.floor(y) + lived.leashY, Math
// .floor(z) + lived.leashZ), EntityType.LEASH_HITCH);
// Entity leash = world.spawnEntity(new Location(world, Math.floor(x) +
// lived.leashX, Math.floor(y) + lived.leashY, Math.floor(z) + lived.leashZ),
// EntityType.LEASH_HITCH);
// entity.setLeashHolder(leash);
}
}
void restoreEquipment(LivingEntity entity) {
EntityEquipment equipment = entity.getEquipment();
if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), BukkitVersion.v1_9_0)) {
if (equipment != null) {
equipment.setItemInMainHand(this.lived.mainHand);
equipment.setItemInOffHand(this.lived.offHand);
} else {
equipment.setItemInHand(this.lived.mainHand);
equipment.setHelmet(this.lived.helmet);
equipment.setChestplate(this.lived.chestplate);
equipment.setLeggings(this.lived.leggings);
equipment.setBoots(this.lived.boots);
}
equipment.setHelmet(this.lived.helmet);
equipment.setChestplate(this.lived.chestplate);
equipment.setLeggings(this.lived.leggings);
equipment.setBoots(this.lived.boots);
}
private void restoreInventory(InventoryHolder entity) {
try {
entity.getInventory().setContents(this.inventory);
} catch (IllegalArgumentException e) {
PS.debug("&c[WARN] Failed to restore inventory.\n Reason: " + e.getMessage());
LOGGER.error("Failed to restore inventory", e);
}
}
public void storeLiving(LivingEntity lived) {
private void storeLiving(LivingEntity lived) {
this.lived = new LivingEntityStats();
this.lived.potions = lived.getActivePotionEffects();
this.lived.loot = lived.getCanPickupItems();
@ -386,9 +402,9 @@ public class EntityWrapper {
this.lived.leashed = lived.isLeashed();
if (this.lived.leashed) {
Location location = lived.getLeashHolder().getLocation();
this.lived.leashX = (short) (this.x - location.getBlockX());
this.lived.leashY = (short) (this.y - location.getBlockY());
this.lived.leashZ = (short) (this.z - location.getBlockZ());
this.lived.leashX = (short) (this.getX() - location.getBlockX());
this.lived.leashY = (short) (this.getY() - location.getBlockY());
this.lived.leashZ = (short) (this.getZ() - location.getBlockZ());
}
EntityEquipment equipment = lived.getEquipment();
this.lived.equipped = equipment != null;
@ -398,13 +414,8 @@ public class EntityWrapper {
}
void storeEquipment(EntityEquipment equipment) {
if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), BukkitVersion.v1_9_0)) {
this.lived.mainHand = equipment.getItemInMainHand().clone();
this.lived.offHand = equipment.getItemInOffHand().clone();
} else {
this.lived.mainHand = equipment.getItemInHand().clone();
this.lived.offHand = null;
}
this.lived.mainHand = equipment.getItemInMainHand().clone();
this.lived.offHand = equipment.getItemInOffHand().clone();
this.lived.boots = equipment.getBoots().clone();
this.lived.leggings = equipment.getLeggings().clone();
this.lived.chestplate = equipment.getChestplate().clone();
@ -443,28 +454,30 @@ public class EntityWrapper {
this.tamed.tamed = tamed.isTamed();
}
@SuppressWarnings("deprecation") // Paper deprecation
@Override
public Entity spawn(World world, int xOffset, int zOffset) {
Location location = new Location(world, this.x + xOffset, this.y, this.z + zOffset);
Location location = new Location(world, this.getX() + xOffset, this.getY(), this.z + zOffset);
location.setYaw(this.yaw);
location.setPitch(this.pitch);
if (!this.type.isSpawnable()) {
if (!this.getType().isSpawnable()) {
return null;
}
Entity entity;
switch (this.type) {
case DROPPED_ITEM:
switch (this.getType().toString()) {
case "DROPPED_ITEM":
return world.dropItem(location, this.stack);
case PLAYER:
case LEASH_HITCH:
case "PLAYER":
case "LEASH_HITCH":
return null;
case ITEM_FRAME:
case "ITEM_FRAME":
entity = world.spawn(location, ItemFrame.class);
break;
case PAINTING:
case "PAINTING":
entity = world.spawn(location, Painting.class);
break;
default:
entity = world.spawnEntity(location, this.type);
entity = world.spawnEntity(location, this.getType());
break;
}
if (this.depth == 0) {
@ -472,8 +485,9 @@ public class EntityWrapper {
}
if (this.base.passenger != null) {
try {
entity.setPassenger(this.base.passenger.spawn(world, xOffset, zOffset));
} catch (Exception ignored) { }
entity.addPassenger(this.base.passenger.spawn(world, xOffset, zOffset));
} catch (Exception ignored) {
}
}
if (this.base.fall != 0) {
entity.setFallDistance(this.base.fall);
@ -488,102 +502,99 @@ public class EntityWrapper {
if (this.depth == 1) {
return entity;
}
if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), BukkitVersion.v1_10_0) || entity instanceof ArmorStand) {
if (this.noGravity) {
entity.setGravity(false);
}
if (this.noGravity) {
entity.setGravity(false);
}
switch (entity.getType()) {
case ARROW:
case BOAT:
if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), BukkitVersion.v1_9_0)) {
Boat boat = (Boat) entity;
boat.setWoodType(TreeSpecies.values()[dataByte]);
}
case COMPLEX_PART:
case EGG:
case ENDER_CRYSTAL:
case ENDER_PEARL:
case ENDER_SIGNAL:
case DROPPED_ITEM:
case EXPERIENCE_ORB:
case FALLING_BLOCK:
case FIREBALL:
case FIREWORK:
case FISHING_HOOK:
case LEASH_HITCH:
case LIGHTNING:
case MINECART:
case MINECART_COMMAND:
case MINECART_MOB_SPAWNER:
case MINECART_TNT:
case PLAYER:
case PRIMED_TNT:
switch (entity.getType().toString()) {
case "BOAT":
Boat boat = (Boat) entity;
boat.setWoodType(TreeSpecies.values()[dataByte]);
return entity;
case SLIME:
case "SLIME":
((Slime) entity).setSize(this.dataByte);
return entity;
case SMALL_FIREBALL:
case SNOWBALL:
case SPLASH_POTION:
case THROWN_EXP_BOTTLE:
case WEATHER:
case TIPPED_ARROW:
case SPECTRAL_ARROW:
case SHULKER_BULLET:
case LINGERING_POTION:
case AREA_EFFECT_CLOUD:
case DRAGON_FIREBALL:
case WITHER_SKULL:
case MINECART_FURNACE:
case UNKNOWN:
case "ARROW":
case "EGG":
case "ENDER_CRYSTAL":
case "ENDER_PEARL":
case "ENDER_SIGNAL":
case "DROPPED_ITEM":
case "EXPERIENCE_ORB":
case "FALLING_BLOCK":
case "FIREBALL":
case "FIREWORK":
case "FISHING_HOOK":
case "LEASH_HITCH":
case "LIGHTNING":
case "MINECART":
case "MINECART_COMMAND":
case "MINECART_MOB_SPAWNER":
case "MINECART_TNT":
case "PLAYER":
case "PRIMED_TNT":
case "SMALL_FIREBALL":
case "SNOWBALL":
case "SPLASH_POTION":
case "THROWN_EXP_BOTTLE":
case "SPECTRAL_ARROW":
case "SHULKER_BULLET":
case "AREA_EFFECT_CLOUD":
case "DRAGON_FIREBALL":
case "WITHER_SKULL":
case "MINECART_FURNACE":
case "LLAMA_SPIT":
case "TRIDENT":
case "UNKNOWN":
// Do this stuff later
return entity;
default:
PS.debug("&cCOULD NOT IDENTIFY ENTITY: " + entity.getType());
return entity;
// MISC //
case ITEM_FRAME:
case "ITEM_FRAME":
ItemFrame itemframe = (ItemFrame) entity;
itemframe.setRotation(Rotation.values()[this.dataByte]);
itemframe.setItem(this.stack);
return entity;
case PAINTING:
case "PAINTING":
Painting painting = (Painting) entity;
painting.setFacingDirection(BlockFace.values()[this.dataByte], true);
painting.setArt(Art.getByName(this.dataString), true);
return entity;
// END MISC //
// INVENTORY HOLDER //
case MINECART_CHEST:
case MINECART_HOPPER:
case "MINECART_CHEST":
case "MINECART_HOPPER":
restoreInventory((InventoryHolder) entity);
return entity;
// START LIVING ENTITY //
// START AGEABLE //
// START TAMEABLE //
case HORSE:
Horse horse = (Horse) entity;
case "HORSE":
case "LLAMA":
case "SKELETON_HORSE":
case "DONKEY":
case "MULE":
AbstractHorse horse = (AbstractHorse) entity;
horse.setJumpStrength(this.horse.jump);
horse.setCarryingChest(this.horse.chest);
horse.setVariant(this.horse.variant);
horse.setStyle(this.horse.style);
horse.setColor(this.horse.color);
if (horse instanceof ChestedHorse) {
((ChestedHorse) horse).setCarryingChest(this.horse.chest);
}
//todo broken as of 1.13
//horse.setVariant(this.horse.variant);
//horse.setStyle(this.horse.style);
//horse.setColor(this.horse.color);
restoreTameable(horse);
restoreAgeable(horse);
restoreLiving(horse);
restoreInventory(horse);
return entity;
// END INVENTORY HOLDER //
case WOLF:
case OCELOT:
case "WOLF":
case "OCELOT":
restoreTameable((Tameable) entity);
restoreAgeable((Ageable) entity);
restoreLiving((LivingEntity) entity);
return entity;
// END AGEABLE //
case SHEEP:
case "SHEEP":
Sheep sheep = (Sheep) entity;
if (this.dataByte == 1) {
sheep.setSheared(true);
@ -594,36 +605,25 @@ public class EntityWrapper {
restoreAgeable(sheep);
restoreLiving(sheep);
return sheep;
case VILLAGER:
case CHICKEN:
case COW:
case POLAR_BEAR:
case MUSHROOM_COW:
case PIG:
case "VILLAGER":
case "CHICKEN":
case "COW":
case "TURTLE":
case "POLAR_BEAR":
case "MUSHROOM_COW":
case "PIG":
restoreAgeable((Ageable) entity);
restoreLiving((LivingEntity) entity);
return entity;
// END AGEABLE //
case RABBIT:
case "RABBIT":
if (this.dataByte != 0) {
((Rabbit) entity).setRabbitType(Type.values()[this.dataByte]);
((Rabbit) entity).setRabbitType(Rabbit.Type.values()[this.dataByte]);
}
restoreAgeable((Ageable) entity);
restoreLiving((LivingEntity) entity);
return entity;
case GUARDIAN:
if (this.dataByte != 0) {
((Guardian) entity).setElder(true);
}
restoreLiving((LivingEntity) entity);
return entity;
case SKELETON:
if (this.dataByte != 0) {
((Skeleton) entity).setSkeletonType(SkeletonType.values()[this.dataByte]);
}
storeLiving((LivingEntity) entity);
return entity;
case ARMOR_STAND:
case "ARMOR_STAND":
// CHECK positions
ArmorStand stand = (ArmorStand) entity;
if (this.inventory[0] != null) {
@ -642,27 +642,41 @@ public class EntityWrapper {
stand.setBoots(this.inventory[4]);
}
if (this.stand.head[0] != 0 || this.stand.head[1] != 0 || this.stand.head[2] != 0) {
EulerAngle pose = new EulerAngle(this.stand.head[0], this.stand.head[1], this.stand.head[2]);
EulerAngle pose =
new EulerAngle(this.stand.head[0], this.stand.head[1], this.stand.head[2]);
stand.setHeadPose(pose);
}
if (this.stand.body[0] != 0 || this.stand.body[1] != 0 || this.stand.body[2] != 0) {
EulerAngle pose = new EulerAngle(this.stand.body[0], this.stand.body[1], this.stand.body[2]);
EulerAngle pose =
new EulerAngle(this.stand.body[0], this.stand.body[1], this.stand.body[2]);
stand.setBodyPose(pose);
}
if (this.stand.leftLeg[0] != 0 || this.stand.leftLeg[1] != 0 || this.stand.leftLeg[2] != 0) {
EulerAngle pose = new EulerAngle(this.stand.leftLeg[0], this.stand.leftLeg[1], this.stand.leftLeg[2]);
if (this.stand.leftLeg[0] != 0 || this.stand.leftLeg[1] != 0
|| this.stand.leftLeg[2] != 0) {
EulerAngle pose = new EulerAngle(this.stand.leftLeg[0], this.stand.leftLeg[1],
this.stand.leftLeg[2]
);
stand.setLeftLegPose(pose);
}
if (this.stand.rightLeg[0] != 0 || this.stand.rightLeg[1] != 0 || this.stand.rightLeg[2] != 0) {
EulerAngle pose = new EulerAngle(this.stand.rightLeg[0], this.stand.rightLeg[1], this.stand.rightLeg[2]);
if (this.stand.rightLeg[0] != 0 || this.stand.rightLeg[1] != 0
|| this.stand.rightLeg[2] != 0) {
EulerAngle pose = new EulerAngle(this.stand.rightLeg[0], this.stand.rightLeg[1],
this.stand.rightLeg[2]
);
stand.setRightLegPose(pose);
}
if (this.stand.leftArm[0] != 0 || this.stand.leftArm[1] != 0 || this.stand.leftArm[2] != 0) {
EulerAngle pose = new EulerAngle(this.stand.leftArm[0], this.stand.leftArm[1], this.stand.leftArm[2]);
if (this.stand.leftArm[0] != 0 || this.stand.leftArm[1] != 0
|| this.stand.leftArm[2] != 0) {
EulerAngle pose = new EulerAngle(this.stand.leftArm[0], this.stand.leftArm[1],
this.stand.leftArm[2]
);
stand.setLeftArmPose(pose);
}
if (this.stand.rightArm[0] != 0 || this.stand.rightArm[1] != 0 || this.stand.rightArm[2] != 0) {
EulerAngle pose = new EulerAngle(this.stand.rightArm[0], this.stand.rightArm[1], this.stand.rightArm[2]);
if (this.stand.rightArm[0] != 0 || this.stand.rightArm[1] != 0
|| this.stand.rightArm[2] != 0) {
EulerAngle pose = new EulerAngle(this.stand.rightArm[0], this.stand.rightArm[1],
this.stand.rightArm[2]
);
stand.setRightArmPose(pose);
}
if (this.stand.invisible) {
@ -679,47 +693,63 @@ public class EntityWrapper {
}
restoreLiving(stand);
return stand;
case BAT:
case "BAT":
if (this.dataByte != 0) {
((Bat) entity).setAwake(true);
}
restoreLiving((LivingEntity) entity);
return entity;
case ENDER_DRAGON:
case "ENDER_DRAGON":
if (this.dataByte != 0) {
((EnderDragon) entity).setPhase(EnderDragon.Phase.values()[this.dataByte]);
}
restoreLiving((LivingEntity) entity);
return entity;
case ENDERMITE:
case GHAST:
case MAGMA_CUBE:
case SQUID:
case PIG_ZOMBIE:
case ZOMBIE:
case WITHER:
case WITCH:
case SPIDER:
case CAVE_SPIDER:
case SILVERFISH:
case GIANT:
case ENDERMAN:
case CREEPER:
case BLAZE:
case SNOWMAN:
case SHULKER:
case "ENDERMITE":
case "GHAST":
case "MAGMA_CUBE":
case "SQUID":
case "PIG_ZOMBIE":
case "HOGLIN":
case "PIGLIN":
case "ZOMBIFIED_PIGLIN":
case "PIGLIN_BRUTE":
case "ZOMBIE":
case "WITHER":
case "WITCH":
case "SPIDER":
case "CAVE_SPIDER":
case "SILVERFISH":
case "GIANT":
case "ENDERMAN":
case "CREEPER":
case "BLAZE":
case "SNOWMAN":
case "SHULKER":
case "GUARDIAN":
case "ELDER_GUARDIAN":
case "SKELETON":
case "WITHER_SKELETON":
restoreLiving((LivingEntity) entity);
return entity;
case IRON_GOLEM:
case "IRON_GOLEM":
if (this.dataByte != 0) {
((IronGolem) entity).setPlayerCreated(true);
}
restoreLiving((LivingEntity) entity);
return entity;
// END LIVING
default:
if (Settings.DEBUG) {
LOGGER.info("Could not identify entity: {}", entity.getType());
}
return entity;
// END LIVING
}
}
public void saveEntity() {
}
private byte getOrdinal(Object[] list, Object value) {
for (byte i = 0; i < list.length; i++) {
if (list[i].equals(value)) {
@ -729,9 +759,5 @@ public class EntityWrapper {
return 0;
}
@SuppressWarnings("deprecation")
@Override
public String toString() {
return String.format("[%s, x=%s, y=%s, z=%s]", type.getName(), x, y, z);
}
}

View File

@ -0,0 +1,28 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.entity;
import org.bukkit.entity.AnimalTamer;
class TameableStats {
AnimalTamer owner;
boolean tamed;
}

View File

@ -0,0 +1,116 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.entity;
import com.plotsquared.bukkit.BukkitPlatform;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.metadata.FixedMetadataValue;
public class TeleportEntityWrapper extends EntityWrapper {
private Location oldLocation;
private boolean gravityOld;
private boolean invulnerableOld;
private int fireTicksOld;
private int livingTicksOld;
public TeleportEntityWrapper(final Entity entity) {
super(entity);
}
@Override
public Entity spawn(final World world, final int xOffset, final int zOffset) {
if (!getEntity().getLocation().getChunk().equals(oldLocation.getChunk())) {
final Location oldLocation = this.oldLocation.clone();
oldLocation.add(xOffset, 0, xOffset);
getEntity().teleport(oldLocation);
getEntity().setGravity(gravityOld);
getEntity().setInvulnerable(invulnerableOld);
getEntity().setFireTicks(fireTicksOld);
getEntity().setTicksLived(livingTicksOld);
getEntity().removeMetadata("ps-tmp-teleport", BukkitPlatform.getPlugin(BukkitPlatform.class));
}
return getEntity();
}
@Override
public void saveEntity() {
if (getEntity().hasMetadata("ps-tmp-teleport")) {
this.oldLocation = (Location) this.getEntity().getMetadata("ps-tmp-teleport").get(0);
} else {
this.oldLocation = this.getEntity().getLocation();
}
// To account for offsets in the chunk manager
this.oldLocation = oldLocation.clone();
this.oldLocation.setX(this.getX());
this.oldLocation.setY(this.getY());
this.oldLocation.setZ(this.getZ());
this.gravityOld = this.getEntity().hasGravity();
this.getEntity().setGravity(false);
this.invulnerableOld = this.getEntity().isInvulnerable();
this.getEntity().setInvulnerable(true);
this.fireTicksOld = this.getEntity().getFireTicks();
this.livingTicksOld = this.getEntity().getTicksLived();
this.getEntity().setMetadata(
"ps-tmp-teleport",
new FixedMetadataValue(BukkitPlatform.getPlugin(BukkitPlatform.class), oldLocation)
);
final Chunk newChunk = getNewChunk();
this.getEntity().teleport(
new Location(newChunk.getWorld(), newChunk.getX() << 4, 5000, newChunk.getZ() << 4));
}
private Chunk getNewChunk() {
final Chunk oldChunk = oldLocation.getChunk();
Chunk chunk = null;
for (Chunk lChunk : oldChunk.getWorld().getLoadedChunks()) {
if (!lChunk.equals(oldChunk) && lChunk.isLoaded()) {
chunk = lChunk;
break;
}
}
if (chunk == null) {
for (int dx = 1; dx < Integer.MAX_VALUE; dx++) {
for (int dz = 0; dz < Integer.MAX_VALUE; dz++) {
if ((chunk = getChunkRelative(oldChunk, dx, dz)).isLoaded()) {
break;
} else if ((chunk = getChunkRelative(oldChunk, -dx, dz)).isLoaded()) {
break;
} else if ((chunk = getChunkRelative(oldChunk, dx, -dz)).isLoaded()) {
break;
} else if ((chunk = getChunkRelative(oldChunk, -dx, -dz)).isLoaded()) {
break;
}
}
}
}
return chunk;
}
private Chunk getChunkRelative(final Chunk chunk, final int dx, final int dz) {
return chunk.getWorld().getChunkAt(chunk.getX() + dx, chunk.getZ() + dz);
}
}

View File

@ -1,66 +0,0 @@
package com.plotsquared.bukkit.events;
import com.intellectualcrafters.plot.flag.Flag;
import com.intellectualcrafters.plot.object.PlotCluster;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
* Called when a flag is removed from a plot.
*/
public class ClusterFlagRemoveEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private final PlotCluster cluster;
private final Flag flag;
private boolean cancelled;
/**
* PlotFlagRemoveEvent: Called when a flag is removed from a plot.
*
* @param flag Flag that was removed
* @param cluster PlotCluster from which the flag was removed
*/
public ClusterFlagRemoveEvent(Flag flag, PlotCluster cluster) {
this.cluster = cluster;
this.flag = flag;
}
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Get the cluster involved.
*
* @return PlotCluster
*/
public PlotCluster getCluster() {
return this.cluster;
}
/**
* Get the flag involved.
*
* @return Flag
*/
public Flag getFlag() {
return this.flag;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
@Override
public boolean isCancelled() {
return this.cancelled;
}
@Override
public void setCancelled(boolean b) {
this.cancelled = b;
}
}

View File

@ -1,62 +0,0 @@
package com.plotsquared.bukkit.events;
import com.intellectualcrafters.plot.object.Plot;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
public class PlayerClaimPlotEvent extends PlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private final Plot plot;
private final boolean auto;
private boolean cancelled;
/**
* PlayerClaimPlotEvent: Called when a plot is claimed.
*
* @param player Player that claimed the plot
* @param plot Plot that was claimed
*/
public PlayerClaimPlotEvent(Player player, Plot plot, boolean auto) {
super(player);
this.plot = plot;
this.auto = auto;
}
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Get the plot involved
*
* @return Plot
*/
public Plot getPlot() {
return this.plot;
}
/**
* @return true if it was an automated claim, else false
*/
public boolean wasAuto() {
return this.auto;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
@Override
public boolean isCancelled() {
return this.cancelled;
}
@Override
public void setCancelled(boolean b) {
this.cancelled = b;
}
}

View File

@ -1,41 +0,0 @@
package com.plotsquared.bukkit.events;
import com.intellectualcrafters.plot.object.Plot;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
public class PlayerEnterPlotEvent extends PlayerEvent {
private static final HandlerList handlers = new HandlerList();
private final Plot plot;
/**
* Called when a player leaves a plot.
*
* @param player Player that entered the plot
* @param plot Plot that was entered
*/
public PlayerEnterPlotEvent(Player player, Plot plot) {
super(player);
this.plot = plot;
}
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Get the plot involved.
*
* @return Plot
*/
public Plot getPlot() {
return this.plot;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
}

View File

@ -1,45 +0,0 @@
package com.plotsquared.bukkit.events;
import com.intellectualcrafters.plot.object.Plot;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
/**
*/
public class PlayerLeavePlotEvent extends PlayerEvent {
private static final HandlerList handlers = new HandlerList();
private final Plot plot;
/**
* PlayerLeavePlotEvent: Called when a player leaves a plot
*
* @param player Player that left the plot
* @param plot Plot that was left
*/
public PlayerLeavePlotEvent(Player player, Plot plot) {
super(player);
this.plot = plot;
}
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Get the plot involved
*
* @return Plot
*/
public Plot getPlot() {
return this.plot;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
}

View File

@ -1,66 +0,0 @@
package com.plotsquared.bukkit.events;
import com.intellectualcrafters.plot.object.Plot;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import java.util.UUID;
public class PlayerPlotDeniedEvent extends PlotEvent {
private static final HandlerList handlers = new HandlerList();
private final Player initiator;
private final boolean added;
private final UUID player;
/**
* PlayerPlotDeniedEvent: Called when the denied UUID list is modified for a plot.
*
* @param initiator Player that initiated the event
* @param plot Plot in which the event occurred
* @param player Player that was denied/un-denied
* @param added true of add to deny list, false if removed
*/
public PlayerPlotDeniedEvent(Player initiator, Plot plot, UUID player, boolean added) {
super(plot);
this.initiator = initiator;
this.added = added;
this.player = player;
}
public static HandlerList getHandlerList() {
return handlers;
}
/**
* If a user was added.
*
* @return boolean
*/
public boolean wasAdded() {
return this.added;
}
/**
* The player added/removed.
*
* @return UUID
*/
public UUID getPlayer() {
return this.player;
}
/**
* The player initiating the action.
*
* @return Player
*/
public Player getInitiator() {
return this.initiator;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
}

View File

@ -1,70 +0,0 @@
package com.plotsquared.bukkit.events;
import com.intellectualcrafters.plot.object.Plot;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import java.util.UUID;
/**
*/
public class PlayerPlotHelperEvent extends PlotEvent {
private static final HandlerList handlers = new HandlerList();
private final Player initiator;
private final boolean added;
private final UUID player;
/**
* PlayerPlotHelperEvent: Called when a plot helper is added/removed
*
* @param initiator Player that initiated the event
* @param plot Plot in which the event occurred
* @param player Player that was added/removed from the helper list
* @param added true of the player was added, false if the player was removed
*/
public PlayerPlotHelperEvent(Player initiator, Plot plot, UUID player, boolean added) {
super(plot);
this.initiator = initiator;
this.added = added;
this.player = player;
}
public static HandlerList getHandlerList() {
return handlers;
}
/**
* If a player was added
*
* @return boolean
*/
public boolean wasAdded() {
return this.added;
}
/**
* The UUID added/removed
*
* @return UUID
*/
public UUID getPlayer() {
return this.player;
}
/**
* The player initiating the action
*
* @return Player
*/
public Player getInitiator() {
return this.initiator;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
}

View File

@ -1,70 +0,0 @@
package com.plotsquared.bukkit.events;
import com.intellectualcrafters.plot.object.Plot;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import java.util.UUID;
/**
*/
public class PlayerPlotTrustedEvent extends PlotEvent {
private static final HandlerList handlers = new HandlerList();
private final Player initiator;
private final boolean added;
private final UUID player;
/**
* PlayerPlotTrustedEvent: Called when a plot trusted user is added/removed
*
* @param initiator Player that initiated the event
* @param plot Plot in which the event occurred
* @param player Player that was added/removed from the trusted list
* @param added true of the player was added, false if the player was removed
*/
public PlayerPlotTrustedEvent(Player initiator, Plot plot, UUID player, boolean added) {
super(plot);
this.initiator = initiator;
this.added = added;
this.player = player;
}
public static HandlerList getHandlerList() {
return handlers;
}
/**
* If a player was added
*
* @return boolean
*/
public boolean wasAdded() {
return this.added;
}
/**
* The UUID added/removed
*
* @return UUID
*/
public UUID getPlayer() {
return this.player;
}
/**
* The player initiating the action
*
* @return Player
*/
public Player getInitiator() {
return this.initiator;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
}

View File

@ -1,72 +0,0 @@
package com.plotsquared.bukkit.events;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
/**
* Called when a player teleports to a plot
*
*/
public class PlayerTeleportToPlotEvent extends PlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private final Location from;
private final Plot plot;
private boolean cancelled;
/**
* PlayerTeleportToPlotEvent: Called when a player teleports to a plot
*
* @param player That was teleported
* @param from Start location
* @param plot Plot to which the player was teleported
*/
public PlayerTeleportToPlotEvent(Player player, Location from, Plot plot) {
super(player);
this.from = from;
this.plot = plot;
}
public static HandlerList getHandlerList() {
return handlers;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
/**
* Get the from location
*
* @return Location
*/
public Location getFrom() {
return this.from;
}
/**
* Get the plot involved
*
* @return Plot
*/
public Plot getPlot() {
return this.plot;
}
@Override
public boolean isCancelled() {
return this.cancelled;
}
@Override
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
}

View File

@ -1,56 +0,0 @@
package com.plotsquared.bukkit.events;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotId;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* Called when a plot is cleared
*
*/
public class PlotClearEvent extends PlotEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
public PlotClearEvent(Plot plot) {
super(plot);
}
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Get the PlotId.
*
* @return PlotId
*/
public PlotId getPlotId() {
return getPlot().getId();
}
/**
* Get the world name.
*
* @return String
*/
public String getWorld() {
return getPlot().getArea().worldname;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
@Override
public boolean isCancelled() {
return this.cancelled;
}
@Override
public void setCancelled(boolean b) {
this.cancelled = b;
}
}

View File

@ -1,56 +0,0 @@
package com.plotsquared.bukkit.events;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotId;
import org.bukkit.event.HandlerList;
/**
* Called when a plot component is set
*
*/
public class PlotComponentSetEvent extends PlotEvent {
private static final HandlerList handlers = new HandlerList();
private final String component;
public PlotComponentSetEvent(Plot plot, String component) {
super(plot);
this.component = component;
}
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Get the PlotId
*
* @return PlotId
*/
public PlotId getPlotId() {
return getPlot().getId();
}
/**
* Get the world name
*
* @return String
*/
public String getWorld() {
return getPlot().getArea().worldname;
}
/**
* Get the component which was set
*
* @return Component name
*/
public String getComponent() {
return this.component;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
}

View File

@ -1,45 +0,0 @@
package com.plotsquared.bukkit.events;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotId;
import org.bukkit.event.HandlerList;
/**
* Called when a plot is deleted
*
*/
public class PlotDeleteEvent extends PlotEvent {
private static final HandlerList handlers = new HandlerList();
public PlotDeleteEvent(Plot plot) {
super(plot);
}
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Get the PlotId
*
* @return PlotId
*/
public PlotId getPlotId() {
return getPlot().getId();
}
/**
* Get the world name
*
* @return String
*/
public String getWorld() {
return getPlot().getArea().worldname;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
}

View File

@ -1,18 +0,0 @@
package com.plotsquared.bukkit.events;
import com.intellectualcrafters.plot.object.Plot;
import org.bukkit.event.Event;
public abstract class PlotEvent extends Event {
private final Plot plot;
public PlotEvent(Plot plot) {
this.plot = plot;
}
public final Plot getPlot() {
return this.plot;
}
}

View File

@ -1,56 +0,0 @@
package com.plotsquared.bukkit.events;
import com.intellectualcrafters.plot.flag.Flag;
import com.intellectualcrafters.plot.object.Plot;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* Called when a Flag is added to a plot.
*
*/
public class PlotFlagAddEvent extends PlotEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private final Flag flag;
private boolean cancelled;
/**
* PlotFlagAddEvent: Called when a Flag is added to a plot.
*
* @param flag Flag that was added
* @param plot Plot to which the flag was added
*/
public PlotFlagAddEvent(Flag flag, Plot plot) {
super(plot);
this.flag = flag;
}
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Get the flag involved.
*
* @return Flag
*/
public Flag getFlag() {
return this.flag;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
@Override
public final boolean isCancelled() {
return this.cancelled;
}
@Override
public final void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
}

View File

@ -1,56 +0,0 @@
package com.plotsquared.bukkit.events;
import com.intellectualcrafters.plot.flag.Flag;
import com.intellectualcrafters.plot.object.Plot;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* Called when a flag is removed from a plot
*
*/
public class PlotFlagRemoveEvent extends PlotEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private final Flag flag;
private boolean cancelled;
/**
* PlotFlagRemoveEvent: Called when a flag is removed from a plot
*
* @param flag Flag that was removed
* @param plot Plot from which the flag was removed
*/
public PlotFlagRemoveEvent(Flag flag, Plot plot) {
super(plot);
this.flag = flag;
}
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Get the flag involved
*
* @return Flag
*/
public Flag getFlag() {
return this.flag;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
@Override
public final boolean isCancelled() {
return this.cancelled;
}
@Override
public final void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
}

View File

@ -1,62 +0,0 @@
package com.plotsquared.bukkit.events;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotId;
import org.bukkit.World;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import java.util.ArrayList;
public class PlotMergeEvent extends PlotEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private final ArrayList<PlotId> plots;
private final World world;
private boolean cancelled;
/**
* PlotMergeEvent: Called when plots are merged
*
* @param world World in which the event occurred
* @param plot Plot that was merged
* @param plots A list of plots involved in the event
*/
public PlotMergeEvent(World world, Plot plot, ArrayList<PlotId> plots) {
super(plot);
this.world = world;
this.plots = plots;
}
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Get the plots being added.
*
* @return Plot
*/
public ArrayList<PlotId> getPlots() {
return this.plots;
}
public World getWorld() {
return this.world;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
@Override
public boolean isCancelled() {
return this.cancelled;
}
@Override
public void setCancelled(boolean b) {
this.cancelled = b;
}
}

View File

@ -1,41 +0,0 @@
package com.plotsquared.bukkit.events;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.Rating;
import org.bukkit.event.HandlerList;
public class PlotRateEvent extends PlotEvent {
private static final HandlerList handlers = new HandlerList();
private final PlotPlayer rater;
private Rating rating;
public PlotRateEvent(PlotPlayer rater, Rating rating, Plot plot) {
super(plot);
this.rater = rater;
this.rating = rating;
}
public static HandlerList getHandlerList() {
return handlers;
}
public PlotPlayer getRater() {
return this.rater;
}
public Rating getRating() {
return this.rating;
}
public void setRating(Rating rating) {
this.rating = rating;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
}

View File

@ -1,67 +0,0 @@
package com.plotsquared.bukkit.events;
import com.intellectualcrafters.plot.object.PlotArea;
import com.intellectualcrafters.plot.object.PlotId;
import org.bukkit.World;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import java.util.ArrayList;
public class PlotUnlinkEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private final ArrayList<PlotId> plots;
private final World world;
private final PlotArea area;
private boolean cancelled;
/**
* Called when a mega-plot is unlinked.
*
* @param world World in which the event occurred
* @param plots Plots that are involved in the event
*/
public PlotUnlinkEvent(World world, PlotArea area, ArrayList<PlotId> plots) {
this.plots = plots;
this.world = world;
this.area = area;
}
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Get the plots involved.
*
* @return The {@link PlotId}'s of the plots involved
*/
public ArrayList<PlotId> getPlots() {
return this.plots;
}
public World getWorld() {
return this.world;
}
public PlotArea getArea() {
return this.area;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
@Override
public boolean isCancelled() {
return this.cancelled;
}
@Override
public void setCancelled(boolean b) {
this.cancelled = b;
}
}

View File

@ -0,0 +1,87 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.generator;
import com.plotsquared.bukkit.queue.LimitedRegionWrapperQueue;
import com.plotsquared.core.generator.HybridPlotWorld;
import com.plotsquared.core.generator.IndependentPlotGenerator;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.location.UncheckedWorldLocation;
import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.plot.world.SinglePlotArea;
import com.plotsquared.core.queue.ScopedQueueCoordinator;
import org.bukkit.generator.BlockPopulator;
import org.bukkit.generator.LimitedRegion;
import org.bukkit.generator.WorldInfo;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.Random;
final class BlockStatePopulator extends BlockPopulator {
private final IndependentPlotGenerator plotGenerator;
/**
* @since 6.9.0
*/
public BlockStatePopulator(
final @NonNull IndependentPlotGenerator plotGenerator
) {
this.plotGenerator = plotGenerator;
}
/**
* @deprecated Use {@link BlockStatePopulator#BlockStatePopulator(IndependentPlotGenerator)} as plotAreManager is unused
*/
@Deprecated(forRemoval = true, since = "6.9.0")
public BlockStatePopulator(
final @NonNull IndependentPlotGenerator plotGenerator,
final @NonNull PlotAreaManager plotAreaManager
) {
this.plotGenerator = plotGenerator;
}
@Override
public void populate(
@NonNull final WorldInfo worldInfo,
@NonNull final Random random,
final int chunkX,
final int chunkZ,
@NonNull final LimitedRegion limitedRegion
) {
PlotArea area = UncheckedWorldLocation.at(worldInfo.getName(), chunkX << 4, 0, chunkZ << 4).getPlotArea();
if (area == null || (area instanceof HybridPlotWorld hpw && !hpw.populationNeeded()) || area instanceof SinglePlotArea) {
return;
}
LimitedRegionWrapperQueue wrapped = new LimitedRegionWrapperQueue(limitedRegion);
// It is possible for the region to be larger than the chunk, but there is no reason for P2 to need to populate
// outside of the actual chunk area.
Location min = UncheckedWorldLocation.at(worldInfo.getName(), chunkX << 4, worldInfo.getMinHeight(), chunkZ << 4);
Location max = UncheckedWorldLocation.at(
worldInfo.getName(),
(chunkX << 4) + 15,
worldInfo.getMaxHeight(),
(chunkZ << 4) + 15
);
ScopedQueueCoordinator offsetChunkQueue = new ScopedQueueCoordinator(wrapped, min, max);
this.plotGenerator.populateChunk(offsetChunkQueue, area);
}
}

View File

@ -1,14 +1,37 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.generator;
import com.intellectualcrafters.plot.generator.AugmentedUtils;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.generator.AugmentedUtils;
import com.plotsquared.core.queue.QueueCoordinator;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.util.SideEffectSet;
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.generator.BlockPopulator;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.Random;
public class BukkitAugmentedGenerator extends BlockPopulator {
private static BukkitAugmentedGenerator generator;
public static BukkitAugmentedGenerator get(World world) {
@ -25,7 +48,15 @@ public class BukkitAugmentedGenerator extends BlockPopulator {
}
@Override
public void populate(World world, Random r, Chunk chunk) {
AugmentedUtils.generate(world.getName(), chunk.getX(), chunk.getZ(), null);
public void populate(@NonNull World world, @NonNull Random random, @NonNull Chunk source) {
QueueCoordinator queue = PlotSquared.platform().globalBlockQueue().getNewQueue(BukkitAdapter.adapt(world));
// The chunk is already loaded and we do not want to load the chunk in "fully" by using any PaperLib methods.
queue.setForceSync(true);
queue.setSideEffectSet(SideEffectSet.none());
queue.setBiomesEnabled(false);
queue.setChunkObject(source);
AugmentedUtils.generateChunk(world.getName(), source.getX(), source.getZ(), queue);
queue.enqueue();
}
}

View File

@ -1,243 +1,115 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.generator;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.generator.GeneratorWrapper;
import com.intellectualcrafters.plot.generator.IndependentPlotGenerator;
import com.intellectualcrafters.plot.object.ChunkLoc;
import com.intellectualcrafters.plot.object.ChunkWrapper;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.PlotArea;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.PlotManager;
import com.intellectualcrafters.plot.object.PseudoRandom;
import com.intellectualcrafters.plot.object.SetupObject;
import com.intellectualcrafters.plot.util.ChunkManager;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.MathMan;
import com.intellectualcrafters.plot.util.block.GlobalBlockQueue;
import com.intellectualcrafters.plot.util.block.LocalBlockQueue;
import com.intellectualcrafters.plot.util.block.ScopedLocalBlockQueue;
import com.plotsquared.bukkit.queue.GenChunk;
import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.bukkit.util.block.GenChunk;
import org.bukkit.Chunk;
import com.plotsquared.bukkit.util.BukkitWorld;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.generator.GeneratorWrapper;
import com.plotsquared.core.generator.IndependentPlotGenerator;
import com.plotsquared.core.generator.SingleWorldGenerator;
import com.plotsquared.core.location.ChunkWrapper;
import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.queue.ScopedQueueCoordinator;
import com.plotsquared.core.util.ChunkManager;
import com.sk89q.worldedit.math.BlockVector2;
import org.bukkit.World;
import org.bukkit.block.Biome;
import org.bukkit.generator.BlockPopulator;
import org.bukkit.generator.ChunkGenerator;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
import java.util.Set;
public class BukkitPlotGenerator extends ChunkGenerator implements GeneratorWrapper<ChunkGenerator> {
private final GenChunk chunkSetter;
private final PseudoRandom random = new PseudoRandom();
@SuppressWarnings("unused")
public final boolean PAPER_ASYNC_SAFE = true;
private final PlotAreaManager plotAreaManager;
private final IndependentPlotGenerator plotGenerator;
private List<BlockPopulator> populators;
private final ChunkGenerator platformGenerator;
private final boolean full;
private final HashMap<ChunkLoc, byte[][]> dataMap = new HashMap<>();
private final String levelName;
private List<BlockPopulator> populators;
private boolean loaded = false;
public BukkitPlotGenerator(IndependentPlotGenerator generator) {
if (generator == null) {
throw new IllegalArgumentException("Generator may not be null!");
}
public BukkitPlotGenerator(
final @NonNull String name,
final @NonNull IndependentPlotGenerator generator,
final @NonNull PlotAreaManager plotAreaManager
) {
this.plotAreaManager = plotAreaManager;
this.levelName = name;
this.plotGenerator = generator;
this.platformGenerator = this;
populators = new ArrayList<>();
this.populators.add(new BlockPopulator() {
private LocalBlockQueue queue;
@Override
public void populate(World world, Random r, Chunk c) {
if (queue == null) {
queue = GlobalBlockQueue.IMP.getNewQueue(world.getName(), false);
}
ChunkLoc loc = new ChunkLoc(c.getX(), c.getZ());
byte[][] resultData;
if (!BukkitPlotGenerator.this.dataMap.containsKey(loc)) {
GenChunk result = BukkitPlotGenerator.this.chunkSetter;
// Set the chunk location
result.setChunk(c);
// Set the result data
result.result = new short[16][];
result.result_data = new byte[16][];
result.grid = null;
result.cd = null;
// Catch any exceptions (as exceptions usually thrown)
generate(world, loc.x, loc.z, result);
resultData = result.result_data;
} else {
resultData = BukkitPlotGenerator.this.dataMap.remove(loc);
}
if (resultData != null) {
for (int i = 0; i < resultData.length; i++) {
byte[] section = resultData[i];
if (section == null) {
continue;
}
for (int j = 0; j < section.length; j++) {
int x = MainUtil.x_loc[i][j];
int y = MainUtil.y_loc[i][j];
int z = MainUtil.z_loc[i][j];
c.getBlock(x, y, z).setData(section[j]);
}
}
}
BukkitPlotGenerator.this.random.state = c.getX() << 16 | c.getZ() & 0xFFFF;
PlotArea area = PS.get().getPlotArea(world.getName(), null);
ChunkWrapper wrap = new ChunkWrapper(area.worldname, c.getX(), c.getZ());
ScopedLocalBlockQueue chunk = queue.getForChunk(wrap.x, wrap.z);
if (BukkitPlotGenerator.this.plotGenerator.populateChunk(chunk, area, BukkitPlotGenerator.this.random)) {
queue.flush();
}
}
});
this.chunkSetter = new GenChunk(null, null);
this.full = true;
MainUtil.initCache();
}
public BukkitPlotGenerator(final String world, final ChunkGenerator cg) {
if (cg instanceof BukkitPlotGenerator) {
throw new IllegalArgumentException("ChunkGenerator: " + cg.getClass().getName() + " is already a BukkitPlotGenerator!");
this.populators = new ArrayList<>();
int minecraftMinorVersion = PlotSquared.platform().serverVersion()[1];
if (minecraftMinorVersion >= 17) {
this.populators.add(new BlockStatePopulator(this.plotGenerator));
} else {
this.populators.add(new LegacyBlockStatePopulator(this.plotGenerator));
}
this.full = false;
PS.debug("BukkitPlotGenerator does not fully support: " + cg);
this.platformGenerator = cg;
this.plotGenerator = new IndependentPlotGenerator() {
@Override
public void processSetup(SetupObject setup) {}
@Override
public void initialize(PlotArea area) {}
@Override
public PlotManager getNewPlotManager() {
return PS.get().IMP.getDefaultGenerator().getNewPlotManager();
}
@Override
public String getName() {
return cg.getClass().getName();
}
@Override
public PlotArea getNewPlotArea(String world, String id, PlotId min, PlotId max) {
return PS.get().IMP.getDefaultGenerator().getNewPlotArea(world, id, min, max);
}
@Override
public void generateChunk(final ScopedLocalBlockQueue result, PlotArea settings, PseudoRandom random) {
World w = BukkitUtil.getWorld(world);
Location min = result.getMin();
int cx = min.getX() >> 4;
int cz = min.getZ() >> 4;
Random r = new Random(MathMan.pair((short) cx, (short) cz));
BiomeGrid grid = new BiomeGrid() {
@Override
public void setBiome(int x, int z, Biome biome) {
result.setBiome(x, z, biome.name());
}
@Override
public Biome getBiome(int arg0, int arg1) {
return Biome.FOREST;
}
};
try {
// ChunkData will spill a bit
ChunkData data = cg.generateChunkData(w, r, cx, cz, grid);
if (data != null) {
return;
}
} catch (Throwable ignored) {}
// Populator spillage
short[][] tmp = cg.generateExtBlockSections(w, r, cx, cz, grid);
if (tmp != null) {
for (int i = 0; i < tmp.length; i++) {
short[] section = tmp[i];
if (section == null) {
if (i < 7) {
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
for (int y = i << 4; y < (i << 4) + 16; y++) {
result.setBlock(x, y, z, (short) 0, (byte) 0);
}
}
}
}
continue;
}
for (int j = 0; j < section.length; j++) {
int x = MainUtil.x_loc[i][j];
int y = MainUtil.y_loc[i][j];
int z = MainUtil.z_loc[i][j];
result.setBlock(x, y, z, section[j], (byte) 0);
}
}
}
for (BlockPopulator populator : cg.getDefaultPopulators(w)) {
populator.populate(w, r, w.getChunkAt(cx, cz));
}
}
};
this.chunkSetter = new GenChunk(null, new ChunkWrapper(world, 0, 0));
MainUtil.initCache();
this.full = true;
}
public BukkitPlotGenerator(final String world, final ChunkGenerator cg, final @NonNull PlotAreaManager plotAreaManager) {
if (cg instanceof BukkitPlotGenerator) {
throw new IllegalArgumentException("ChunkGenerator: " + cg.getClass().getName()
+ " is already a BukkitPlotGenerator!");
}
this.plotAreaManager = plotAreaManager;
this.levelName = world;
this.full = false;
this.platformGenerator = cg;
this.plotGenerator = new DelegatePlotGenerator(cg, world);
}
@Override
public void augment(PlotArea area) {
BukkitAugmentedGenerator.get(BukkitUtil.getWorld(area.worldname));
BukkitAugmentedGenerator.get(BukkitUtil.getWorld(area.getWorldName()));
}
@Override
public boolean isFull() {
return this.full;
}
@Override
public IndependentPlotGenerator getPlotGenerator() {
return this.plotGenerator;
}
@Override
public ChunkGenerator getPlatformGenerator() {
return this.platformGenerator;
}
@Override
public List<BlockPopulator> getDefaultPopulators(World world) {
public @NonNull List<BlockPopulator> getDefaultPopulators(@NonNull World world) {
try {
if (!this.loaded) {
String name = world.getName();
PS.get().loadWorld(name, this);
Set<PlotArea> areas = PS.get().getPlotAreas(name);
if (!areas.isEmpty()) {
PlotArea area = areas.iterator().next();
if (!area.MOB_SPAWNING) {
if (!area.SPAWN_EGGS) {
world.setSpawnFlags(false, false);
}
world.setAmbientSpawnLimit(0);
world.setAnimalSpawnLimit(0);
world.setMonsterSpawnLimit(0);
world.setWaterAnimalSpawnLimit(0);
} else {
world.setSpawnFlags(true, true);
world.setAmbientSpawnLimit(-1);
world.setAnimalSpawnLimit(-1);
world.setMonsterSpawnLimit(-1);
world.setWaterAnimalSpawnLimit(-1);
}
}
this.loaded = true;
}
checkLoaded(world);
} catch (Exception e) {
e.printStackTrace();
}
@ -246,101 +118,147 @@ public class BukkitPlotGenerator extends ChunkGenerator implements GeneratorWrap
if (populators == null && platformGenerator != null) {
populators = new ArrayList<>(platformGenerator.getDefaultPopulators(world));
}
for (BlockPopulator populator : this.populators) {
if (!existing.contains(populator)) {
toAdd.add(populator);
if (populators != null) {
for (BlockPopulator populator : this.populators) {
if (!existing.contains(populator)) {
toAdd.add(populator);
}
}
}
return toAdd;
}
private synchronized void checkLoaded(@NonNull World world) {
// Do not attempt to load configurations until WorldEdit has a platform ready.
if (!PlotSquared.get().isWeInitialised()) {
return;
}
if (!this.loaded) {
String name = world.getName();
PlotSquared.get().loadWorld(name, this);
final Set<PlotArea> areas = this.plotAreaManager.getPlotAreasSet(name);
if (!areas.isEmpty()) {
PlotArea area = areas.iterator().next();
if (!area.isMobSpawning()) {
if (!area.isSpawnEggs()) {
world.setSpawnFlags(false, false);
}
setSpawnLimits(world, 0);
} else {
world.setSpawnFlags(true, true);
setSpawnLimits(world, -1);
}
}
this.loaded = true;
}
}
@SuppressWarnings("deprecation")
private void setSpawnLimits(@NonNull World world, int limit) {
world.setAmbientSpawnLimit(limit);
world.setAnimalSpawnLimit(limit);
world.setMonsterSpawnLimit(limit);
world.setWaterAnimalSpawnLimit(limit);
}
/**
* The entire method is deprecated, but kept for compatibility with versions lower than or equal to 1.16.2.
* The method will be removed in future versions, because WorldEdit and FastAsyncWorldEdit only support the latest point
* release.
*/
@Deprecated(forRemoval = true, since = "6.11.0")
@Override
public ChunkData generateChunkData(World world, Random random, int cx, int cz, BiomeGrid grid) {
GenChunk result = this.chunkSetter;
public @NonNull ChunkData generateChunkData(
@NonNull World world, @NonNull Random random, int x, int z,
@NonNull BiomeGrid biome
) {
int minY = BukkitWorld.getMinWorldHeight(world);
int maxY = BukkitWorld.getMaxWorldHeight(world);
GenChunk result = new GenChunk(minY, maxY);
if (this.getPlotGenerator() instanceof SingleWorldGenerator) {
if (result.getChunkData() != null) {
for (int chunkX = 0; chunkX < 16; chunkX++) {
for (int chunkZ = 0; chunkZ < 16; chunkZ++) {
for (int y = minY; y < maxY; y++) {
biome.setBiome(chunkX, y, chunkZ, Biome.PLAINS);
}
}
}
return result.getChunkData();
}
}
// Set the chunk location
result.setChunk(new ChunkWrapper(world.getName(), cx, cz));
result.setChunk(new ChunkWrapper(world.getName(), x, z));
// Set the result data
result.cd = createChunkData(world);
result.grid = grid;
result.setChunkData(createChunkData(world));
result.biomeGrid = biome;
result.result = null;
result.result_data = null;
// Catch any exceptions (as exceptions usually thrown)
try {
// Fill the result data if necessary
if (this.platformGenerator != this) {
return this.platformGenerator.generateChunkData(world, random, cx, cz, grid);
return this.platformGenerator.generateChunkData(world, random, x, z, biome);
} else {
generate(world, cx, cz, result);
generate(BlockVector2.at(x, z), world, result);
}
} catch (Throwable e) {
e.printStackTrace();
}
// Return the result data
return result.cd;
return result.getChunkData();
}
public void generate(World world, int cx, int cz, ScopedLocalBlockQueue result) {
private void generate(BlockVector2 loc, World world, ScopedQueueCoordinator result) {
// Load if improperly loaded
if (!this.loaded) {
String name = world.getName();
PS.get().loadWorld(name, this);
this.loaded = true;
checkLoaded(world);
}
// Set random seed
this.random.state = cx << 16 | cz & 0xFFFF;
// Process the chunk
if (ChunkManager.preProcessChunk(result)) {
if (ChunkManager.preProcessChunk(loc, result)) {
return;
}
PlotArea area = PS.get().getPlotArea(world.getName(), null);
PlotArea area = this.plotAreaManager.getPlotArea(world.getName(), null);
if (area == null && (area = this.plotAreaManager.getPlotArea(this.levelName, null)) == null) {
throw new IllegalStateException(
"Cannot regenerate chunk that does not belong to a plot area." + " Location: " + loc
+ ", world: " + world);
}
try {
this.plotGenerator.generateChunk(this.chunkSetter, area, this.random);
this.plotGenerator.generateChunk(result, area);
} catch (Throwable e) {
// Recover from generator error
e.printStackTrace();
}
ChunkManager.postProcessChunk(result);
ChunkManager.postProcessChunk(loc, result);
}
@Override
public short[][] generateExtBlockSections(World world, Random r, int cx, int cz, BiomeGrid grid) {
GenChunk result = this.chunkSetter;
// Set the chunk location
result.setChunk(new ChunkWrapper(world.getName(), cx, cz));
// Set the result data
result.result = new short[16][];
result.result_data = new byte[16][];
result.grid = grid;
result.cd = null;
// Catch any exceptions (as exceptions usually thrown)
try {
// Fill the result data
if (this.platformGenerator != this) {
return this.platformGenerator.generateExtBlockSections(world, r, cx, cz, grid);
} else {
generate(world, cx, cz, result);
this.dataMap.put(new ChunkLoc(cx, cz), result.result_data);
}
} catch (Throwable e) {
e.printStackTrace();
}
// Return the result data
return result.result;
}
/**
* Allow spawning everywhere.
* @param world Ignored
* @param x Ignored
* @param z Ignored
* @return always true
*/
@Override
public boolean canSpawn(World world, int x, int z) {
public boolean canSpawn(final @NonNull World world, final int x, final int z) {
return true;
}
public boolean shouldGenerateCaves() {
return false;
}
public boolean shouldGenerateDecorations() {
return false;
}
public boolean isParallelCapable() {
return true;
}
public boolean shouldGenerateMobs() {
return false;
}
public boolean shouldGenerateStructures() {
return true;
}
@Override
public String toString() {
if (this.platformGenerator == this) {
@ -352,12 +270,17 @@ public class BukkitPlotGenerator extends ChunkGenerator implements GeneratorWrap
return this.platformGenerator.getClass().getName();
}
}
@Override
public boolean equals(Object obj) {
public boolean equals(final Object obj) {
if (obj == null) {
return false;
}
return toString().equals(obj.toString()) || toString().equals(obj.getClass().getName());
}
public String getLevelName() {
return this.levelName;
}
}

View File

@ -0,0 +1,102 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.generator;
import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.generator.IndependentPlotGenerator;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.PlotId;
import com.plotsquared.core.queue.ScopedQueueCoordinator;
import com.plotsquared.core.util.MathMan;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import org.bukkit.World;
import org.bukkit.block.Biome;
import org.bukkit.generator.BlockPopulator;
import org.bukkit.generator.ChunkGenerator;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.Random;
final class DelegatePlotGenerator extends IndependentPlotGenerator {
private final ChunkGenerator chunkGenerator;
private final String world;
public DelegatePlotGenerator(ChunkGenerator chunkGenerator, String world) {
this.chunkGenerator = chunkGenerator;
this.world = world;
}
@Override
public void initialize(PlotArea area) {
}
@Override
public String getName() {
return this.chunkGenerator.getClass().getName();
}
@Override
public PlotArea getNewPlotArea(String world, String id, PlotId min, PlotId max) {
return PlotSquared.platform().defaultGenerator().getNewPlotArea(world, id, min, max);
}
@Override
public void generateChunk(final ScopedQueueCoordinator result, PlotArea settings) {
World world = BukkitUtil.getWorld(this.world);
Location min = result.getMin();
int chunkX = min.getX() >> 4;
int chunkZ = min.getZ() >> 4;
Random random = new Random(MathMan.pair((short) chunkX, (short) chunkZ));
try {
ChunkGenerator.BiomeGrid grid = new ChunkGenerator.BiomeGrid() {
@Override
public void setBiome(int x, int z, @NonNull Biome biome) {
result.setBiome(x, z, BukkitAdapter.adapt(biome));
}
//do not annotate with Override until we discontinue support for 1.4.4 (we no longer support 1.4.4)
@Override
public void setBiome(int x, int y, int z, @NonNull Biome biome) {
result.setBiome(x, z, BukkitAdapter.adapt(biome));
}
@Override
public @NonNull Biome getBiome(int x, int z) {
return Biome.FOREST;
}
@Override
public @NonNull Biome getBiome(int x, int y, int z) {
return Biome.FOREST;
}
};
chunkGenerator.generateChunkData(world, random, chunkX, chunkZ, grid);
return;
} catch (Throwable ignored) {
}
for (BlockPopulator populator : chunkGenerator.getDefaultPopulators(world)) {
populator.populate(world, random, world.getChunkAt(chunkX, chunkZ));
}
}
}

View File

@ -0,0 +1,73 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.generator;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.generator.HybridPlotWorld;
import com.plotsquared.core.generator.IndependentPlotGenerator;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.location.UncheckedWorldLocation;
import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.world.SinglePlotArea;
import com.plotsquared.core.queue.QueueCoordinator;
import com.plotsquared.core.queue.ScopedQueueCoordinator;
import com.sk89q.worldedit.bukkit.BukkitWorld;
import com.sk89q.worldedit.util.SideEffectSet;
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.generator.BlockPopulator;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.Random;
final class LegacyBlockStatePopulator extends BlockPopulator {
private final IndependentPlotGenerator plotGenerator;
/**
* @since 6.9.0
*/
public LegacyBlockStatePopulator(
final @NonNull IndependentPlotGenerator plotGenerator
) {
this.plotGenerator = plotGenerator;
}
@Override
public void populate(@NonNull final World world, @NonNull final Random random, @NonNull final Chunk source) {
int chunkMinX = source.getX() << 4;
int chunkMinZ = source.getZ() << 4;
PlotArea area = Location.at(world.getName(), chunkMinX, 0, chunkMinZ).getPlotArea();
if (area == null || (area instanceof HybridPlotWorld hpw && !hpw.populationNeeded()) || area instanceof SinglePlotArea) {
return;
}
QueueCoordinator queue = PlotSquared.platform().globalBlockQueue().getNewQueue(new BukkitWorld(world));
queue.setForceSync(true);
queue.setSideEffectSet(SideEffectSet.none());
queue.setBiomesEnabled(false);
queue.setChunkObject(source);
Location min = UncheckedWorldLocation.at(world.getName(), chunkMinX, world.getMinHeight(), chunkMinZ);
Location max = UncheckedWorldLocation.at(world.getName(), chunkMinX + 15, world.getMaxHeight(), chunkMinZ + 15);
ScopedQueueCoordinator offsetChunkQueue = new ScopedQueueCoordinator(queue, min, max);
this.plotGenerator.populateChunk(offsetChunkQueue, area);
queue.enqueue();
}
}

View File

@ -0,0 +1,49 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.inject;
import com.google.inject.AbstractModule;
import com.google.inject.assistedinject.FactoryModuleBuilder;
import com.plotsquared.core.backup.BackupManager;
import com.plotsquared.core.backup.BackupProfile;
import com.plotsquared.core.backup.NullBackupManager;
import com.plotsquared.core.backup.PlayerBackupProfile;
import com.plotsquared.core.backup.SimpleBackupManager;
import com.plotsquared.core.inject.factory.PlayerBackupProfileFactory;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class BackupModule extends AbstractModule {
private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + BackupModule.class.getSimpleName());
@Override
protected void configure() {
try {
install(new FactoryModuleBuilder()
.implement(BackupProfile.class, PlayerBackupProfile.class).build(PlayerBackupProfileFactory.class));
bind(BackupManager.class).to(SimpleBackupManager.class);
} catch (final Exception e) {
LOGGER.error("Failed to initialize backup manager", e);
LOGGER.error("Backup features will be disabled");
bind(BackupManager.class).to(NullBackupManager.class);
}
}
}

View File

@ -0,0 +1,148 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.inject;
import com.google.inject.AbstractModule;
import com.google.inject.Provides;
import com.google.inject.Singleton;
import com.google.inject.assistedinject.FactoryModuleBuilder;
import com.plotsquared.bukkit.BukkitPlatform;
import com.plotsquared.bukkit.listener.SingleWorldListener;
import com.plotsquared.bukkit.player.BukkitPlayerManager;
import com.plotsquared.bukkit.queue.BukkitChunkCoordinator;
import com.plotsquared.bukkit.queue.BukkitQueueCoordinator;
import com.plotsquared.bukkit.schematic.BukkitSchematicHandler;
import com.plotsquared.bukkit.util.BukkitChunkManager;
import com.plotsquared.bukkit.util.BukkitEconHandler;
import com.plotsquared.bukkit.util.BukkitInventoryUtil;
import com.plotsquared.bukkit.util.BukkitRegionManager;
import com.plotsquared.bukkit.util.BukkitSetupUtils;
import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.bukkit.util.fawe.FaweRegionManager;
import com.plotsquared.bukkit.util.fawe.FaweSchematicHandler;
import com.plotsquared.core.PlotPlatform;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.generator.HybridGen;
import com.plotsquared.core.generator.IndependentPlotGenerator;
import com.plotsquared.core.inject.annotations.ConsoleActor;
import com.plotsquared.core.inject.annotations.DefaultGenerator;
import com.plotsquared.core.inject.factory.ChunkCoordinatorBuilderFactory;
import com.plotsquared.core.inject.factory.ChunkCoordinatorFactory;
import com.plotsquared.core.inject.factory.HybridPlotWorldFactory;
import com.plotsquared.core.inject.factory.ProgressSubscriberFactory;
import com.plotsquared.core.plot.world.DefaultPlotAreaManager;
import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.plot.world.SinglePlotAreaManager;
import com.plotsquared.core.queue.ChunkCoordinator;
import com.plotsquared.core.queue.GlobalBlockQueue;
import com.plotsquared.core.queue.QueueProvider;
import com.plotsquared.core.queue.subscriber.DefaultProgressSubscriber;
import com.plotsquared.core.queue.subscriber.ProgressSubscriber;
import com.plotsquared.core.util.ChunkManager;
import com.plotsquared.core.util.EconHandler;
import com.plotsquared.core.util.InventoryUtil;
import com.plotsquared.core.util.PlayerManager;
import com.plotsquared.core.util.RegionManager;
import com.plotsquared.core.util.SchematicHandler;
import com.plotsquared.core.util.SetupUtils;
import com.plotsquared.core.util.WorldUtil;
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
import com.sk89q.worldedit.extension.platform.Actor;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bukkit.Bukkit;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.plugin.java.JavaPlugin;
import org.checkerframework.checker.nullness.qual.NonNull;
public class BukkitModule extends AbstractModule {
private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + BukkitModule.class.getSimpleName());
private final BukkitPlatform bukkitPlatform;
public BukkitModule(final @NonNull BukkitPlatform bukkitPlatform) {
this.bukkitPlatform = bukkitPlatform;
}
@Override
protected void configure() {
bind(PlayerManager.class).to(BukkitPlayerManager.class);
bind(JavaPlugin.class).toInstance(bukkitPlatform);
bind(PlotPlatform.class).toInstance(bukkitPlatform);
bind(BukkitPlatform.class).toInstance(bukkitPlatform);
bind(IndependentPlotGenerator.class).annotatedWith(DefaultGenerator.class).to(HybridGen.class);
// Console actor
@NonNull ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
WorldEditPlugin wePlugin = ((WorldEditPlugin) Bukkit.getPluginManager().getPlugin("WorldEdit"));
bind(Actor.class).annotatedWith(ConsoleActor.class).toInstance(wePlugin.wrapCommandSender(console));
bind(InventoryUtil.class).to(BukkitInventoryUtil.class);
bind(SetupUtils.class).to(BukkitSetupUtils.class);
bind(WorldUtil.class).to(BukkitUtil.class);
install(new FactoryModuleBuilder()
.implement(ProgressSubscriber.class, DefaultProgressSubscriber.class)
.build(ProgressSubscriberFactory.class));
bind(ChunkManager.class).to(BukkitChunkManager.class);
if (PlotSquared.platform().isFaweHooking()) {
bind(SchematicHandler.class).to(FaweSchematicHandler.class);
bind(RegionManager.class).to(FaweRegionManager.class);
} else {
bind(SchematicHandler.class).to(BukkitSchematicHandler.class);
bind(RegionManager.class).to(BukkitRegionManager.class);
}
bind(GlobalBlockQueue.class).toInstance(new GlobalBlockQueue(QueueProvider.of(BukkitQueueCoordinator.class)));
if (Settings.Enabled_Components.WORLDS) {
bind(PlotAreaManager.class).to(SinglePlotAreaManager.class);
try {
bind(SingleWorldListener.class).toInstance(new SingleWorldListener());
} catch (Exception e) {
e.printStackTrace();
}
} else {
bind(PlotAreaManager.class).to(DefaultPlotAreaManager.class);
}
install(new FactoryModuleBuilder().build(HybridPlotWorldFactory.class));
install(new FactoryModuleBuilder()
.implement(ChunkCoordinator.class, BukkitChunkCoordinator.class)
.build(ChunkCoordinatorFactory.class));
install(new FactoryModuleBuilder().build(ChunkCoordinatorBuilderFactory.class));
}
@Provides
@Singleton
@NonNull EconHandler provideEconHandler() {
if (!Settings.Enabled_Components.ECONOMY) {
return EconHandler.nullEconHandler();
}
if (Bukkit.getPluginManager().isPluginEnabled("Vault")) {
try {
BukkitEconHandler econHandler = new BukkitEconHandler();
if (!econHandler.init()) {
LOGGER.warn("Economy is enabled but no plugin is providing an economy service. Falling back...");
return EconHandler.nullEconHandler();
}
return econHandler;
} catch (final Exception ignored) {
}
}
return EconHandler.nullEconHandler();
}
}

View File

@ -0,0 +1,43 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.inject;
import com.google.inject.AbstractModule;
import com.google.inject.Provides;
import com.google.inject.Singleton;
import com.plotsquared.bukkit.permissions.BukkitPermissionHandler;
import com.plotsquared.bukkit.permissions.VaultPermissionHandler;
import com.plotsquared.core.permissions.PermissionHandler;
import org.bukkit.Bukkit;
public class PermissionModule extends AbstractModule {
@Provides
@Singleton
PermissionHandler providePermissionHandler() {
try {
if (Bukkit.getPluginManager().isPluginEnabled("Vault")) {
return new VaultPermissionHandler();
}
} catch (final Exception ignored) {
}
return new BukkitPermissionHandler();
}
}

View File

@ -0,0 +1,43 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.inject;
import com.google.inject.AbstractModule;
import com.google.inject.Provides;
import com.google.inject.Singleton;
import com.plotsquared.bukkit.managers.BukkitWorldManager;
import com.plotsquared.bukkit.managers.MultiverseWorldManager;
import com.plotsquared.core.util.PlatformWorldManager;
import org.bukkit.Bukkit;
import org.bukkit.World;
public class WorldManagerModule extends AbstractModule {
@SuppressWarnings("removal") // Internal use only
@Provides
@Singleton
PlatformWorldManager<World> provideWorldManager() {
if (Bukkit.getPluginManager().getPlugin("Multiverse-Core") != null) {
return new MultiverseWorldManager();
} else {
return new BukkitWorldManager();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,189 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.listener;
import com.google.inject.Inject;
import com.plotsquared.bukkit.player.BukkitPlayer;
import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.flag.implementations.CopperOxideFlag;
import com.plotsquared.core.plot.flag.implementations.MiscInteractFlag;
import com.plotsquared.core.util.PlotFlagUtil;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockFertilizeEvent;
import org.bukkit.event.block.BlockFormEvent;
import org.bukkit.event.block.BlockReceiveGameEvent;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;
@SuppressWarnings("unused")
public class BlockEventListener117 implements Listener {
private static final Set<Material> COPPER_OXIDIZING = Set.of(
Material.COPPER_BLOCK,
Material.EXPOSED_COPPER,
Material.WEATHERED_COPPER,
Material.OXIDIZED_COPPER,
Material.CUT_COPPER,
Material.EXPOSED_CUT_COPPER,
Material.WEATHERED_CUT_COPPER,
Material.OXIDIZED_CUT_COPPER,
Material.CUT_COPPER_STAIRS,
Material.EXPOSED_CUT_COPPER_STAIRS,
Material.WEATHERED_CUT_COPPER_STAIRS,
Material.OXIDIZED_CUT_COPPER_STAIRS,
Material.CUT_COPPER_SLAB,
Material.EXPOSED_CUT_COPPER_SLAB,
Material.WEATHERED_CUT_COPPER_SLAB,
Material.OXIDIZED_CUT_COPPER_SLAB
);
@Inject
public BlockEventListener117() {
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockReceiveGame(BlockReceiveGameEvent event) {
Block block = event.getBlock();
Location location = BukkitUtil.adapt(block.getLocation());
Entity entity = event.getEntity();
PlotArea area = location.getPlotArea();
if (area == null) {
return;
}
BukkitPlayer plotPlayer = null;
if (entity instanceof Player player) {
plotPlayer = BukkitUtil.adapt(player);
if (area.notifyIfOutsideBuildArea(plotPlayer, location.getY())) {
event.setCancelled(true);
return;
}
}
Plot plot = location.getOwnedPlot();
if (plot == null && !PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, MiscInteractFlag.class, true) || plot != null && !plot.getFlag(
MiscInteractFlag.class)) {
if (plotPlayer != null) {
if (plot != null) {
if (!plot.isAdded(plotPlayer.getUUID())) {
plot.debug(plotPlayer.getName() + " couldn't trigger sculk sensors because misc-interact = false");
event.setCancelled(true);
}
}
return;
}
if (entity instanceof Item item) {
UUID itemThrower = item.getThrower();
if (plot != null) {
if (itemThrower == null && (itemThrower = item.getOwner()) == null) {
plot.debug(
"A thrown item couldn't trigger sculk sensors because misc-interact = false and the item's owner could not be resolved.");
event.setCancelled(true);
return;
}
if (!plot.isAdded(itemThrower)) {
if (!plot.isAdded(itemThrower)) {
plot.debug("A thrown item couldn't trigger sculk sensors because misc-interact = false");
event.setCancelled(true);
}
}
}
}
}
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockFertilize(BlockFertilizeEvent event) {
Block block = event.getBlock();
List<org.bukkit.block.BlockState> blocks = event.getBlocks();
Location location = BukkitUtil.adapt(blocks.get(0).getLocation());
PlotArea area = location.getPlotArea();
if (area == null) {
for (int i = blocks.size() - 1; i >= 0; i--) {
Location blockLocation = BukkitUtil.adapt(blocks.get(i).getLocation());
blockLocation = BukkitUtil.adapt(blocks.get(i).getLocation());
if (blockLocation.isPlotArea()) {
blocks.remove(i);
}
}
} else {
Plot origin = area.getOwnedPlot(location);
if (origin == null) {
event.setCancelled(true);
return;
}
for (int i = blocks.size() - 1; i >= 0; i--) {
Location blockLocation = BukkitUtil.adapt(blocks.get(i).getLocation());
if (!area.contains(blockLocation.getX(), blockLocation.getZ())) {
blocks.remove(i);
continue;
}
Plot plot = area.getOwnedPlot(blockLocation);
if (!Objects.equals(plot, origin)) {
event.getBlocks().remove(i);
continue;
}
if (!area.buildRangeContainsY(location.getY())) {
event.getBlocks().remove(i);
}
}
}
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockForm(BlockFormEvent event) {
Block block = event.getBlock();
Location location = BukkitUtil.adapt(block.getLocation());
if (location.isPlotRoad()) {
event.setCancelled(true);
return;
}
PlotArea area = location.getPlotArea();
if (area == null) {
return;
}
Plot plot = area.getOwnedPlot(location);
if (plot == null) {
return;
}
if (COPPER_OXIDIZING.contains(event.getNewState().getType())) {
if (!plot.getFlag(CopperOxideFlag.class)) {
plot.debug("Copper could not oxide because copper-oxide = false");
event.setCancelled(true);
}
}
}
}

View File

@ -0,0 +1,365 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.listener;
import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea;
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.RefField;
import com.plotsquared.core.util.ReflectionUtils.RefMethod;
import com.plotsquared.core.util.task.PlotSquaredTask;
import com.plotsquared.core.util.task.TaskManager;
import com.plotsquared.core.util.task.TaskTime;
import io.papermc.lib.PaperLib;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.BlockState;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Item;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPhysicsEvent;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.world.ChunkLoadEvent;
import org.bukkit.event.world.ChunkUnloadEvent;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.lang.reflect.Method;
import java.util.HashSet;
import java.util.Objects;
import static com.plotsquared.core.util.ReflectionUtils.getRefClass;
@SuppressWarnings("unused")
public class ChunkListener implements Listener {
private final PlotAreaManager plotAreaManager;
private final int version;
private RefMethod methodGetHandleChunk;
private RefMethod methodGetHandleWorld;
private RefField mustSave;
/*
private RefMethod methodGetFullChunk;
private RefMethod methodGetBukkitChunk;
private RefMethod methodGetChunkProvider;
private RefMethod methodGetVisibleMap;
private RefField worldServer;
private RefField playerChunkMap;
private RefField updatingChunks;
private RefField visibleChunks;
*/
private Chunk lastChunk;
private boolean ignoreUnload = false;
private boolean isTrueForNotSave = true;
@Inject
public ChunkListener(final @NonNull PlotAreaManager plotAreaManager) {
this.plotAreaManager = plotAreaManager;
version = PlotSquared.platform().serverVersion()[1];
if (!Settings.Chunk_Processor.AUTO_TRIM) {
return;
}
try {
RefClass classCraftWorld = getRefClass("{cb}.CraftWorld");
this.methodGetHandleWorld = classCraftWorld.getMethod("getHandle");
RefClass classCraftChunk = getRefClass("{cb}.CraftChunk");
this.methodGetHandleChunk = classCraftChunk.getMethod("getHandle");
try {
if (version < 17) {
RefClass classChunk = getRefClass("{nms}.Chunk");
if (version == 13) {
this.mustSave = classChunk.getField("mustSave");
this.isTrueForNotSave = false;
} else {
this.mustSave = classChunk.getField("mustNotSave");
}
} else {
RefClass classChunk = getRefClass("net.minecraft.world.level.chunk.Chunk");
this.mustSave = classChunk.getField("mustNotSave");
}
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
} catch (Throwable ignored) {
Settings.Chunk_Processor.AUTO_TRIM = false;
}
for (World world : Bukkit.getWorlds()) {
world.setAutoSave(false);
}
if (version > 13) {
return;
}
TaskManager.runTaskRepeat(() -> {
try {
HashSet<Chunk> toUnload = new HashSet<>();
for (World world : Bukkit.getWorlds()) {
String worldName = world.getName();
if (!this.plotAreaManager.hasPlotArea(worldName)) {
continue;
}
Object craftWorld = methodGetHandleWorld.of(world).call();
if (version == 13) {
Object chunkMap = craftWorld.getClass().getDeclaredMethod("getPlayerChunkMap").invoke(craftWorld);
Method methodIsChunkInUse =
chunkMap.getClass().getDeclaredMethod("isChunkInUse", int.class, int.class);
Chunk[] chunks = world.getLoadedChunks();
for (Chunk chunk : chunks) {
if ((boolean) methodIsChunkInUse.invoke(chunkMap, chunk.getX(), chunk.getZ())) {
continue;
}
int x = chunk.getX();
int z = chunk.getZ();
if (!shouldSave(worldName, x, z)) {
unloadChunk(worldName, chunk, false);
continue;
}
toUnload.add(chunk);
}
}
}
if (toUnload.isEmpty()) {
return;
}
long start = System.currentTimeMillis();
for (Chunk chunk : toUnload) {
if (System.currentTimeMillis() - start > 5) {
return;
}
chunk.unload(true);
}
} catch (Throwable e) {
e.printStackTrace();
}
}, TaskTime.ticks(1L));
}
public boolean unloadChunk(String world, Chunk chunk, boolean safe) {
if (safe && shouldSave(world, chunk.getX(), chunk.getZ())) {
return false;
}
Object c = this.methodGetHandleChunk.of(chunk).call();
RefField.RefExecutor field = this.mustSave.of(c);
if ((Boolean) field.get() != isTrueForNotSave) {
field.set(isTrueForNotSave);
if (chunk.isLoaded()) {
ignoreUnload = true;
chunk.unload(false);
ignoreUnload = false;
}
}
return true;
}
public boolean shouldSave(String world, int chunkX, int chunkZ) {
int x = chunkX << 4;
int z = chunkZ << 4;
int x2 = x + 15;
int z2 = z + 15;
Location loc = Location.at(world, x, 1, z);
PlotArea plotArea = plotAreaManager.getPlotArea(loc);
if (plotArea != null) {
Plot plot = plotArea.getPlot(loc);
if (plot != null && plot.hasOwner()) {
return true;
}
}
loc = Location.at(world, x2, 1, z2);
plotArea = plotAreaManager.getPlotArea(loc);
if (plotArea != null) {
Plot plot = plotArea.getPlot(loc);
if (plot != null && plot.hasOwner()) {
return true;
}
}
loc = Location.at(world, x2, 1, z);
plotArea = plotAreaManager.getPlotArea(loc);
if (plotArea != null) {
Plot plot = plotArea.getPlot(loc);
if (plot != null && plot.hasOwner()) {
return true;
}
}
loc = Location.at(world, x, 1, z2);
plotArea = plotAreaManager.getPlotArea(loc);
if (plotArea != null) {
Plot plot = plotArea.getPlot(loc);
if (plot != null && plot.hasOwner()) {
return true;
}
}
loc = Location.at(world, x + 7, 1, z + 7);
plotArea = plotAreaManager.getPlotArea(loc);
if (plotArea == null) {
return false;
}
Plot plot = plotArea.getPlot(loc);
return plot != null && plot.hasOwner();
}
@EventHandler
public void onChunkUnload(ChunkUnloadEvent event) {
if (ignoreUnload) {
return;
}
Chunk chunk = event.getChunk();
if (Settings.Chunk_Processor.AUTO_TRIM) {
String world = chunk.getWorld().getName();
if ((!Settings.Enabled_Components.WORLDS || !SinglePlotArea.isSinglePlotWorld(world)) && this.plotAreaManager.hasPlotArea(world)) {
if (unloadChunk(world, chunk, true)) {
return;
}
}
}
if (processChunk(event.getChunk(), true)) {
chunk.setForceLoaded(true);
}
}
@EventHandler
public void onChunkLoad(ChunkLoadEvent event) {
processChunk(event.getChunk(), false);
}
@EventHandler(priority = EventPriority.LOWEST)
public void onItemSpawn(ItemSpawnEvent event) {
Item entity = event.getEntity();
PaperLib.getChunkAtAsync(event.getLocation()).thenAccept(chunk -> {
if (chunk == this.lastChunk) {
event.getEntity().remove();
event.setCancelled(true);
return;
}
if (!this.plotAreaManager.hasPlotArea(chunk.getWorld().getName())) {
return;
}
Entity[] entities = chunk.getEntities();
if (entities.length > Settings.Chunk_Processor.MAX_ENTITIES) {
event.getEntity().remove();
event.setCancelled(true);
this.lastChunk = chunk;
} else {
this.lastChunk = null;
}
});
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockPhysics(BlockPhysicsEvent event) {
if (Settings.Chunk_Processor.DISABLE_PHYSICS) {
event.setCancelled(true);
}
}
@EventHandler(priority = EventPriority.LOWEST)
public void onEntitySpawn(CreatureSpawnEvent event) {
LivingEntity entity = event.getEntity();
PaperLib.getChunkAtAsync(event.getLocation()).thenAccept(chunk -> {
if (chunk == this.lastChunk) {
event.getEntity().remove();
event.setCancelled(true);
return;
}
if (!this.plotAreaManager.hasPlotArea(chunk.getWorld().getName())) {
return;
}
Entity[] entities = chunk.getEntities();
if (entities.length > Settings.Chunk_Processor.MAX_ENTITIES) {
event.getEntity().remove();
event.setCancelled(true);
this.lastChunk = chunk;
} else {
this.lastChunk = null;
}
});
}
private void cleanChunk(final Chunk chunk) {
final int currentIndex = TaskManager.index.incrementAndGet();
PlotSquaredTask task = TaskManager.runTaskRepeat(() -> {
if (!chunk.isLoaded()) {
Objects.requireNonNull(TaskManager.removeTask(currentIndex)).cancel();
chunk.unload(true);
return;
}
BlockState[] tiles = chunk.getTileEntities();
if (tiles.length == 0) {
Objects.requireNonNull(TaskManager.removeTask(currentIndex)).cancel();
chunk.unload(true);
return;
}
long start = System.currentTimeMillis();
int i = 0;
while (System.currentTimeMillis() - start < 250) {
if (i >= tiles.length - Settings.Chunk_Processor.MAX_TILES) {
Objects.requireNonNull(TaskManager.removeTask(currentIndex)).cancel();
chunk.unload(true);
return;
}
tiles[i].getBlock().setType(Material.AIR, false);
i++;
}
}, TaskTime.ticks(5L));
TaskManager.addTask(task, currentIndex);
}
public boolean processChunk(Chunk chunk, boolean unload) {
if (!this.plotAreaManager.hasPlotArea(chunk.getWorld().getName())) {
return false;
}
Entity[] entities = chunk.getEntities();
BlockState[] tiles = chunk.getTileEntities();
if (entities.length > Settings.Chunk_Processor.MAX_ENTITIES) {
int toRemove = entities.length - Settings.Chunk_Processor.MAX_ENTITIES;
int index = 0;
while (toRemove > 0 && index < entities.length) {
final Entity entity = entities[index++];
if (!(entity instanceof Player)) {
entity.remove();
toRemove--;
}
}
}
if (tiles.length > Settings.Chunk_Processor.MAX_TILES) {
if (unload) {
cleanChunk(chunk);
return true;
}
for (int i = 0; i < (tiles.length - Settings.Chunk_Processor.MAX_TILES); i++) {
tiles[i].getBlock().setType(Material.AIR, false);
}
}
return false;
}
}

View File

@ -0,0 +1,439 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.listener;
import com.google.inject.Inject;
import com.plotsquared.bukkit.player.BukkitPlayer;
import com.plotsquared.bukkit.util.BukkitEntityUtil;
import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.listener.PlayerBlockEventType;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.PlotHandler;
import com.plotsquared.core.plot.flag.implementations.DisablePhysicsFlag;
import com.plotsquared.core.plot.flag.implementations.EntityChangeBlockFlag;
import com.plotsquared.core.plot.flag.implementations.ExplosionFlag;
import com.plotsquared.core.plot.flag.implementations.InvincibleFlag;
import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.util.EventDispatcher;
import com.plotsquared.core.util.PlotFlagUtil;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.world.block.BlockType;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.entity.Ageable;
import org.bukkit.entity.Boat;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.FallingBlock;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.entity.Vehicle;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.EntityChangeBlockEvent;
import org.bukkit.event.entity.EntityCombustByEntityEvent;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.ExplosionPrimeEvent;
import org.bukkit.event.vehicle.VehicleCreateEvent;
import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.metadata.MetadataValue;
import org.bukkit.plugin.Plugin;
import org.bukkit.projectiles.BlockProjectileSource;
import org.bukkit.projectiles.ProjectileSource;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.Iterator;
import java.util.List;
@SuppressWarnings("unused")
public class EntityEventListener implements Listener {
private final PlotAreaManager plotAreaManager;
private final EventDispatcher eventDispatcher;
private float lastRadius;
@Inject
public EntityEventListener(
final @NonNull PlotAreaManager plotAreaManager,
final @NonNull EventDispatcher eventDispatcher
) {
this.plotAreaManager = plotAreaManager;
this.eventDispatcher = eventDispatcher;
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onEntityCombustByEntity(EntityCombustByEntityEvent event) {
EntityDamageByEntityEvent eventChange =
new EntityDamageByEntityEvent(
event.getCombuster(),
event.getEntity(),
EntityDamageEvent.DamageCause.FIRE_TICK,
event.getDuration()
);
onEntityDamageByEntityEvent(eventChange);
if (eventChange.isCancelled()) {
event.setCancelled(true);
}
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onEntityDamageByEntityEvent(EntityDamageByEntityEvent event) {
Entity damager = event.getDamager();
Location location = BukkitUtil.adapt(damager.getLocation());
if (!this.plotAreaManager.hasPlotArea(location.getWorldName())) {
return;
}
Entity victim = event.getEntity();
/*
if (victim.getType().equals(EntityType.ITEM_FRAME)) {
Plot plot = BukkitUtil.getLocation(victim).getPlot();
if (plot != null && !plot.isAdded(damager.getUniqueId())) {
event.setCancelled(true);
return;
}
}
*/
if (!BukkitEntityUtil.entityDamage(damager, victim, event.getCause())) {
if (event.isCancelled()) {
if (victim instanceof Ageable ageable) {
if (ageable.getAge() == -24000) {
ageable.setAge(0);
ageable.setAdult();
}
}
}
event.setCancelled(true);
}
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void creatureSpawnEvent(CreatureSpawnEvent event) {
Entity entity = event.getEntity();
Location location = BukkitUtil.adapt(entity.getLocation());
PlotArea area = location.getPlotArea();
if (area == null) {
return;
}
CreatureSpawnEvent.SpawnReason reason = event.getSpawnReason();
switch (reason.toString()) {
case "DISPENSE_EGG":
case "EGG":
case "OCELOT_BABY":
case "SPAWNER_EGG":
if (!area.isSpawnEggs()) {
event.setCancelled(true);
return;
}
break;
case "REINFORCEMENTS":
case "NATURAL":
case "MOUNT":
case "PATROL":
case "RAID":
case "SHEARED":
case "SILVERFISH_BLOCK":
case "ENDER_PEARL":
case "TRAP":
case "VILLAGE_DEFENSE":
case "VILLAGE_INVASION":
case "BEEHIVE":
case "CHUNK_GEN":
if (!area.isMobSpawning()) {
event.setCancelled(true);
return;
}
break;
case "BREEDING":
if (!area.isSpawnBreeding()) {
event.setCancelled(true);
return;
}
break;
case "BUILD_IRONGOLEM":
case "BUILD_SNOWMAN":
case "BUILD_WITHER":
case "CUSTOM":
if (!area.isSpawnCustom() && entity.getType() != EntityType.ARMOR_STAND) {
event.setCancelled(true);
return;
}
break;
case "SPAWNER":
if (!area.isMobSpawnerSpawning()) {
event.setCancelled(true);
return;
}
break;
}
Plot plot = area.getOwnedPlotAbs(location);
if (plot == null) {
if (!area.isMobSpawning()) {
event.setCancelled(true);
}
return;
}
if (BukkitEntityUtil.checkEntity(entity, plot.getBasePlot(false))) {
event.setCancelled(true);
}
}
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
public void onEntityFall(EntityChangeBlockEvent event) {
if (event.getEntityType() != EntityType.FALLING_BLOCK) {
return;
}
Block block = event.getBlock();
World world = block.getWorld();
String worldName = world.getName();
if (!this.plotAreaManager.hasPlotArea(worldName)) {
return;
}
Location location = BukkitUtil.adapt(block.getLocation());
PlotArea area = location.getPlotArea();
if (area == null) {
return;
}
Plot plot = area.getOwnedPlotAbs(location);
if (plot == null || plot.getFlag(DisablePhysicsFlag.class)) {
event.setCancelled(true);
if (plot != null) {
if (block.getType().hasGravity()) {
BlockEventListener.sendBlockChange(block.getLocation(), block.getBlockData());
}
plot.debug("Falling block event was cancelled because disable-physics = true");
}
return;
}
if (event.getTo().hasGravity()) {
Entity entity = event.getEntity();
List<MetadataValue> meta = entity.getMetadata("plot");
if (meta.isEmpty()) {
return;
}
Plot origin = (Plot) meta.get(0).value();
if (origin != null && !origin.equals(plot)) {
event.setCancelled(true);
entity.remove();
}
} else if (event.getTo() == Material.AIR) {
event.getEntity().setMetadata("plot", new FixedMetadataValue((Plugin) PlotSquared.platform(), plot));
}
}
@EventHandler(priority = EventPriority.HIGH)
public void onDamage(EntityDamageEvent event) {
if (event.getEntityType() != EntityType.PLAYER) {
return;
}
Location location = BukkitUtil.adapt(event.getEntity().getLocation());
PlotArea area = location.getPlotArea();
if (area == null) {
return;
}
Plot plot = location.getOwnedPlot();
if (plot == null) {
if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, InvincibleFlag.class, true)) {
event.setCancelled(true);
}
return;
}
if (plot.getFlag(InvincibleFlag.class)) {
plot.debug(event.getEntity().getName() + " could not take damage because invincible = true");
event.setCancelled(true);
}
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBigBoom(EntityExplodeEvent event) {
Location location = BukkitUtil.adapt(event.getLocation());
PlotArea area = location.getPlotArea();
boolean plotArea = location.isPlotArea();
if (!plotArea) {
if (!this.plotAreaManager.hasPlotArea(location.getWorldName())) {
return;
}
return;
}
Plot plot = area.getOwnedPlot(location);
if (plot != null) {
if (plot.getFlag(ExplosionFlag.class)) {
List<MetadataValue> meta = event.getEntity().getMetadata("plot");
Plot origin;
if (meta.isEmpty()) {
origin = plot;
} else {
origin = (Plot) meta.get(0).value();
}
if (this.lastRadius != 0) {
List<Entity> nearby = event.getEntity().getNearbyEntities(this.lastRadius, this.lastRadius, this.lastRadius);
for (Entity near : nearby) {
if (near instanceof TNTPrimed || near.getType().equals(EntityType.MINECART_TNT)) {
if (!near.hasMetadata("plot")) {
near.setMetadata("plot", new FixedMetadataValue((Plugin) PlotSquared.platform(), plot));
}
}
}
this.lastRadius = 0;
}
Iterator<Block> iterator = event.blockList().iterator();
while (iterator.hasNext()) {
Block block = iterator.next();
location = BukkitUtil.adapt(block.getLocation());
if (!area.contains(location.getX(), location.getZ()) || !origin.equals(area.getOwnedPlot(location))) {
iterator.remove();
}
}
return;
} else {
plot.debug("Explosion was cancelled because explosion = false");
}
}
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)
public void onPeskyMobsChangeTheWorldLikeWTFEvent(EntityChangeBlockEvent event) {
Entity e = event.getEntity();
Material type = event.getBlock().getType();
Location location = BukkitUtil.adapt(event.getBlock().getLocation());
PlotArea area = location.getPlotArea();
if (area == null) {
return;
}
if (e instanceof FallingBlock) {
// allow falling blocks converting to blocks and vice versa
return;
} else if (e instanceof Boat) {
// allow boats destroying lily pads
if (type == Material.LILY_PAD) {
return;
}
} else if (e instanceof Player player) {
BukkitPlayer pp = BukkitUtil.adapt(player);
if (type.toString().equals("POWDER_SNOW")) {
// Burning player evaporating powder snow. Use same checks as
// trampling farmland
BlockType blockType = BukkitAdapter.asBlockType(type);
if (!this.eventDispatcher.checkPlayerBlockEvent(pp,
PlayerBlockEventType.TRIGGER_PHYSICAL, location, blockType, true
)) {
event.setCancelled(true);
}
return;
} else {
// already handled by other flags (mainly the 'use' flag):
// - player tilting big dripleaf by standing on it
// - player picking glow berries from cave vine
// - player trampling farmland
// - player standing on or clicking redstone ore
return;
}
} else if (e instanceof Projectile entity) {
// Exact same as the ProjectileHitEvent listener, except that we let
// the entity-change-block determine what to do with shooters that
// aren't players and aren't blocks
Plot plot = area.getPlot(location);
ProjectileSource shooter = entity.getShooter();
if (shooter instanceof Player) {
PlotPlayer<?> pp = BukkitUtil.adapt((Player) shooter);
if (plot == null) {
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) {
entity.remove();
event.setCancelled(true);
}
return;
}
if (plot.isAdded(pp.getUUID()) || pp.hasPermission(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
return;
}
entity.remove();
event.setCancelled(true);
return;
}
if (!(shooter instanceof Entity) && shooter != null) {
if (plot == null) {
entity.remove();
event.setCancelled(true);
return;
}
Location sLoc =
BukkitUtil.adapt(((BlockProjectileSource) shooter).getBlock().getLocation());
if (!area.contains(sLoc.getX(), sLoc.getZ())) {
entity.remove();
event.setCancelled(true);
return;
}
Plot sPlot = area.getOwnedPlotAbs(sLoc);
if (sPlot == null || !PlotHandler.sameOwners(plot, sPlot)) {
entity.remove();
event.setCancelled(true);
}
return;
}
// fall back to entity-change-block flag
}
Plot plot = area.getOwnedPlot(location);
if (plot != null && !plot.getFlag(EntityChangeBlockFlag.class)) {
plot.debug(e.getType() + " could not change block because entity-change-block = false");
event.setCancelled(true);
}
}
@EventHandler
public void onPrime(ExplosionPrimeEvent event) {
this.lastRadius = event.getRadius() + 1;
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onVehicleCreate(VehicleCreateEvent event) {
Vehicle entity = event.getVehicle();
Location location = BukkitUtil.adapt(entity.getLocation());
PlotArea area = location.getPlotArea();
if (area == null) {
return;
}
Plot plot = area.getOwnedPlotAbs(location);
if (plot == null || BukkitEntityUtil.checkEntity(entity, plot)) {
entity.remove();
return;
}
if (Settings.Enabled_Components.KILL_ROAD_VEHICLES) {
entity.setMetadata("plot", new FixedMetadataValue((Plugin) PlotSquared.platform(), plot));
}
}
}

View File

@ -0,0 +1,231 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.listener;
import com.plotsquared.bukkit.util.BukkitEntityUtil;
import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
import io.papermc.lib.PaperLib;
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Vehicle;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.EntitySpawnEvent;
import org.bukkit.event.entity.EntityTeleportEvent;
import org.bukkit.event.vehicle.VehicleBlockCollisionEvent;
import org.bukkit.event.vehicle.VehicleCreateEvent;
import org.bukkit.event.vehicle.VehicleMoveEvent;
import org.bukkit.event.vehicle.VehicleUpdateEvent;
import org.bukkit.event.world.ChunkLoadEvent;
import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.metadata.MetadataValue;
import org.bukkit.plugin.Plugin;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.List;
public class EntitySpawnListener implements Listener {
private static final String KEY = "P2";
private static boolean ignoreTP = false;
private static boolean hasPlotArea = false;
private static String areaName = null;
public static void testNether(final Entity entity) {
@NonNull World world = entity.getWorld();
if (world.getEnvironment() != World.Environment.NETHER && world.getEnvironment() != World.Environment.THE_END) {
return;
}
test(entity);
}
public static void testCreate(final Entity entity) {
@NonNull World world = entity.getWorld();
if (!world.getName().equals(areaName)) {
areaName = world.getName();
hasPlotArea = PlotSquared.get().getPlotAreaManager().hasPlotArea(areaName);
}
if (!hasPlotArea) {
return;
}
test(entity);
}
public static void test(Entity entity) {
@NonNull World world = entity.getWorld();
List<MetadataValue> meta = entity.getMetadata(KEY);
if (meta.isEmpty()) {
if (PlotSquared.get().getPlotAreaManager().hasPlotArea(world.getName())) {
entity.setMetadata(KEY, new FixedMetadataValue((Plugin) PlotSquared.platform(), entity.getLocation()));
}
} else {
org.bukkit.Location origin = (org.bukkit.Location) meta.get(0).value();
World originWorld = origin.getWorld();
if (!originWorld.equals(world)) {
if (!ignoreTP) {
if (!world.getName().equalsIgnoreCase(originWorld + "_the_end")) {
if (entity.getType() == EntityType.PLAYER) {
return;
}
try {
ignoreTP = true;
PaperLib.teleportAsync(entity, origin);
} finally {
ignoreTP = false;
}
if (entity.getLocation().getWorld().equals(world)) {
entity.remove();
}
}
} else {
if (entity.getType() == EntityType.PLAYER) {
return;
}
entity.remove();
}
}
}
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void creatureSpawnEvent(EntitySpawnEvent event) {
Entity entity = event.getEntity();
Location location = BukkitUtil.adapt(entity.getLocation());
PlotArea area = location.getPlotArea();
if (!location.isPlotArea()) {
return;
}
Plot plot = location.getOwnedPlotAbs();
EntityType type = entity.getType();
if (plot == null) {
if (type == EntityType.DROPPED_ITEM) {
if (Settings.Enabled_Components.KILL_ROAD_ITEMS) {
event.setCancelled(true);
}
return;
}
if (!area.isMobSpawning()) {
if (type == EntityType.PLAYER) {
return;
}
if (type.isAlive()) {
event.setCancelled(true);
}
}
if (!area.isMiscSpawnUnowned() && !type.isAlive()) {
event.setCancelled(true);
}
return;
}
if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
event.setCancelled(true);
}
if (type == EntityType.ENDER_CRYSTAL) {
if (BukkitEntityUtil.checkEntity(entity, plot)) {
event.setCancelled(true);
}
return;
}
if (type == EntityType.SHULKER) {
if (!entity.hasMetadata("shulkerPlot")) {
entity.setMetadata("shulkerPlot", new FixedMetadataValue((Plugin) PlotSquared.platform(), plot.getId()));
}
}
}
@EventHandler
public void onChunkLoad(ChunkLoadEvent event) {
@NonNull Chunk chunk = event.getChunk();
for (final Entity entity : chunk.getEntities()) {
testCreate(entity);
}
}
@EventHandler
public void onVehicle(VehicleUpdateEvent event) {
testNether(event.getVehicle());
}
@EventHandler
public void onVehicle(VehicleCreateEvent event) {
testCreate(event.getVehicle());
}
@EventHandler
public void onVehicle(VehicleBlockCollisionEvent event) {
testNether(event.getVehicle());
}
@EventHandler
public void onTeleport(EntityTeleportEvent event) {
Entity entity = event.getEntity();
Entity fromLocation = event.getEntity();
Block toLocation = event.getTo().getBlock();
final Location fromLocLocation = BukkitUtil.adapt(fromLocation.getLocation());
final PlotArea fromArea = fromLocLocation.getPlotArea();
Location toLocLocation = BukkitUtil.adapt(toLocation.getLocation());
PlotArea toArea = toLocLocation.getPlotArea();
if (toArea == null) {
if (fromLocation.getType() == EntityType.SHULKER && fromArea != null) {
event.setCancelled(true);
}
return;
}
Plot toPlot = toArea.getOwnedPlot(toLocLocation);
if (fromLocation.getType() == EntityType.SHULKER && fromArea != null) {
final Plot fromPlot = fromArea.getOwnedPlot(fromLocLocation);
if (fromPlot != null || toPlot != null) {
if ((fromPlot == null || !fromPlot.equals(toPlot)) && (toPlot == null || !toPlot.equals(fromPlot))) {
event.setCancelled(true);
return;
}
}
}
if (entity instanceof Vehicle || entity instanceof ArmorStand) {
testNether(event.getEntity());
}
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void vehicleMove(VehicleMoveEvent event) {
testNether(event.getVehicle());
}
@EventHandler
public void spawn(CreatureSpawnEvent event) {
if (event.getEntityType() == EntityType.ARMOR_STAND) {
testCreate(event.getEntity());
}
}
}

View File

@ -0,0 +1,128 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.listener;
import com.plotsquared.bukkit.player.BukkitPlayer;
import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.flag.implementations.ForcefieldFlag;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
@SuppressWarnings("unused")
public class ForceFieldListener {
private static Set<PlotPlayer<?>> getNearbyPlayers(Player player, Plot plot) {
Set<PlotPlayer<?>> players = new HashSet<>();
for (Player nearPlayer : player.getNearbyEntities(5d, 5d, 5d).stream()
.filter(entity -> entity instanceof Player)
.map(entity -> (Player) entity)
.toList()
) {
PlotPlayer<?> plotPlayer;
if ((plotPlayer = BukkitUtil.adapt(nearPlayer)) == null || !plot
.equals(plotPlayer.getCurrentPlot())) {
continue;
}
if (!plot.isAdded(plotPlayer.getUUID())) {
players.add(plotPlayer);
}
}
return players;
}
private static PlotPlayer<?> hasNearbyPermitted(Player player, Plot plot) {
for (Player nearPlayer : player.getNearbyEntities(5d, 5d, 5d).stream()
.filter(entity -> entity instanceof Player)
.map(entity -> (Player) entity)
.toList()
) {
PlotPlayer<?> plotPlayer;
if ((plotPlayer = BukkitUtil.adapt(nearPlayer)) == null || !plot
.equals(plotPlayer.getCurrentPlot())) {
continue;
}
if (plot.isAdded(plotPlayer.getUUID())) {
return plotPlayer;
}
}
return null;
}
private static Vector calculateVelocity(PlotPlayer<?> player, PlotPlayer<?> e) {
Location playerLocation = player.getLocationFull();
Location oPlayerLocation = e.getLocation();
double playerX = playerLocation.getX();
double playerY = playerLocation.getY();
double playerZ = playerLocation.getZ();
double oPlayerX = oPlayerLocation.getX();
double oPlayerY = oPlayerLocation.getY();
double oPlayerZ = oPlayerLocation.getZ();
double x = 0d;
if (playerX < oPlayerX) {
x = 1.0d;
} else if (playerX > oPlayerX) {
x = -1.0d;
}
double y = 0d;
if (playerY < oPlayerY) {
y = 0.5d;
} else if (playerY > oPlayerY) {
y = -0.5d;
}
double z = 0d;
if (playerZ < oPlayerZ) {
z = 1.0d;
} else if (playerZ > oPlayerZ) {
z = -1.0d;
}
return new Vector(x, y, z);
}
public static void handleForcefield(Player player, PlotPlayer<?> plotPlayer, Plot plot) {
if (plot.getFlag(ForcefieldFlag.class)) {
UUID uuid = plotPlayer.getUUID();
if (plot.isAdded(uuid)) {
Set<PlotPlayer<?>> players = getNearbyPlayers(player, plot);
for (PlotPlayer<?> oPlayer : players) {
if (!oPlayer.hasPermission(Permission.PERMISSION_ADMIN_ENTRY_FORCEFIELD)) {
((BukkitPlayer) oPlayer).player
.setVelocity(calculateVelocity(plotPlayer, oPlayer));
}
}
} else {
PlotPlayer<?> oPlayer = hasNearbyPermitted(player, plot);
if (oPlayer == null) {
return;
}
if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_ENTRY_FORCEFIELD)) {
player.setVelocity(calculateVelocity(oPlayer, plotPlayer));
}
}
}
}
}

View File

@ -0,0 +1,456 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.listener;
import com.destroystokyo.paper.event.block.BeaconEffectEvent;
import com.destroystokyo.paper.event.entity.EntityPathfindEvent;
import com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent;
import com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent;
import com.destroystokyo.paper.event.entity.PreSpawnerSpawnEvent;
import com.destroystokyo.paper.event.entity.SlimePathfindEvent;
import com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent;
import com.destroystokyo.paper.event.server.AsyncTabCompleteEvent;
import com.google.inject.Inject;
import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.core.command.Command;
import com.plotsquared.core.command.MainCommand;
import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.flag.FlagContainer;
import com.plotsquared.core.plot.flag.implementations.BeaconEffectsFlag;
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
import com.plotsquared.core.plot.flag.implementations.ProjectilesFlag;
import com.plotsquared.core.plot.flag.types.BooleanFlag;
import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.util.PlotFlagUtil;
import net.kyori.adventure.text.minimessage.Template;
import org.bukkit.Chunk;
import org.bukkit.block.Block;
import org.bukkit.block.TileState;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.Slime;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.projectiles.ProjectileSource;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
import java.util.regex.Pattern;
/**
* Events specific to Paper. Some toit nups here
*/
@SuppressWarnings("unused")
public class PaperListener implements Listener {
private final PlotAreaManager plotAreaManager;
private Chunk lastChunk;
@Inject
public PaperListener(final @NonNull PlotAreaManager plotAreaManager) {
this.plotAreaManager = plotAreaManager;
}
@EventHandler
public void onEntityPathfind(EntityPathfindEvent event) {
if (!Settings.Paper_Components.ENTITY_PATHING) {
return;
}
Location toLoc = BukkitUtil.adapt(event.getLoc());
Location fromLoc = BukkitUtil.adapt(event.getEntity().getLocation());
PlotArea tarea = toLoc.getPlotArea();
if (tarea == null) {
return;
}
PlotArea farea = fromLoc.getPlotArea();
if (farea == null) {
return;
}
if (tarea != farea) {
event.setCancelled(true);
return;
}
Plot tplot = toLoc.getPlot();
Plot fplot = fromLoc.getPlot();
if (tplot == null ^ fplot == null) {
event.setCancelled(true);
return;
}
if (tplot == null || tplot.getId().hashCode() == fplot.getId().hashCode()) {
return;
}
if (fplot.isMerged() && fplot.getConnectedPlots().contains(fplot)) {
return;
}
event.setCancelled(true);
}
@EventHandler
public void onEntityPathfind(SlimePathfindEvent event) {
if (!Settings.Paper_Components.ENTITY_PATHING) {
return;
}
Slime slime = event.getEntity();
Block b = slime.getTargetBlock(4);
if (b == null) {
return;
}
Location toLoc = BukkitUtil.adapt(b.getLocation());
Location fromLoc = BukkitUtil.adapt(event.getEntity().getLocation());
PlotArea tarea = toLoc.getPlotArea();
if (tarea == null) {
return;
}
PlotArea farea = fromLoc.getPlotArea();
if (farea == null) {
return;
}
if (tarea != farea) {
event.setCancelled(true);
return;
}
Plot tplot = toLoc.getPlot();
Plot fplot = fromLoc.getPlot();
if (tplot == null ^ fplot == null) {
event.setCancelled(true);
return;
}
if (tplot == null || tplot.getId().hashCode() == fplot.getId().hashCode()) {
return;
}
if (fplot.isMerged() && fplot.getConnectedPlots().contains(fplot)) {
return;
}
event.setCancelled(true);
}
@EventHandler
public void onPreCreatureSpawnEvent(PreCreatureSpawnEvent event) {
if (!Settings.Paper_Components.CREATURE_SPAWN) {
return;
}
Location location = BukkitUtil.adapt(event.getSpawnLocation());
PlotArea area = location.getPlotArea();
if (!location.isPlotArea()) {
return;
}
//If entities are spawning... the chunk should be loaded?
Entity[] entities = event.getSpawnLocation().getChunk().getEntities();
if (entities.length > Settings.Chunk_Processor.MAX_ENTITIES) {
event.setShouldAbortSpawn(true);
event.setCancelled(true);
return;
}
CreatureSpawnEvent.SpawnReason reason = event.getReason();
switch (reason.toString()) {
case "DISPENSE_EGG":
case "EGG":
case "OCELOT_BABY":
case "SPAWNER_EGG":
if (!area.isSpawnEggs()) {
event.setShouldAbortSpawn(true);
event.setCancelled(true);
return;
}
break;
case "REINFORCEMENTS":
case "NATURAL":
case "MOUNT":
case "PATROL":
case "RAID":
case "SHEARED":
case "SILVERFISH_BLOCK":
case "ENDER_PEARL":
case "TRAP":
case "VILLAGE_DEFENSE":
case "VILLAGE_INVASION":
case "BEEHIVE":
case "CHUNK_GEN":
if (!area.isMobSpawning()) {
event.setShouldAbortSpawn(true);
event.setCancelled(true);
return;
}
break;
case "BREEDING":
if (!area.isSpawnBreeding()) {
event.setShouldAbortSpawn(true);
event.setCancelled(true);
return;
}
break;
case "BUILD_IRONGOLEM":
case "BUILD_SNOWMAN":
case "BUILD_WITHER":
case "CUSTOM":
if (!area.isSpawnCustom() && event.getType() != EntityType.ARMOR_STAND) {
event.setShouldAbortSpawn(true);
event.setCancelled(true);
return;
}
break;
case "SPAWNER":
if (!area.isMobSpawnerSpawning()) {
event.setShouldAbortSpawn(true);
event.setCancelled(true);
return;
}
break;
}
Plot plot = location.getOwnedPlotAbs();
if (plot == null) {
EntityType type = event.getType();
// PreCreatureSpawnEvent **should** not be called for DROPPED_ITEM, just for the sake of consistency
if (type == EntityType.DROPPED_ITEM) {
if (Settings.Enabled_Components.KILL_ROAD_ITEMS) {
event.setCancelled(true);
}
return;
}
if (!area.isMobSpawning()) {
if (type == EntityType.PLAYER) {
return;
}
if (type.isAlive()) {
event.setShouldAbortSpawn(true);
event.setCancelled(true);
}
}
if (!area.isMiscSpawnUnowned() && !type.isAlive()) {
event.setShouldAbortSpawn(true);
event.setCancelled(true);
}
return;
}
if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
event.setShouldAbortSpawn(true);
event.setCancelled(true);
}
}
@EventHandler
public void onPlayerNaturallySpawnCreaturesEvent(PlayerNaturallySpawnCreaturesEvent event) {
if (Settings.Paper_Components.CANCEL_CHUNK_SPAWN) {
Location location = BukkitUtil.adapt(event.getPlayer().getLocation());
PlotArea area = location.getPlotArea();
if (area != null && !area.isMobSpawning()) {
event.setCancelled(true);
}
}
}
@EventHandler
public void onPreSpawnerSpawnEvent(PreSpawnerSpawnEvent event) {
if (Settings.Paper_Components.SPAWNER_SPAWN) {
Location location = BukkitUtil.adapt(event.getSpawnerLocation());
PlotArea area = location.getPlotArea();
if (area != null && !area.isMobSpawnerSpawning()) {
event.setCancelled(true);
event.setShouldAbortSpawn(true);
}
}
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onBlockPlace(BlockPlaceEvent event) {
if (!Settings.Paper_Components.TILE_ENTITY_CHECK || !Settings.Enabled_Components.CHUNK_PROCESSOR) {
return;
}
if (!(event.getBlock().getState(false) instanceof TileState)) {
return;
}
final Location location = BukkitUtil.adapt(event.getBlock().getLocation());
final PlotArea plotArea = location.getPlotArea();
if (plotArea == null) {
return;
}
final int tileEntityCount = event.getBlock().getChunk().getTileEntities(false).length;
if (tileEntityCount >= Settings.Chunk_Processor.MAX_TILES) {
final PlotPlayer<?> plotPlayer = BukkitUtil.adapt(event.getPlayer());
plotPlayer.sendMessage(
TranslatableCaption.of("errors.tile_entity_cap_reached"),
Template.of("amount", String.valueOf(Settings.Chunk_Processor.MAX_TILES))
);
event.setCancelled(true);
event.setBuild(false);
}
}
/**
* Unsure if this will be any performance improvement over the spigot version,
* but here it is anyway :)
*
* @param event Paper's PlayerLaunchProjectileEvent
*/
@EventHandler
public void onProjectileLaunch(PlayerLaunchProjectileEvent event) {
if (!Settings.Paper_Components.PLAYER_PROJECTILE) {
return;
}
Projectile entity = event.getProjectile();
ProjectileSource shooter = entity.getShooter();
if (!(shooter instanceof Player)) {
return;
}
Location location = BukkitUtil.adapt(entity.getLocation());
PlotArea area = location.getPlotArea();
if (area == null) {
return;
}
PlotPlayer<Player> pp = BukkitUtil.adapt((Player) shooter);
Plot plot = location.getOwnedPlot();
if (plot == null) {
if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, ProjectilesFlag.class, true) && !pp.hasPermission(
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 (!pp.hasPermission(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 (!plot.getFlag(ProjectilesFlag.class)) {
if (!pp.hasPermission(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);
}
}
}
}
@EventHandler
public void onAsyncTabCompletion(final AsyncTabCompleteEvent event) {
if (!Settings.Paper_Components.ASYNC_TAB_COMPLETION) {
return;
}
String buffer = event.getBuffer();
if (!(event.getSender() instanceof Player)) {
return;
}
if ((!event.isCommand() && !buffer.startsWith("/")) || buffer.indexOf(' ') == -1) {
return;
}
if (buffer.startsWith("/")) {
buffer = buffer.substring(1);
}
final String[] unprocessedArgs = buffer.split(Pattern.quote(" "));
if (unprocessedArgs.length == 1) {
return; // We don't do anything in this case
} else if (!Settings.Enabled_Components.TAB_COMPLETED_ALIASES
.contains(unprocessedArgs[0].toLowerCase(Locale.ENGLISH))) {
return;
}
final String[] args = new String[unprocessedArgs.length - 1];
System.arraycopy(unprocessedArgs, 1, args, 0, args.length);
try {
final PlotPlayer<?> player = BukkitUtil.adapt((Player) event.getSender());
final Collection<Command> objects = MainCommand.getInstance().tab(player, args, buffer.endsWith(" "));
if (objects == null) {
return;
}
final List<String> result = new ArrayList<>();
for (final com.plotsquared.core.command.Command o : objects) {
result.add(o.toString());
}
event.setCompletions(result);
event.setHandled(true);
} catch (final Exception ignored) {
}
}
@EventHandler(ignoreCancelled = true)
public void onBeaconEffect(final BeaconEffectEvent event) {
Block block = event.getBlock();
Location beaconLocation = BukkitUtil.adapt(block.getLocation());
Plot beaconPlot = beaconLocation.getPlot();
PlotArea area = beaconLocation.getPlotArea();
if (area == null) {
return;
}
Player player = event.getPlayer();
Location playerLocation = BukkitUtil.adapt(player.getLocation());
PlotPlayer<Player> plotPlayer = BukkitUtil.adapt(player);
Plot playerStandingPlot = playerLocation.getPlot();
if (playerStandingPlot == null) {
FlagContainer container = area.getRoadFlagContainer();
if (!getBooleanFlagValue(container, BeaconEffectsFlag.class, true) ||
(beaconPlot != null && Settings.Enabled_Components.DISABLE_BEACON_EFFECT_OVERFLOW)) {
event.setCancelled(true);
}
return;
}
FlagContainer container = playerStandingPlot.getFlagContainer();
boolean plotBeaconEffects = getBooleanFlagValue(container, BeaconEffectsFlag.class, true);
if (playerStandingPlot.equals(beaconPlot)) {
if (!plotBeaconEffects) {
event.setCancelled(true);
}
return;
}
if (!plotBeaconEffects || Settings.Enabled_Components.DISABLE_BEACON_EFFECT_OVERFLOW) {
event.setCancelled(true);
}
}
private boolean getBooleanFlagValue(@NonNull FlagContainer container,
@NonNull Class<? extends BooleanFlag<?>> flagClass,
boolean defaultValue) {
BooleanFlag<?> flag = container.getFlag(flagClass);
return flag == null ? defaultValue : flag.getValue();
}
}

View File

@ -0,0 +1,91 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.listener;
import com.google.inject.Inject;
import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.world.PlotAreaManager;
import net.kyori.adventure.text.minimessage.Template;
import org.bukkit.block.Banner;
import org.bukkit.block.Beacon;
import org.bukkit.block.BlockState;
import org.bukkit.block.CommandBlock;
import org.bukkit.block.Comparator;
import org.bukkit.block.Conduit;
import org.bukkit.block.Container;
import org.bukkit.block.CreatureSpawner;
import org.bukkit.block.DaylightDetector;
import org.bukkit.block.EnchantingTable;
import org.bukkit.block.EndGateway;
import org.bukkit.block.EnderChest;
import org.bukkit.block.Jukebox;
import org.bukkit.block.Sign;
import org.bukkit.block.Skull;
import org.bukkit.block.Structure;
import org.bukkit.block.data.type.Bed;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.BlockPlaceEvent;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* @deprecated P2 effectively no longer supports 1.13
*/
@Deprecated(forRemoval = true, since = "6.10.4")
public class PaperListener113 extends PaperListener {
@Inject
public PaperListener113(@NonNull PlotAreaManager plotAreaManager) {
super(plotAreaManager);
}
@EventHandler
public void onBlockPlace(BlockPlaceEvent event) {
if (!Settings.Paper_Components.TILE_ENTITY_CHECK || !Settings.Enabled_Components.CHUNK_PROCESSOR) {
return;
}
BlockState state = event.getBlock().getState(false);
if (!(state instanceof Banner || state instanceof Beacon || state instanceof Bed || state instanceof CommandBlock
|| state instanceof Comparator || state instanceof Conduit || state instanceof Container || state instanceof CreatureSpawner
|| state instanceof DaylightDetector || state instanceof EnchantingTable || state instanceof EnderChest || state instanceof EndGateway
|| state instanceof Jukebox || state instanceof Sign || state instanceof Skull || state instanceof Structure)) {
return;
}
final Location location = BukkitUtil.adapt(event.getBlock().getLocation());
final PlotArea plotArea = location.getPlotArea();
if (plotArea == null) {
return;
}
final int tileEntityCount = event.getBlock().getChunk().getTileEntities(false).length;
if (tileEntityCount >= Settings.Chunk_Processor.MAX_TILES) {
final PlotPlayer<?> plotPlayer = BukkitUtil.adapt(event.getPlayer());
plotPlayer.sendMessage(
TranslatableCaption.of("errors.tile_entity_cap_reached"),
Template.of("amount", String.valueOf(Settings.Chunk_Processor.MAX_TILES))
);
event.setCancelled(true);
event.setBuild(false);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,208 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.listener;
import com.google.inject.Inject;
import com.plotsquared.bukkit.util.BukkitEntityUtil;
import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.PlotHandler;
import com.plotsquared.core.plot.flag.implementations.ProjectilesFlag;
import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.util.PlotFlagUtil;
import net.kyori.adventure.text.minimessage.Template;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.ThrownPotion;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.LingeringPotionSplashEvent;
import org.bukkit.event.entity.PotionSplashEvent;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.entity.ProjectileLaunchEvent;
import org.bukkit.projectiles.BlockProjectileSource;
import org.bukkit.projectiles.ProjectileSource;
import org.checkerframework.checker.nullness.qual.NonNull;
@SuppressWarnings("unused")
public class ProjectileEventListener implements Listener {
private final PlotAreaManager plotAreaManager;
@Inject
public ProjectileEventListener(final @NonNull PlotAreaManager plotAreaManager) {
this.plotAreaManager = plotAreaManager;
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onLingeringPotionSplash(LingeringPotionSplashEvent event) {
// Cancelling projectile hit events still results in area effect clouds.
// We need to cancel the splash events to get rid of those.
onProjectileHit(event);
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onPotionSplash(PotionSplashEvent event) {
ThrownPotion damager = event.getPotion();
Location location = BukkitUtil.adapt(damager.getLocation());
if (!this.plotAreaManager.hasPlotArea(location.getWorldName())) {
return;
}
int count = 0;
for (LivingEntity victim : event.getAffectedEntities()) {
if (!BukkitEntityUtil.entityDamage(damager, victim)) {
event.setIntensity(victim, 0);
count++;
}
}
if (count > 0 && count == event.getAffectedEntities().size()) {
event.setCancelled(true);
} else {
// Cancelling projectile hit events still results in potions
// splashing in the world. We need to cancel the splash events to
// avoid that.
onProjectileHit(event);
}
}
@EventHandler(ignoreCancelled = true)
public void onProjectileLaunch(ProjectileLaunchEvent event) {
Projectile entity = event.getEntity();
ProjectileSource shooter = entity.getShooter();
if (!(shooter instanceof Player)) {
return;
}
Location location = BukkitUtil.adapt(entity.getLocation());
PlotArea area = location.getPlotArea();
if (area == null) {
return;
}
PlotPlayer<Player> pp = BukkitUtil.adapt((Player) shooter);
Plot plot = location.getOwnedPlot();
if (plot == null) {
if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, ProjectilesFlag.class, true) && !pp.hasPermission(
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 (!pp.hasPermission(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 (!plot.getFlag(ProjectilesFlag.class)) {
if (!pp.hasPermission(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);
}
}
}
}
@EventHandler
public void onProjectileHit(ProjectileHitEvent event) {
Projectile entity = event.getEntity();
Location location = BukkitUtil.adapt(entity.getLocation());
if (!this.plotAreaManager.hasPlotArea(location.getWorldName())) {
return;
}
PlotArea area = location.getPlotArea();
if (area == null) {
return;
}
Plot plot = area.getPlot(location);
ProjectileSource shooter = entity.getShooter();
if (shooter instanceof Player) {
if (!((Player) shooter).isOnline()) {
if (plot != null) {
if (plot.isAdded(((Player) shooter).getUniqueId()) || plot.getFlag(ProjectilesFlag.class)) {
return;
}
} else if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, ProjectilesFlag.class, true)) {
return;
}
entity.remove();
event.setCancelled(true);
return;
}
PlotPlayer<?> pp = BukkitUtil.adapt((Player) shooter);
if (plot == null) {
if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, ProjectilesFlag.class, true) && !pp.hasPermission(
Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED
)) {
entity.remove();
event.setCancelled(true);
}
return;
}
if (plot.isAdded(pp.getUUID()) || pp.hasPermission(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER) || plot.getFlag(
ProjectilesFlag.class)) {
return;
}
entity.remove();
event.setCancelled(true);
return;
}
if (!(shooter instanceof Entity) && shooter != null) {
if (plot == null) {
entity.remove();
event.setCancelled(true);
return;
}
Location sLoc =
BukkitUtil.adapt(((BlockProjectileSource) shooter).getBlock().getLocation());
if (!area.contains(sLoc.getX(), sLoc.getZ())) {
entity.remove();
event.setCancelled(true);
return;
}
Plot sPlot = area.getOwnedPlotAbs(sLoc);
if (sPlot == null || !PlotHandler.sameOwners(plot, sPlot)) {
entity.remove();
event.setCancelled(true);
}
}
}
}

View File

@ -0,0 +1,50 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.listener;
import com.google.inject.Inject;
import com.plotsquared.bukkit.BukkitPlatform;
import com.plotsquared.bukkit.placeholder.MVdWPlaceholders;
import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.player.ConsolePlayer;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.server.ServerLoadEvent;
import org.checkerframework.checker.nullness.qual.NonNull;
public class ServerListener implements Listener {
private final BukkitPlatform plugin;
@Inject
public ServerListener(final @NonNull BukkitPlatform plugin) {
this.plugin = plugin;
}
@EventHandler
public void onServerLoad(ServerLoadEvent event) {
if (Bukkit.getPluginManager().getPlugin("MVdWPlaceholderAPI") != null && Settings.Enabled_Components.USE_MVDWAPI) {
new MVdWPlaceholders(this.plugin, this.plugin.placeholderRegistry());
ConsolePlayer.getConsole().sendMessage(TranslatableCaption.of("placeholder.hooked"));
}
}
}

View File

@ -0,0 +1,102 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.listener;
import com.plotsquared.core.PlotSquared;
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.util.ReflectionUtils;
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.world.ChunkEvent;
import org.bukkit.event.world.ChunkLoadEvent;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import static com.plotsquared.core.util.ReflectionUtils.getRefClass;
public class SingleWorldListener implements Listener {
private final Method methodGetHandleChunk;
private Field shouldSave = null;
public SingleWorldListener() throws Exception {
ReflectionUtils.RefClass classCraftChunk = getRefClass("{cb}.CraftChunk");
this.methodGetHandleChunk = classCraftChunk.getMethod("getHandle").getRealMethod();
try {
if (PlotSquared.platform().serverVersion()[1] < 17) {
ReflectionUtils.RefClass classChunk = getRefClass("{nms}.Chunk");
if (PlotSquared.platform().serverVersion()[1] == 13) {
this.shouldSave = classChunk.getField("mustSave").getRealField();
} else {
this.shouldSave = classChunk.getField("s").getRealField();
}
} else if (PlotSquared.platform().serverVersion()[1] == 17) {
ReflectionUtils.RefClass classChunk = getRefClass("net.minecraft.world.level.chunk.Chunk");
this.shouldSave = classChunk.getField("r").getRealField();
} else if (PlotSquared.platform().serverVersion()[1] == 18) {
ReflectionUtils.RefClass classChunk = getRefClass("net.minecraft.world.level.chunk.IChunkAccess");
this.shouldSave = classChunk.getField("b").getRealField();
}
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
public void markChunkAsClean(Chunk chunk) {
try {
Object nmsChunk = methodGetHandleChunk.invoke(chunk);
if (shouldSave != null) {
this.shouldSave.set(nmsChunk, false);
}
} catch (Throwable e) {
e.printStackTrace();
}
}
private void handle(ChunkEvent event) {
World world = event.getWorld();
String name = world.getName();
PlotAreaManager man = PlotSquared.get().getPlotAreaManager();
if (!(man instanceof SinglePlotAreaManager)) {
return;
}
if (!SinglePlotArea.isSinglePlotWorld(name)) {
return;
}
markChunkAsClean(event.getChunk());
}
// @EventHandler
// public void onPopulate(ChunkPopulateEvent event) {
// handle(event);
// }
@EventHandler(priority = EventPriority.LOWEST)
public void onChunkLoad(ChunkLoadEvent event) {
handle(event);
}
}

View File

@ -0,0 +1,57 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.listener;
import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.flag.FlagContainer;
import com.plotsquared.core.plot.flag.implementations.BeaconEffectsFlag;
import org.bukkit.entity.Entity;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityPotionEffectEvent;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Fallback listener for paper events on spigot
*/
public class SpigotListener implements Listener {
@EventHandler(ignoreCancelled = true)
public void onEffect(@NonNull EntityPotionEffectEvent event) {
if (event.getCause() != EntityPotionEffectEvent.Cause.BEACON) {
return;
}
Entity entity = event.getEntity();
Location location = BukkitUtil.adapt(entity.getLocation());
Plot plot = location.getPlot();
if (plot == null) {
return;
}
FlagContainer container = plot.getFlagContainer();
BeaconEffectsFlag effectsEnabled = container.getFlag(BeaconEffectsFlag.class);
if (effectsEnabled != null && !effectsEnabled.getValue()) {
event.setCancelled(true);
}
}
}

View File

@ -0,0 +1,63 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.listener;
import com.google.inject.Inject;
import com.plotsquared.bukkit.generator.BukkitPlotGenerator;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.generator.GeneratorWrapper;
import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.plot.world.SinglePlotAreaManager;
import org.bukkit.World;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.world.WorldInitEvent;
import org.bukkit.generator.ChunkGenerator;
import org.checkerframework.checker.nullness.qual.NonNull;
@SuppressWarnings("unused")
public class WorldEvents implements Listener {
private final PlotAreaManager plotAreaManager;
@Inject
public WorldEvents(final @NonNull PlotAreaManager plotAreaManager) {
this.plotAreaManager = plotAreaManager;
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onWorldInit(WorldInitEvent event) {
World world = event.getWorld();
String name = world.getName();
if (this.plotAreaManager instanceof final SinglePlotAreaManager single) {
if (single.isWorld(name)) {
world.setKeepSpawnInMemory(false);
return;
}
}
ChunkGenerator gen = world.getGenerator();
if (gen instanceof GeneratorWrapper) {
PlotSquared.get().loadWorld(name, (GeneratorWrapper<?>) gen);
} else {
PlotSquared.get().loadWorld(name, new BukkitPlotGenerator(name, gen, this.plotAreaManager));
}
}
}

View File

@ -1,288 +0,0 @@
package com.plotsquared.bukkit.listeners;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.util.ReflectionUtils.RefClass;
import com.intellectualcrafters.plot.util.ReflectionUtils.RefField;
import com.intellectualcrafters.plot.util.ReflectionUtils.RefMethod;
import com.intellectualcrafters.plot.util.TaskManager;
import java.lang.reflect.Method;
import java.util.HashSet;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.BlockState;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Item;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPhysicsEvent;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.world.ChunkLoadEvent;
import org.bukkit.event.world.ChunkUnloadEvent;
import static com.intellectualcrafters.plot.util.ReflectionUtils.getRefClass;
public class ChunkListener implements Listener {
private RefMethod methodGetHandleChunk;
private RefField mustSave;
private Chunk lastChunk;
public ChunkListener() {
if (Settings.Chunk_Processor.AUTO_TRIM) {
try {
RefClass classChunk = getRefClass("{nms}.Chunk");
RefClass classCraftChunk = getRefClass("{cb}.CraftChunk");
this.mustSave = classChunk.getField("mustSave");
this.methodGetHandleChunk = classCraftChunk.getMethod("getHandle");
} catch (Throwable ignored) {
PS.debug(PS.imp().getPluginName() + "/Server not compatible for chunk processor trim/gc");
Settings.Chunk_Processor.AUTO_TRIM = false;
}
}
if (!Settings.Chunk_Processor.AUTO_TRIM) {
return;
}
for (World world : Bukkit.getWorlds()) {
world.setAutoSave(false);
}
TaskManager.runTaskRepeat(new Runnable() {
@Override
public void run() {
try {
HashSet<Chunk> toUnload = new HashSet<>();
for (World world : Bukkit.getWorlds()) {
String worldName = world.getName();
if (!PS.get().hasPlotArea(worldName)) {
continue;
}
Object w = world.getClass().getDeclaredMethod("getHandle").invoke(world);
Object chunkMap = w.getClass().getDeclaredMethod("getPlayerChunkMap").invoke(w);
Method methodIsChunkInUse = chunkMap.getClass().getDeclaredMethod("isChunkInUse", int.class, int.class);
Chunk[] chunks = world.getLoadedChunks();
for (Chunk chunk : chunks) {
if ((boolean) methodIsChunkInUse.invoke(chunkMap, chunk.getX(), chunk.getZ())) {
continue;
}
int x = chunk.getX();
int z = chunk.getZ();
if (!shouldSave(worldName, x, z)) {
unloadChunk(worldName, chunk, false);
continue;
}
toUnload.add(chunk);
}
}
if (toUnload.isEmpty()) {
return;
}
long start = System.currentTimeMillis();
for (Chunk chunk : toUnload) {
if (System.currentTimeMillis() - start > 5) {
return;
}
chunk.unload(true, false);
}
} catch (Throwable e) {
e.printStackTrace();
}
}
}, 1);
}
private boolean ignoreUnload = false;
public boolean unloadChunk(String world, Chunk chunk, boolean safe) {
if (safe && shouldSave(world, chunk.getX(), chunk.getZ())) {
return false;
}
Object c = this.methodGetHandleChunk.of(chunk).call();
RefField.RefExecutor field = this.mustSave.of(c);
if ((Boolean) field.get() == true) {
field.set(false);
if (chunk.isLoaded()) {
ignoreUnload = true;
chunk.unload(false, false);
ignoreUnload = false;
}
}
return true;
}
public boolean shouldSave(String world, int X, int Z) {
int x = X << 4;
int z = Z << 4;
int x2 = x + 15;
int z2 = z + 15;
Plot plot = new Location(world, x, 1, z).getOwnedPlotAbs();
if (plot != null && plot.hasOwner()) {
return true;
}
plot = new Location(world, x2, 1, z2).getOwnedPlotAbs();
if (plot != null && plot.hasOwner()) {
return true;
}
plot = new Location(world, x2, 1, z).getOwnedPlotAbs();
if (plot != null && plot.hasOwner()) {
return true;
}
plot = new Location(world, x, 1, z2).getOwnedPlotAbs();
if (plot != null && plot.hasOwner()) {
return true;
}
plot = new Location(world, x + 7, 1, z + 7).getOwnedPlotAbs();
return plot != null && plot.hasOwner();
}
@EventHandler
public void onChunkUnload(ChunkUnloadEvent event) {
if (ignoreUnload) {
return;
}
if (Settings.Chunk_Processor.AUTO_TRIM) {
Chunk chunk = event.getChunk();
String world = chunk.getWorld().getName();
if (PS.get().hasPlotArea(world)) {
if (unloadChunk(world, chunk, true)) {
return;
}
}
}
if (processChunk(event.getChunk(), true)) {
event.setCancelled(true);
}
}
@EventHandler
public void onChunkLoad(ChunkLoadEvent event) {
processChunk(event.getChunk(), false);
}
@EventHandler(priority = EventPriority.LOWEST)
public void onItemSpawn(ItemSpawnEvent event) {
Item entity = event.getEntity();
Chunk chunk = entity.getLocation().getChunk();
if (chunk == this.lastChunk) {
event.getEntity().remove();
event.setCancelled(true);
return;
}
if (!PS.get().hasPlotArea(chunk.getWorld().getName())) {
return;
}
Entity[] entities = chunk.getEntities();
if (entities.length > Settings.Chunk_Processor.MAX_ENTITIES) {
event.getEntity().remove();
event.setCancelled(true);
this.lastChunk = chunk;
} else {
this.lastChunk = null;
}
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockPhysics(BlockPhysicsEvent event) {
if (Settings.Chunk_Processor.DISABLE_PHYSICS) {
event.setCancelled(true);
}
}
@EventHandler(priority = EventPriority.LOWEST)
public void onEntitySpawn(CreatureSpawnEvent event) {
LivingEntity entity = event.getEntity();
Chunk chunk = entity.getLocation().getChunk();
if (chunk == this.lastChunk) {
event.getEntity().remove();
event.setCancelled(true);
return;
}
if (!PS.get().hasPlotArea(chunk.getWorld().getName())) {
return;
}
Entity[] entities = chunk.getEntities();
if (entities.length > Settings.Chunk_Processor.MAX_ENTITIES) {
event.getEntity().remove();
event.setCancelled(true);
this.lastChunk = chunk;
} else {
this.lastChunk = null;
}
}
private void cleanChunk(final Chunk chunk) {
TaskManager.index.incrementAndGet();
final Integer currentIndex = TaskManager.index.get();
Integer task = TaskManager.runTaskRepeat(new Runnable() {
@Override
public void run() {
if (!chunk.isLoaded()) {
Bukkit.getScheduler().cancelTask(TaskManager.tasks.get(currentIndex));
TaskManager.tasks.remove(currentIndex);
PS.debug(C.PREFIX.s() + "&aSuccessfully processed and unloaded chunk!");
chunk.unload(true, true);
return;
}
BlockState[] tiles = chunk.getTileEntities();
if (tiles.length == 0) {
Bukkit.getScheduler().cancelTask(TaskManager.tasks.get(currentIndex));
TaskManager.tasks.remove(currentIndex);
PS.debug(C.PREFIX.s() + "&aSuccessfully processed and unloaded chunk!");
chunk.unload(true, true);
return;
}
long start = System.currentTimeMillis();
int i = 0;
while (System.currentTimeMillis() - start < 250) {
if (i >= tiles.length) {
Bukkit.getScheduler().cancelTask(TaskManager.tasks.get(currentIndex));
TaskManager.tasks.remove(currentIndex);
PS.debug(C.PREFIX.s() + "&aSuccessfully processed and unloaded chunk!");
chunk.unload(true, true);
return;
}
tiles[i].getBlock().setType(Material.AIR, false);
i++;
}
}
}, 5);
TaskManager.tasks.put(currentIndex, task);
}
public boolean processChunk(Chunk chunk, boolean unload) {
if (!PS.get().hasPlotArea(chunk.getWorld().getName())) {
return false;
}
Entity[] entities = chunk.getEntities();
BlockState[] tiles = chunk.getTileEntities();
if (entities.length > Settings.Chunk_Processor.MAX_ENTITIES) {
for (Entity ent : entities) {
if (!(ent instanceof Player)) {
ent.remove();
}
}
PS.debug(C.PREFIX.s() + "&a detected unsafe chunk and processed: " + (chunk.getX() << 4) + "," + (chunk.getX() << 4));
}
if (tiles.length > Settings.Chunk_Processor.MAX_TILES) {
if (unload) {
PS.debug(C.PREFIX.s() + "&c detected unsafe chunk: " + (chunk.getX() << 4) + "," + (chunk.getX() << 4));
cleanChunk(chunk);
return true;
}
for (BlockState tile : tiles) {
tile.getBlock().setType(Material.AIR, false);
}
}
return false;
}
}

View File

@ -1,44 +0,0 @@
package com.plotsquared.bukkit.listeners;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.flag.Flags;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotArea;
import com.plotsquared.bukkit.util.BukkitUtil;
import org.bukkit.entity.Entity;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntitySpawnEvent;
public class EntitySpawnListener implements Listener {
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void creatureSpawnEvent(EntitySpawnEvent event) {
Entity entity = event.getEntity();
Location location = BukkitUtil.getLocation(entity.getLocation());
PlotArea area = location.getPlotArea();
if (area == null) {
return;
}
Plot plot = area.getOwnedPlotAbs(location);
if (plot == null) {
return;
}
if (Settings.Done.RESTRICT_BUILDING && plot.hasFlag(Flags.DONE)) {
event.setCancelled(true);
}
switch (entity.getType()) {
case ENDER_CRYSTAL:
if (plot == null) {
if (!area.MOB_SPAWNING) {
event.setCancelled(true);
}
return;
}
if (PlayerEvents.checkEntity(entity, plot)) {
event.setCancelled(true);
}
}
}
}

View File

@ -1,93 +0,0 @@
package com.plotsquared.bukkit.listeners;
import com.google.common.collect.Iterables;
import com.intellectualcrafters.plot.flag.Flags;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.plotsquared.bukkit.object.BukkitPlayer;
import com.plotsquared.bukkit.util.BukkitUtil;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
public class ForceFieldListener {
private static Set<PlotPlayer> getNearbyPlayers(Player player, Plot plot) {
Set<PlotPlayer> players = new HashSet<>();
for (Player nearPlayer : Iterables.filter(player.getNearbyEntities(5d, 5d, 5d),Player.class)) {
PlotPlayer plotPlayer;
if ((plotPlayer = BukkitUtil.getPlayer(nearPlayer)) == null || !plot.equals(plotPlayer.getCurrentPlot())) {
continue;
}
if (!plot.isAdded(plotPlayer.getUUID())) {
players.add(plotPlayer);
}
}
return players;
}
private static PlotPlayer hasNearbyPermitted(Player player, Plot plot) {
for (Player nearPlayer : Iterables.filter(player.getNearbyEntities(5d, 5d, 5d),Player.class)) {
PlotPlayer plotPlayer;
if ((plotPlayer = BukkitUtil.getPlayer(nearPlayer)) == null || !plot.equals(plotPlayer.getCurrentPlot())) {
continue;
}
if (plot.isAdded(plotPlayer.getUUID())) {
return plotPlayer;
}
}
return null;
}
private static Vector calculateVelocity(PlotPlayer player, PlotPlayer e) {
Location playerLocation = player.getLocationFull();
Location oPlayerLocation = e.getLocation();
double playerX = playerLocation.getX();
double playerY = playerLocation.getY();
double playerZ = playerLocation.getZ();
double oPlayerX = oPlayerLocation.getX();
double oPlayerY = oPlayerLocation.getY();
double oPlayerZ = oPlayerLocation.getZ();
double x = 0d;
if (playerX < oPlayerX) {
x = 1.0d;
} else if (playerX > oPlayerX) {
x = -1.0d;
}
double y = 0d;
if (playerY < oPlayerY) {
y = 0.5d;
} else if (playerY > oPlayerY) {
y = -0.5d;
}
double z = 0d;
if (playerZ < oPlayerZ) {
z = 1.0d;
} else if (playerZ > oPlayerZ) {
z = -1.0d;
}
return new Vector(x, y, z);
}
public static void handleForcefield(Player player, PlotPlayer plotPlayer, Plot plot) {
if (Flags.FORCEFIELD.isTrue(plot)) {
UUID uuid = plotPlayer.getUUID();
if (plot.isAdded(uuid)) {
Set<PlotPlayer> players = getNearbyPlayers(player, plot);
for (PlotPlayer oPlayer : players) {
((BukkitPlayer) oPlayer).player.setVelocity(calculateVelocity(plotPlayer, oPlayer));
}
} else {
PlotPlayer oPlayer = hasNearbyPermitted(player, plot);
if (oPlayer == null) {
return;
}
player.setVelocity(calculateVelocity(oPlayer, plotPlayer));
}
}
}
}

View File

@ -1,49 +0,0 @@
package com.plotsquared.bukkit.listeners;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.flag.Flags;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotArea;
import com.plotsquared.bukkit.util.BukkitUtil;
import org.bukkit.block.Block;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockExplodeEvent;
import java.util.Iterator;
public class PlayerEvents183 implements Listener {
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBigBoom(BlockExplodeEvent event) {
Block block = event.getBlock();
Location location = BukkitUtil.getLocation(block.getLocation());
String world = location.getWorld();
if (!PS.get().hasPlotArea(world)) {
return;
}
PlotArea area = location.getPlotArea();
if (area == null) {
Iterator<Block> iterator = event.blockList().iterator();
while (iterator.hasNext()) {
location = BukkitUtil.getLocation(iterator.next().getLocation());
if (location.getPlotArea() != null) {
iterator.remove();
}
}
return;
}
Plot plot = area.getOwnedPlot(location);
if (plot == null || !plot.getFlag(Flags.EXPLOSION).or(false)) {
event.setCancelled(true);
}
Iterator<Block> iterator = event.blockList().iterator();
while (iterator.hasNext()) {
Block b = iterator.next();
if (!plot.equals(area.getOwnedPlot(BukkitUtil.getLocation(b.getLocation())))) {
iterator.remove();
}
}
}
}

View File

@ -1,155 +0,0 @@
package com.plotsquared.bukkit.listeners;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.flag.Flags;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotArea;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions;
import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.listener.PlotListener;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Entity;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.HashSet;
import java.util.List;
import java.util.UUID;
public class PlayerEvents_1_8 extends PlotListener implements Listener {
@SuppressWarnings("deprecation")
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onInventoryClick(InventoryClickEvent event) {
if (!event.isLeftClick() || (event.getAction() != InventoryAction.PLACE_ALL) || event.isShiftClick()) {
return;
}
HumanEntity entity = event.getWhoClicked();
if (!(entity instanceof Player) || !PS.get().hasPlotArea(entity.getWorld().getName())) {
return;
}
Player player = (Player) entity;
PlayerInventory inv = player.getInventory();
int slot = inv.getHeldItemSlot();
if ((slot != event.getSlot()) || (slot > 8) || !event.getEventName().equals("InventoryCreativeEvent")) {
return;
}
ItemStack current = inv.getItemInHand();
ItemStack newItem = event.getCursor();
ItemMeta newMeta = newItem.getItemMeta();
ItemMeta oldMeta = newItem.getItemMeta();
String newLore = "";
if (newMeta != null) {
List<String> lore = newMeta.getLore();
if (lore != null) {
newLore = lore.toString();
}
}
String oldLore = "";
if (oldMeta != null) {
List<String> lore = oldMeta.getLore();
if (lore != null) {
oldLore = lore.toString();
}
}
if (!"[(+NBT)]".equals(newLore) || (current.equals(newItem) && newLore.equals(oldLore))) {
return;
}
HashSet<Byte> blocks = null;
Block block = player.getTargetBlock(blocks, 7);
BlockState state = block.getState();
if (state == null) {
return;
}
if (state.getType() != newItem.getType()) {
return;
}
Location l = BukkitUtil.getLocation(state.getLocation());
PlotArea area = l.getPlotArea();
if (area == null) {
return;
}
Plot plot = area.getPlotAbs(l);
PlotPlayer pp = BukkitUtil.getPlayer(player);
boolean cancelled = false;
if (plot == null) {
if (!Permissions.hasPermission(pp, "plots.admin.interact.road")) {
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, "plots.admin.interact.road");
cancelled = true;
}
} else if (!plot.hasOwner()) {
if (!Permissions.hasPermission(pp, "plots.admin.interact.unowned")) {
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, "plots.admin.interact.unowned");
cancelled = true;
}
} else {
UUID uuid = pp.getUUID();
if (!plot.isAdded(uuid)) {
if (!Permissions.hasPermission(pp, "plots.admin.interact.other")) {
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, "plots.admin.interact.other");
cancelled = true;
}
}
}
if (cancelled) {
if ((current.getType() == newItem.getType()) && (current.getDurability() == newItem.getDurability())) {
event.setCursor(new ItemStack(newItem.getType(), newItem.getAmount(), newItem.getDurability()));
event.setCancelled(true);
return;
}
event.setCursor(new ItemStack(newItem.getType(), newItem.getAmount(), newItem.getDurability()));
}
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onInteract(PlayerInteractAtEntityEvent e) {
Entity entity = e.getRightClicked();
if (!(entity instanceof ArmorStand)) {
return;
}
Location l = BukkitUtil.getLocation(e.getRightClicked().getLocation());
PlotArea area = l.getPlotArea();
if (area == null) {
return;
}
Plot plot = area.getPlotAbs(l);
PlotPlayer pp = BukkitUtil.getPlayer(e.getPlayer());
if (plot == null) {
if (!Permissions.hasPermission(pp, "plots.admin.interact.road")) {
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, "plots.admin.interact.road");
e.setCancelled(true);
}
} else if (!plot.hasOwner()) {
if (!Permissions.hasPermission(pp, "plots.admin.interact.unowned")) {
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, "plots.admin.interact.unowned");
e.setCancelled(true);
}
} else {
UUID uuid = pp.getUUID();
if (!plot.isAdded(uuid)) {
if (Flags.MISC_INTERACT.isTrue(plot)) {
return;
}
if (!Permissions.hasPermission(pp, "plots.admin.interact.other")) {
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, "plots.admin.interact.other");
e.setCancelled(true);
}
}
}
}
}

View File

@ -1,31 +0,0 @@
package com.plotsquared.bukkit.listeners;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.object.Location;
import com.plotsquared.bukkit.util.BukkitUtil;
import org.bukkit.entity.LingeringPotion;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.LingeringPotionSplashEvent;
public class PlayerEvents_1_9 implements Listener {
private final PlayerEvents parent;
public PlayerEvents_1_9(PlayerEvents parent) {
this.parent = parent;
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onPotionSplash(LingeringPotionSplashEvent event) {
LingeringPotion entity = event.getEntity();
Location l = BukkitUtil.getLocation(entity);
if (!PS.get().hasPlotArea(l.getWorld())) {
return;
}
if (!parent.onProjectileHit(event)) {
event.setCancelled(true);
}
}
}

View File

@ -1,198 +0,0 @@
package com.plotsquared.bukkit.listeners;
import com.google.common.base.Optional;
import com.intellectualcrafters.plot.flag.Flags;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.plotsquared.bukkit.events.PlayerEnterPlotEvent;
import com.plotsquared.bukkit.events.PlayerLeavePlotEvent;
import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.listener.PlotListener;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.block.Block;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockDamageEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.plugin.java.JavaPlugin;
public class PlotPlusListener extends PlotListener implements Listener {
private static final HashMap<String, Interval> feedRunnable = new HashMap<>();
private static final HashMap<String, Interval> healRunnable = new HashMap<>();
public static void startRunnable(JavaPlugin plugin) {
plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {
@Override
public void run() {
if (!healRunnable.isEmpty()) {
for (Iterator<Entry<String, Interval>> iterator = healRunnable.entrySet().iterator(); iterator.hasNext(); ) {
Entry<String, Interval> entry = iterator.next();
Interval value = entry.getValue();
++value.count;
if (value.count == value.interval) {
value.count = 0;
Player player = Bukkit.getPlayer(entry.getKey());
if (player == null) {
iterator.remove();
continue;
}
double level = player.getHealth();
if (level != value.max) {
player.setHealth(Math.min(level + value.amount, value.max));
}
}
}
}
if (!feedRunnable.isEmpty()) {
for (Iterator<Entry<String, Interval>> iterator = feedRunnable.entrySet().iterator(); iterator.hasNext(); ) {
Entry<String, Interval> entry = iterator.next();
Interval value = entry.getValue();
++value.count;
if (value.count == value.interval) {
value.count = 0;
Player player = Bukkit.getPlayer(entry.getKey());
if (player == null) {
iterator.remove();
continue;
}
int level = player.getFoodLevel();
if (level != value.max) {
player.setFoodLevel(Math.min(level + value.amount, value.max));
}
}
}
}
}
}, 0L, 20L);
}
@EventHandler(priority = EventPriority.HIGH)
public void onInteract(BlockDamageEvent event) {
Player player = event.getPlayer();
if (player.getGameMode() != GameMode.SURVIVAL) {
return;
}
Plot plot = BukkitUtil.getLocation(player).getOwnedPlot();
if (plot == null) {
return;
}
if (Flags.INSTABREAK.isTrue(plot)) {
Block block = event.getBlock();
BlockBreakEvent call = new BlockBreakEvent(block, player);
Bukkit.getServer().getPluginManager().callEvent(call);
if (!call.isCancelled()) {
event.getBlock().breakNaturally();
}
}
}
@EventHandler(priority = EventPriority.HIGH)
public void onDamage(EntityDamageEvent event) {
if (event.getEntityType() != EntityType.PLAYER) {
return;
}
Player player = (Player) event.getEntity();
Plot plot = BukkitUtil.getLocation(player).getOwnedPlot();
if (plot == null) {
return;
}
if (Flags.INVINCIBLE.isTrue(plot)) {
event.setCancelled(true);
}
}
@EventHandler
public void onItemPickup(PlayerPickupItemEvent event) {
Player player = event.getPlayer();
PlotPlayer pp = BukkitUtil.getPlayer(player);
Plot plot = BukkitUtil.getLocation(player).getOwnedPlot();
if (plot == null) {
return;
}
UUID uuid = pp.getUUID();
if (plot.isAdded(uuid) && Flags.DROP_PROTECTION.isTrue(plot)) {
event.setCancelled(true);
}
}
@EventHandler
public void onItemDrop(PlayerDropItemEvent event) {
Player player = event.getPlayer();
PlotPlayer pp = BukkitUtil.getPlayer(player);
Plot plot = BukkitUtil.getLocation(player).getOwnedPlot();
if (plot == null) {
return;
}
UUID uuid = pp.getUUID();
if (!plot.isAdded(uuid)) {
if (Flags.ITEM_DROP.isFalse(plot)) {
event.setCancelled(true);
}
}
}
@EventHandler
public void onPlotEnter(PlayerEnterPlotEvent event) {
Player player = event.getPlayer();
Plot plot = event.getPlot();
Optional<Integer[]> feed = plot.getFlag(Flags.FEED);
if (feed.isPresent()) {
Integer[] value = feed.get();
feedRunnable.put(player.getName(), new Interval(value[0], value[1], 20));
}
Optional<Integer[]> heal = plot.getFlag(Flags.HEAL);
if (heal.isPresent()) {
Integer[] value = heal.get();
healRunnable.put(player.getName(), new Interval(value[0], value[1], 20));
}
}
@EventHandler
public void onPlayerQuit(PlayerQuitEvent event) {
Player player = event.getPlayer();
String name = player.getName();
feedRunnable.remove(name);
healRunnable.remove(name);
}
@EventHandler
public void onPlotLeave(PlayerLeavePlotEvent event) {
Player leaver = event.getPlayer();
Plot plot = event.getPlot();
if (!plot.hasOwner()) {
return;
}
BukkitUtil.getPlayer(leaver);
String name = leaver.getName();
feedRunnable.remove(name);
healRunnable.remove(name);
}
private static class Interval {
final int interval;
final int amount;
final int max;
public int count = 0;
Interval(int interval, int amount, int max) {
this.interval = interval;
this.amount = amount;
this.max = max;
}
}
}

View File

@ -1,26 +0,0 @@
package com.plotsquared.bukkit.listeners;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.generator.GeneratorWrapper;
import com.plotsquared.bukkit.generator.BukkitPlotGenerator;
import org.bukkit.World;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.world.WorldInitEvent;
import org.bukkit.generator.ChunkGenerator;
public class WorldEvents implements Listener {
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onWorldInit(WorldInitEvent event) {
World world = event.getWorld();
String name = world.getName();
ChunkGenerator gen = world.getGenerator();
if (gen instanceof GeneratorWrapper) {
PS.get().loadWorld(name, (GeneratorWrapper<?>) gen);
} else {
PS.get().loadWorld(name, new BukkitPlotGenerator(name, gen));
}
}
}

View File

@ -0,0 +1,89 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.managers;
import com.google.inject.Singleton;
import com.plotsquared.core.configuration.file.YamlConfiguration;
import com.plotsquared.core.util.PlatformWorldManager;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.WorldCreator;
import org.bukkit.WorldType;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* Default Bukkit world manager. It will handle world creation by
* registering the generator in bukkit.yml
*/
@Singleton
public class BukkitWorldManager implements PlatformWorldManager<World> {
@Override
public void initialize() {
}
@Override
public @Nullable World handleWorldCreation(@NonNull String worldName, @Nullable String generator) {
this.setGenerator(worldName, generator);
final WorldCreator wc = new WorldCreator(worldName);
wc.environment(World.Environment.NORMAL);
if (generator != null) {
wc.generator(generator);
wc.type(WorldType.FLAT);
}
return Bukkit.createWorld(wc);
}
protected void setGenerator(final @Nullable String worldName, final @Nullable String generator) {
if (generator == null) {
return;
}
File file = new File("bukkit.yml").getAbsoluteFile();
YamlConfiguration yml = YamlConfiguration.loadConfiguration(file);
yml.set(String.format("worlds.%s.generator", worldName), generator);
try {
yml.save(file);
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public String getName() {
return "bukkit";
}
@Override
public Collection<String> getWorlds() {
final List<World> worlds = Bukkit.getWorlds();
final List<String> worldNames = new ArrayList<>();
for (final World world : worlds) {
worldNames.add(world.getName());
}
return worldNames;
}
}

View File

@ -0,0 +1,63 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.managers;
/*
import com.google.inject.Singleton;
import org.bukkit.World;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import se.hyperver.hyperverse.Hyperverse;
import se.hyperver.hyperverse.world.WorldConfiguration;
import se.hyperver.hyperverse.world.WorldConfigurationBuilder;
import se.hyperver.hyperverse.world.WorldFeatures;
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
repository.
@Singleton
public class HyperverseWorldManager extends BukkitWorldManager {
@Override
public @Nullable World handleWorldCreation(@NonNull String worldName, @Nullable String generator) {
// First let Bukkit register the world
this.setGenerator(worldName, generator);
// Create the world
final WorldConfigurationBuilder worldConfigurationBuilder = WorldConfiguration.builder()
.setName(worldName).setType(WorldType.OVER_WORLD);
if (generator != null) {
worldConfigurationBuilder.setGenerator(generator).setWorldFeatures(WorldFeatures.FLATLAND);
}
try {
return Hyperverse.getApi().createWorld(worldConfigurationBuilder.createWorldConfiguration())
.getBukkitWorld();
} catch (final Exception e) {
e.printStackTrace();
}
return null;
}
@Override
public String getName() {
return "bukkit-hyperverse";
}
}
*/

View File

@ -0,0 +1,58 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.bukkit.managers;
import com.google.inject.Singleton;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
/**
* Multiverse specific manager that informs Multiverse of
* world creation by executing a console command
*
* @deprecated Deprecated and scheduled for removal without replacement
* in favor of the build in setup wizard.
* However, this class will be kept around for a while, given it's not a maintenance burden.
*/
@Deprecated
@Singleton
public class MultiverseWorldManager extends BukkitWorldManager {
@Override
public @Nullable World handleWorldCreation(final @NonNull String worldName, final @Nullable String generator) {
// First let Bukkit register the world
this.setGenerator(worldName, generator);
// Then we send the console command
final StringBuilder commandBuilder = new StringBuilder("mv create ")
.append(worldName).append(" normal");
if (generator != null) {
commandBuilder.append(" -g ").append(generator);
}
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), commandBuilder.toString());
return Bukkit.getWorld(worldName);
}
@Override
public String getName() {
return "bukkit-multiverse";
}
}

View File

@ -1,138 +0,0 @@
package com.plotsquared.bukkit.object;
import com.intellectualcrafters.plot.object.LazyBlock;
import com.intellectualcrafters.plot.object.PlotBlock;
import org.bukkit.block.Block;
public class BukkitLazyBlock extends LazyBlock {
private int id;
private Block block;
private PlotBlock pb;
public BukkitLazyBlock(int id, Block block) {
this.id = id;
this.block = block;
}
public BukkitLazyBlock(PlotBlock pb) {
this.id = pb.id;
this.pb = pb;
}
public BukkitLazyBlock(Block block) {
this.block = block;
}
@Override
public PlotBlock getPlotBlock() {
if (this.pb != null) {
return this.pb;
}
if (this.id == 0) {
this.id = this.block.getTypeId();
}
byte data;
switch (this.id) {
case 0:
case 2:
case 4:
case 13:
case 14:
case 15:
case 20:
case 21:
case 22:
case 24:
case 25:
case 30:
case 32:
case 37:
case 39:
case 40:
case 41:
case 42:
case 45:
case 46:
case 47:
case 48:
case 49:
case 51:
case 52:
case 54:
case 55:
case 56:
case 57:
case 58:
case 60:
case 61:
case 62:
case 7:
case 8:
case 9:
case 10:
case 11:
case 73:
case 74:
case 78:
case 79:
case 80:
case 81:
case 82:
case 83:
case 84:
case 85:
case 87:
case 88:
case 101:
case 102:
case 103:
case 110:
case 112:
case 113:
case 117:
case 121:
case 122:
case 123:
case 124:
case 129:
case 133:
case 138:
case 137:
case 140:
case 165:
case 166:
case 169:
case 170:
case 172:
case 173:
case 174:
case 176:
case 177:
case 181:
case 182:
case 188:
case 189:
case 190:
case 191:
case 192:
data = 0;
break;
default:
data = this.block.getData();
break;
}
this.pb = PlotBlock.get((short) this.id, data);
return this.pb;
}
@Override
public int getId() {
if (this.id == 0) {
this.id = this.block.getTypeId();
}
return this.id;
}
}

View File

@ -1,41 +0,0 @@
package com.plotsquared.bukkit.object;
import com.intellectualcrafters.plot.object.OfflinePlotPlayer;
import org.bukkit.OfflinePlayer;
import java.util.UUID;
public class BukkitOfflinePlayer implements OfflinePlotPlayer {
public final OfflinePlayer player;
/**
* Please do not use this method. Instead use BukkitUtil.getPlayer(Player),
* as it caches player objects.
*
* @param player
*/
public BukkitOfflinePlayer(OfflinePlayer player) {
this.player = player;
}
@Override
public UUID getUUID() {
return this.player.getUniqueId();
}
@Override
public long getLastPlayed() {
return this.player.getLastPlayed();
}
@Override
public boolean isOnline() {
return this.player.isOnline();
}
@Override
public String getName() {
return this.player.getName();
}
}

View File

@ -1,244 +0,0 @@
package com.plotsquared.bukkit.object;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.EconHandler;
import com.intellectualcrafters.plot.util.PlotGameMode;
import com.intellectualcrafters.plot.util.PlotWeather;
import com.intellectualcrafters.plot.util.StringMan;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.plotsquared.bukkit.util.BukkitUtil;
import org.bukkit.Effect;
import org.bukkit.GameMode;
import org.bukkit.WeatherType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventException;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
import java.util.UUID;
import org.bukkit.plugin.RegisteredListener;
public class BukkitPlayer extends PlotPlayer {
public final Player player;
public boolean offline;
private UUID uuid;
private String name;
/**
* <p>Please do not use this method. Instead use
* BukkitUtil.getPlayer(Player), as it caches player objects.</p>
* @param player
*/
public BukkitPlayer(Player player) {
this.player = player;
super.populatePersistentMetaMap();
}
public BukkitPlayer(Player player, boolean offline) {
this.player = player;
this.offline = offline;
super.populatePersistentMetaMap();
}
@Override
public Location getLocation() {
Location location = super.getLocation();
return location == null ? BukkitUtil.getLocation(this.player) : location;
}
@Override
public UUID getUUID() {
if (this.uuid == null) {
this.uuid = UUIDHandler.getUUID(this);
}
return this.uuid;
}
@Override public long getLastPlayed() {
return this.player.getLastPlayed();
}
@Override
public boolean canTeleport(Location loc) {
org.bukkit.Location to = BukkitUtil.getLocation(loc);
org.bukkit.Location from = player.getLocation();
PlayerTeleportEvent event = new PlayerTeleportEvent(player, from, to);
RegisteredListener[] listeners = event.getHandlers().getRegisteredListeners();
for (RegisteredListener listener : listeners) {
if (listener.getPlugin().getName().equals(PS.imp().getPluginName())) {
continue;
}
try {
listener.callEvent(event);
} catch (EventException e) {
e.printStackTrace();
}
}
if (event.isCancelled() || !event.getTo().equals(to)) {
return false;
}
event = new PlayerTeleportEvent(player, to, from);
for (RegisteredListener listener : listeners) {
if (listener.getPlugin().getName().equals(PS.imp().getPluginName())) {
continue;
}
try {
listener.callEvent(event);
} catch (EventException e) {
e.printStackTrace();
}
}
return true;
}
@Override
public boolean hasPermission(String permission) {
if (this.offline && EconHandler.manager != null) {
return EconHandler.manager.hasPermission(getName(), permission);
}
return this.player.hasPermission(permission);
}
@Override
public void sendMessage(String message) {
if (!StringMan.isEqual(this.<String>getMeta("lastMessage"), message) || (System.currentTimeMillis() - this.<Long>getMeta("lastMessageTime") > 5000)) {
setMeta("lastMessage", message);
setMeta("lastMessageTime", System.currentTimeMillis());
this.player.sendMessage(message);
}
}
@Override
public void teleport(Location location) {
if (Math.abs(location.getX()) >= 30000000 || Math.abs(location.getZ()) >= 30000000) {
return;
}
this.player.teleport(
new org.bukkit.Location(BukkitUtil.getWorld(location.getWorld()), location.getX() + 0.5, location.getY(), location.getZ() + 0.5,
location.getYaw(), location.getPitch()), TeleportCause.COMMAND);
}
@Override
public String getName() {
if (this.name == null) {
this.name = this.player.getName();
}
return this.name;
}
@Override
public boolean isOnline() {
return !this.offline && this.player.isOnline();
}
@Override
public void setCompassTarget(Location location) {
this.player.setCompassTarget(
new org.bukkit.Location(BukkitUtil.getWorld(location.getWorld()), location.getX(), location.getY(), location.getZ()));
}
@Override
public Location getLocationFull() {
return BukkitUtil.getLocationFull(this.player);
}
@Override
public void setWeather(PlotWeather weather) {
switch (weather) {
case CLEAR:
this.player.setPlayerWeather(WeatherType.CLEAR);
break;
case RAIN:
this.player.setPlayerWeather(WeatherType.DOWNFALL);
break;
case RESET:
this.player.resetPlayerWeather();
break;
default:
this.player.resetPlayerWeather();
break;
}
}
@Override
public PlotGameMode getGameMode() {
switch (this.player.getGameMode()) {
case ADVENTURE:
return PlotGameMode.ADVENTURE;
case CREATIVE:
return PlotGameMode.CREATIVE;
case SPECTATOR:
return PlotGameMode.SPECTATOR;
case SURVIVAL:
return PlotGameMode.SURVIVAL;
default:
return PlotGameMode.NOT_SET;
}
}
@Override
public void setGameMode(PlotGameMode gameMode) {
switch (gameMode) {
case ADVENTURE:
this.player.setGameMode(GameMode.ADVENTURE);
break;
case CREATIVE:
this.player.setGameMode(GameMode.CREATIVE);
break;
case SPECTATOR:
this.player.setGameMode(GameMode.SPECTATOR);
break;
case SURVIVAL:
this.player.setGameMode(GameMode.SURVIVAL);
break;
default:
this.player.setGameMode(GameMode.SURVIVAL);
break;
}
}
@Override
public void setTime(long time) {
if (time != Long.MAX_VALUE) {
this.player.setPlayerTime(time, false);
} else {
this.player.resetPlayerTime();
}
}
@Override
public void setFlight(boolean fly) {
this.player.setAllowFlight(fly);
}
@Override
public boolean getFlight() {
return player.getAllowFlight();
}
@Override
public void playMusic(Location location, int id) {
//noinspection deprecation
this.player.playEffect(BukkitUtil.getLocation(location), Effect.RECORD_PLAY, id);
}
@Override
public void kick(String message) {
this.player.kickPlayer(message);
}
@Override public void stopSpectating() {
if (getGameMode() == PlotGameMode.SPECTATOR) {
this.player.setSpectatorTarget(null);
}
}
@Override
public boolean isBanned() {
return this.player.isBanned();
}
}

View File

@ -1,8 +0,0 @@
package com.plotsquared.bukkit.object.entity;
class AgeableStats {
int age;
boolean locked;
boolean adult;
}

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