Compare commits

..

2786 Commits

Author SHA1 Message Date
fd4a542062 build: Release 6.6.0 2022-03-07 15:35:00 +01:00
dc13f2565f ci: Pin GH workflow dependencies 2022-03-07 15:26:41 +01:00
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
d698c6a1e5 [ci skip] Update issue templates for 1.18.2 2022-03-04 13:25:50 +01:00
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
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
954c813cef build: Update gradle wrapper properly 2022-02-27 18:48:37 +01:00
05e055e9cf ci: Bump actions/setup-java to 3.0.0 (#3519) 2022-02-25 22:43:24 +01:00
2ea21c150f build: Back to snapshot for development 2022-02-23 11:05:40 +01:00
c2fd4edad5 build: Release 6.5.1 2022-02-23 11:00:45 +01:00
78b8696778 refactor: Delete rebase.yml 2022-02-23 10:54:07 +01:00
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
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
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
61797c3aff build: Back to snapshot for development 2022-02-10 12:44:17 +01:00
78125ff1e2 build: Release 6.5.0 2022-02-10 12:32:02 +01:00
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
34f005c244 Restore ability to use PlaceholderAPI in greeting and farewell flag (#3489)
Fixes #3465
2022-02-10 12:11:39 +01:00
6fbd1376ca Don't enable presets with prices if economy is disabled (#3497) 2022-02-10 12:10:47 +01:00
951767dc64 fix: synchronize confirmExpiry (#3481)
Prevents that the MetaDataAccess is closed before setting the data
2022-02-08 15:57:09 +01:00
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
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
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
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
0d78ba5f35 [ci skip] ci: Don't run actions twice 2022-01-31 21:12:00 +01:00
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
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
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
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
d06a827e31 Always call plot events through the event dispatcher (#3479) 2022-01-29 13:12:00 +01:00
10bb520f3a docs: Switch to generated wiki (#3482) 2022-01-29 00:12:54 +01:00
126aa53b61 build: Back to snapshot for development 2022-01-27 14:00:51 +01:00
ac71046feb build: Release 6.4.0 2022-01-27 13:49:17 +01:00
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
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
5ab410a5c5 fix: Don't ommit flag int input in no permission message (#3466) 2022-01-27 12:14:39 +01:00
1f28bac955 Fix: Plot#getOwner can be nullable, and redstone may be present on unowned plots (#3472) 2022-01-27 12:14:16 +01:00
92c54de5e9 fix: run whenDone on empty queue (#3474) 2022-01-27 12:13:55 +01:00
ff5d79699d docs: Add @since annotation for v6 changes (#3471) 2022-01-24 21:46:01 +01:00
a0594c19ee docs: Address dangling @see tags (#3469) 2022-01-24 21:43:35 +01:00
da41c136fe docs: Unify true/false style in @return (#3470) 2022-01-24 21:41:54 +01:00
6a5859ee0f build: Update release-drafter/release-drafter action to v5.17.6 (#3467)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-24 11:06:27 +01:00
59e0b4b67a feat: unknown owner(s) for plot expiry (#3452)
* feat: unknown owner(s) for plot expiry

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

* feat: Sort plugins on debugpaste alphabetically

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

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

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

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

* refactor: Update SquirrelID GAV

* build: Release 6.3.0

* build: Back to snapshot for development

* fix: fallback method in BukkitQueueCoordinator uses world coordinates

* mark since tags as TODO

* fix: get the lowest diff for plot age

* fix: initialize with high value and better readability

* fix: no need for multiple age checks

* fix: address exceptions in plot analysis

* chore: address requested changes

* chore: Fix introduced violations

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

* chore: More work

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

* Fix caption typo

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

* Remove wildcard import

* Use @since TODO instead of hard coded version

* chore: Update `@since` tags to TODO

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

* fix: change default message

* refactor: extract duplicated code

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

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

* Removed old code

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

* refactor

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

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

* Remove duplicate flag check?

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

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

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

* build: Provide jsr at runtime

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

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

* chore: Invert bolt's status

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

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

* docs: Add back deprecated projectile permissions

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

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

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

* refactor: More MiniMessage deprecations

* Move away from our `Templates#of`

* Address comments

* style: Address migration style issues

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

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

* Address license violations

* address review

* standardize post event calls in EventDispatcher

* Add package-info.java

* Add @since-tag to Post* events

* fix licenser issue

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

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

* Add permission to plots.admin permpack

* Implement messages on leaving/entering border area

* Rename to border.denied and make border msg red

* change too le/ge as tthey are likely to be equal to border when hit.
 - Since we check for being across the border beforehand, it will hopefully not be spammed too much?
 - If it's spammed then either we use meta to set if a player's left the border, or we just remove the come-back-in altogether because it's a little looong
2021-10-28 10:13:36 +02:00
f2368f97df chore: Update com.sk89q.worldedit to v7.2.7 (#3299)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-25 11:22:31 +02:00
df87bcb743 build: Back to snapshot for development 2021-10-18 20:30:28 +02:00
5653d0f175 Release 6.1.3 2021-10-18 20:22:13 +02:00
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
cb596ee6ea Fix StackOverFlow 2021-10-18 17:27:51 +01:00
4e391136c0 Add and Trust permission now count correctly (#3290) 2021-10-15 11:28:23 +01:00
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
d2776eed5a [ci skip] Move to work level templates 2021-10-08 18:09:58 +02:00
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
7ee46be2ac feat: Allow plot alias in title (#3273)
Fixes #3171
2021-10-07 08:07:13 +00:00
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
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
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
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
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
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
f10e38af63 [ci skip] chore: Improve pr template fields 2021-10-04 15:43:44 +02:00
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
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
541255fe7e ListFlag#merge should not allow duplicates (Fixes #3157) (#3265) 2021-10-03 14:31:57 +02:00
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
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
18eece0b71 [ci skip] chore: Renovate
Closes #3260
2021-09-29 18:09:12 +02:00
4f12dcf966 Return base plot when using alias (#3253) 2021-09-25 15:58:31 +02:00
ee832528db [ci skip] Adjust renovate config
Closes #3252
2021-09-21 00:52:25 +02:00
bb5d6c91da Update Fawe version 2021-09-20 16:21:18 +02:00
6d4adecb32 6.1.3 2021-09-18 23:07:10 +01:00
c37b13dcb3 Fix bad move to adventure 2021-09-18 21:54:22 +01:00
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
b2b8598b5b Fix #3246 2021-09-15 13:19:25 +01:00
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
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
9f54472dd6 Relocate annotations properly 2021-09-12 13:56:08 +02:00
115932c65a 6.1.2 2021-09-11 14:28:08 +02:00
04821f777e Mappings be obfuscated 2021-09-11 12:19:46 +01:00
cfae804780 6.1.1 2021-09-10 15:01:05 +01:00
4568b17c54 Fix issues with chunk saving in single world plots 2021-09-10 14:05:12 +01:00
7bc76a3824 Update serverlib 2021-09-09 21:50:11 +02:00
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
d77a8c8fa4 Some improvements to events (#3238)
#3222 #3072
2021-09-09 21:37:44 +02:00
27a8fcd739 Plot location may be final 2021-09-09 12:36:09 +02:00
c25a0c65a2 Don't check same plot over and over again 2021-09-08 18:37:45 +02:00
b224a8d1b8 Include world in plot chat & spy template 2021-09-07 16:36:08 +02:00
87d134215f Fix placeholder if world already exists. 2021-09-07 16:20:45 +02:00
93e280dba4 Remove unneeded commented out code 2021-09-07 15:08:00 +01:00
732f79bbfc Fix #3231 2021-09-07 14:47:37 +01:00
8e5e33eec2 Fix #3127 2021-09-07 14:02:48 +01:00
da3fb1abec Closes #3236 2021-09-07 13:52:47 +02:00
62d6b21081 [ci skip] Closes #3232 Closes #3233 2021-09-06 15:04:07 +02:00
4caaead7ee Renovate
Closes #3217
Closes #3226
Closes #3227
Closes #3229
Closes #3230
2021-09-06 13:47:40 +02:00
be38086f6c Update Fawe 2021-09-05 00:13:32 +02:00
c18b0f943c Switch deployment to the central repository 2021-09-04 13:58:16 +02:00
f036980dc5 Disband wilderness permission pack 2021-09-03 20:01:37 +02:00
0e4f54e9c0 Bump (FA)WE versions 2021-08-29 10:56:57 +01:00
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
2ab1973668 Handle administrative overrides sanely 2021-08-25 11:49:54 +02:00
387c6e79ba Return after invalid plot size 2021-08-25 11:10:02 +02:00
e3e00d34ef Improve error message claiming plots with ids 2021-08-25 01:36:19 +02:00
40e651188e Improve javadoc linking 2021-08-24 15:34:21 +02:00
b2915d9bd7 add license... 2021-08-23 10:11:43 +02:00
6ec136a03d Make sure lock is free'd even on error (fixes #3116) 2021-08-23 10:05:38 +02:00
a8fc6662e0 Allow visit to work when players are not the owner of the base plot 2021-08-22 16:26:49 +01:00
fb8e749411 Still allow serialisation of PlotTitle flag 2021-08-22 15:58:15 +01:00
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
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
daa8ffc38f 6.0.10 2021-08-19 20:51:51 +02:00
34f0236e9f Add option to "update" blocks that are altered in P2 queues. (#3200) 2021-08-19 20:30:38 +02:00
8f0ae7e51d Clean up chunk coordinators and queue coordinators (#3208) 2021-08-19 12:31:47 +01:00
2988ad6b11 Address style violations 2021-08-18 11:58:18 +02:00
252d6a2866 Fix nms chunk reference 2021-08-17 22:43:58 +01:00
b8c9ae2b0b Bump FAWE version 2021-08-17 22:43:47 +01:00
bfe2dda5b1 Closes #3212 2021-08-17 16:38:24 +02:00
33a79595af Add TitleFlag (#3202) 2021-08-16 09:02:58 +00:00
eb2848e5d7 Fix bad method names etc for chunk/world listener 2021-08-15 13:58:56 +01:00
da4ae9f4f5 Slightly change how flag permissions are handled (#3201) 2021-08-14 13:13:01 +00:00
b841a7c03b Fix javadoc linking of deprecated methods 2021-08-11 17:58:24 +02:00
4ee5e3d134 Invert toggle messages where the toggle disables rather than enables 2021-08-08 16:51:21 +01:00
0e05935ad4 Fix #3166 2021-08-08 14:06:59 +01:00
78a775530a Merge branch 'v6' of github.com:IntellectualSites/PlotSquared into v6 2021-08-08 12:36:23 +01:00
dd36036334 Allow players to /plot home from non-plot-areas if per-world-teleport is enabled 2021-08-08 12:36:08 +01:00
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
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
391476ba26 6.0.9 2021-08-05 14:08:41 +02:00
25a69f4ca0 Escalate null entries in the db to the warn level 2021-08-04 23:09:38 +02:00
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
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
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
e7fa057abe Detach shoulder entities from natural mob spawning 2021-08-03 10:20:59 +02:00
a86c06bb81 Update a few dependencies 2021-08-01 20:10:06 +02:00
9afaead81c Move to security advisory 2021-07-31 18:15:53 +02:00
6e7bd0a536 Left over from 89e17bb468 2021-07-31 10:43:11 +02:00
89e17bb468 Properly handle economy initialization (fixes #3189) 2021-07-30 20:29:12 +02:00
8fc9e0b13f Be a bit more helpful with deleted plotworlds and invalid db entries 2021-07-28 22:23:55 +02:00
6ad51bba65 Hot-fix for IntellectualSites#3179 (#3188)
Authored by @SirYwell ty!
2021-07-28 12:42:20 +02:00
9d396fa91f Fixes #3184 2021-07-27 15:04:22 +02:00
a8c3ac6cee Fixes #3181 2021-07-26 22:19:17 +02:00
9a9365a04d Fixes #3180 2021-07-26 21:23:59 +02:00
c9b012ea5b Leave a note when using deprecated commands 2021-07-24 18:01:26 +02:00
9dd35e87d6 We're using .editorconfig > code_style.xml 2021-07-23 22:23:49 +02:00
82f0b4194f Update Fawe version 2021-07-23 17:36:34 +02:00
3b27b6c850 FAWE-Bukkit shouldn't be in core 2021-07-23 16:24:30 +01:00
1e41734826 Send usage for '/p v' for too many arguments 2021-07-23 15:34:25 +01:00
a83a79c17e Error message for '/p v' when page out of range 2021-07-23 15:34:25 +01:00
8a77d5a450 Fix index out of bounds for '/p h' 2021-07-23 15:33:35 +01:00
2676b76107 6.0.8 2021-07-22 21:46:25 +01:00
51ff043af9 Prevent users defining their own click events in descriptions/farewells/greetings by default 2021-07-22 21:45:51 +01:00
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
a0557112a1 Handle db command args sanely 2021-07-21 15:55:26 +02:00
6d71e0f8be Fixes 3168 2021-07-20 22:21:32 +02:00
62e17f5fc5 [ci skip] Fix CONTRIBUTING.md link 2021-07-20 11:23:57 +02:00
613a92eeb9 6.0.7 2021-07-17 17:59:41 +01:00
31522b6502 Check plot ownership/event before handling Direction.ALL 2021-07-17 17:51:48 +01:00
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
fe65a0c548 Fix off-by-one error in schematic pasting (#3160) 2021-07-14 17:58:04 +02:00
cc60d50dd2 Actually cancel projectile hit events (#3154)
Co-authored-by: NotMyFault <mc.cache@web.de>
2021-07-13 08:57:12 +00:00
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
2d1e3b8c03 Fixes #3148 2021-07-12 18:12:54 +02:00
635e18e7ed Add copper-oxide flag 2021-07-10 15:50:38 +02:00
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
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
fdb6367351 Remove unneeded maven repos 2021-07-05 15:25:22 +02:00
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
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
3b5b51b40c Update link if outdated Fawe version is spotted 2021-07-02 14:22:33 +02:00
5395ddc6a3 Update build.gradle.kts 2021-06-29 11:50:47 +02:00
60c701d20b Don't display plot rating placeholder in scientific notation
Fixes #3091
2021-06-28 18:49:03 +02:00
eb11d9e3aa Handle add & trust permission ranges properly 2021-06-28 16:40:01 +02:00
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
8e23b10f7c Fix update notification ingame message 2021-06-27 18:11:57 +02:00
c46647d491 Handle plots.deny.<amount> properly 2021-06-27 16:40:45 +02:00
013e8fcda5 Leave a note where to get additional translations 2021-06-27 15:23:11 +02:00
f4ff9c0336 6.0.5 2021-06-27 13:21:44 +01:00
7c4d96e176 Fix #3117 2021-06-27 13:06:10 +01:00
2c920bd016 6.0.4 2021-06-26 20:11:15 +01:00
a5452012b5 separate 1.17-only events 2021-06-26 20:08:25 +01:00
43dd35f54b 6.0.3 2021-06-26 19:53:59 +01:00
67bbd64fa1 Update to FAWE 1.17 2021-06-26 16:19:07 +01:00
8f48b83c79 Replace the proper string in expressions 2021-06-24 19:14:59 +02:00
6a57a5c369 Fixes #3100 2021-06-24 16:40:10 +02:00
20df062d9f Back to snapshot for development 2021-06-23 11:50:24 +02:00
9fa0a8b27b Update ServerLib & remove Java version check
We now require Java 16 onwards
2021-06-22 23:49:31 +02:00
9acf9f4f19 Improve documentation of deprecated methods 2021-06-22 18:11:48 +02:00
0e84cf085b Fix compatibility issues with Citizens (fixes #3105) 2021-06-22 10:18:48 +02:00
ca9e371067 Teleport all players from plot on clear and delete (fixes #3102) 2021-06-21 18:20:47 +02:00
56920fe833 Load configs before accessing them (fixes #3099) 2021-06-21 16:38:40 +02:00
f2e6fd9692 Bump PlotAPI version 2021-06-21 12:05:56 +02:00
b2966cbc45 Back to snapshot for development 2021-06-21 11:51:20 +02:00
45c566859e Don't fail loading on versions prior to 1.17 2021-06-21 10:30:48 +02:00
654f7ed3ae Fix arkitektonika backend url 2021-06-20 20:13:37 +02:00
f1ef07bee0 Merge branch 'v6' of https://github.com/IntellectualSites/PlotSquared into v6 2021-06-20 18:28:29 +02:00
3e28d39285 We don't need "no-nashorn" config option in v6 2021-06-20 18:28:13 +02:00
8eb8c24209 Merge branch 'v5' into v6 2021-06-20 18:22:21 +02:00
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
a3ebabacb8 Fix #3095 2021-06-18 15:45:45 +01:00
440afcca5d Fixes #3066 2021-06-18 16:37:25 +02:00
8220d4aa31 Update licenser & gradle 2021-06-18 01:22:24 +02:00
b196c9ce8e Fix place flag message 2021-06-16 01:15:09 +02:00
93568f9f7f Update pom 2021-06-12 12:09:40 +01:00
b01291c4ff Add note about PlayerPlotAutoEvent return null plot 2021-06-12 11:36:33 +01:00
a9d896eb45 Add note about PlayerPlotAutoEvent return null plot 2021-06-12 11:35:55 +01:00
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
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
942d799c9c Make "NaN" in placeholders translatable 2021-06-09 21:51:51 +02:00
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
9bd14b142b Move FAWE detection before guice injection/configuration 2021-06-09 13:09:50 +01:00
4ba1217b84 Fix licences 2021-06-09 13:09:50 +01:00
50d4353045 begin integration with fawe 2021-06-09 13:09:50 +01:00
19e97a7738 Correctly handle coordinates in swapping
Fixes #3030
2021-06-08 20:31:53 +01:00
2ac5fe45e3 Make CaptionLoader namespace-aware 2021-06-08 15:36:03 +02:00
7f3d3ecb00 Fixes #3018 2021-06-08 14:25:08 +02:00
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
8f2f673438 👀 2021-06-08 12:24:57 +02:00
66e12e2a0c Make world settings reloadable 2021-06-08 12:10:21 +02:00
2b3ecc178a Fix some inbox issues 2021-06-08 11:56:03 +02:00
df842c355e 5.13.13 2021-06-08 10:52:51 +02:00
9b043b7444 Make /plot rate categories translatable 2021-06-08 10:49:26 +02:00
ce287cf218 Add toggle allowing to opt out nashorn 2021-06-08 00:16:55 +02:00
24945efc7d Merge branch 'v5' into v6 2021-06-06 21:41:24 +02:00
a01ad5aa04 Update wiki location 2021-06-06 21:40:34 +02:00
fa14c40283 Update wiki links 2021-06-06 21:38:49 +02:00
d8f19cec66 Adjust improper origin -> target message of plot moving 2021-06-04 19:17:20 +02:00
955341ff9f Move enqueue to the actual end of the code 2021-06-04 18:41:57 +02:00
cb342de934 Check merge status from correct plot 2021-06-04 13:39:03 +02:00
ea0342f100 Enqueue on unlink 2021-06-04 13:39:03 +02:00
cd57741a51 Fix typo introduced in f4552e358d 2021-06-03 12:53:47 +02:00
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
1dc225362d Bump gh action tasks prevent failing of gradle wrapper validation 2021-06-02 23:29:43 +02:00
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
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
5a5d1f5e62 Fixes #3063 2021-06-01 21:54:00 +02:00
21214814b7 Fixes #3032 2021-05-31 21:59:15 +02:00
3ac93dcfca Enhance /plot target & expiry confirm message 2021-05-28 20:21:41 +02:00
c509882a18 Enhance alias message with placeholders 2021-05-28 11:37:13 +02:00
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
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
dc7e6010cb Fixes #3073
- Also add new caption if attempting to clear an empty alias
2021-05-27 17:06:04 +02:00
b1fc17e045 Remove scripting from javadocs 2021-05-25 20:51:26 +02:00
daf0e6e1ba Use same creation message for templates like for setup 2021-05-25 11:02:37 +02:00
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
1d2aa74e51 Add actionbar message for notification flags
- Move title_as_actionbar boolean into enabled_components
2021-05-24 13:49:00 +02:00
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
399d77c60f Component-ify plot setup wizard
Touches #3068
2021-05-22 19:49:22 +02:00
b768ee6d41 Don't send teleport message before the teleportation is initiated 2021-05-22 18:15:34 +02:00
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
87706d471b Add option for legacy sign material
Follow up to cde27899dd
2021-05-22 12:34:04 +02:00
eb7eb15ee7 Implemented tab completion for /plot help (#3053)
Co-authored-by: NotMyFault <mc.cache@web.de>
2021-05-22 02:23:54 +02:00
a17085bb18 Remove dead imports 2021-05-21 20:56:44 +02:00
cde27899dd Fixes #3064 2021-05-21 19:14:13 +02:00
93ff778de0 Add administrative override for /plot components 2021-05-21 17:54:26 +02:00
17f91c8eb9 Make /plot rate GUI items customizable
Bye bye legacy items :)
2021-05-21 16:48:34 +02:00
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
cc48f273c0 Fixes #3057
Actually execute a kick from server if ordered
2021-05-20 21:59:05 +02:00
c8406681d7 Notify the kicked person over the actor 2021-05-20 21:22:00 +02:00
a05dd19986 Fixes #3058
- Anonymize meta data keys
2021-05-20 21:04:07 +02:00
aae350c1b3 Enhance flag tutorial message 2021-05-20 19:57:06 +02:00
c48559410f Provide instruction about the .editorconfig 2021-05-20 00:26:35 +02:00
9c59bfde52 Rephrase message if user has no access to sub-command help pages 2021-05-19 23:48:32 +02:00
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
24eebe6711 Update gradle to 7.0.2 2021-05-19 11:51:55 +02:00
a2b8e4493f Fix infinite loop on multi auto (fixes #3022) 2021-05-18 22:30:40 +02:00
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
94ba90d694 Always initialize PermissionHandler (fixes #3019) 2021-05-18 21:17:47 +02:00
e97bc25fb8 Log plot chat to console
- Fix plot music removal template
- Fix debug args
2021-05-17 10:35:09 +02:00
73936bb10d Fix licenser issues 2021-05-17 09:31:33 +02:00
23e65ac5d3 Merge branch 'feature/v6/update-licenser' into v6 2021-05-17 09:29:08 +02:00
9dc0396411 Fix plot list coloring 2021-05-16 22:47:02 +02:00
cc6db9ae9e Merge branch 'v5' into v6 2021-05-15 20:47:01 +02:00
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
0341111f8f Add lectern-read-book flag
Fixes https://github.com/IntellectualSites/PlotSquared/issues/2980
2021-05-14 18:22:02 +02:00
a7c4b40fcc Add no-portals and deny-portal-travel flag 2021-05-14 15:51:20 +02:00
e7fb3571ac Update licenser 2021-05-14 13:36:18 +02:00
58ad9db5ed Jump to Java 16 2021-05-14 01:04:09 +02:00
6fd55b47c2 Fix typo 2021-05-13 21:41:10 +01:00
3d7c191d1c Make the plot jukebox gui translatable
Fixes https://github.com/IntellectualSites/PlotSquared-Translations/issues/2
2021-05-13 20:21:19 +02:00
9344e1ca79 Make /plot setup header translatable
- Document a couple of permission nodes
2021-05-13 13:32:34 +02:00
68eb5cd74f Replaced economy supported (Vault) check within cost condition with a pre-eliminating if-guard (#3014) 2021-05-12 19:00:14 +02:00
ca7ac71e76 Update gradle and shadow 2021-05-12 03:00:34 +02:00
3a280f3b6a Fix a few typos 2021-05-11 19:26:39 +02:00
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
2c40648a60 Fixed feedback recipient for notify flags (Owner instead of entering / leaving player) (#3011) 2021-05-11 18:26:24 +02:00
48815649a8 Clarify native dependency versions 2021-05-07 22:12:14 +02:00
f690e14a14 Exchange EssentialsX maven repo 2021-05-07 11:08:07 +02:00
b37ad79e50 Beautify empty /plot caps output
Also strip prefix from empty plot description
2021-05-07 09:59:17 +02:00
a990205d41 Fix empty templates when vault not found 2021-05-07 01:53:18 +02:00
891230c78e Fix /plot sethome returning usage message & working on unclaimed plots 2021-05-07 01:27:11 +02:00
8bfdf8ecf2 Fix /plot cluster sethome triggering usage message
Enhance cluster messages a bit
2021-05-07 01:18:33 +02:00
78655102b9 Fix flag exception coloring 2021-05-06 19:06:50 +02:00
491a171409 Fix invalid backup messages & component prefix & update minimessage 2021-05-06 10:30:04 +02:00
b3aec8f839 Fix empty default flag message 2021-05-02 20:31:23 +02:00
0106a4222d Address a few deprecations 2021-05-01 18:33:02 +02:00
11af33f2d5 Fixup inbox javadocs 2021-04-30 19:04:44 +02:00
812442fbbc Don't double color the inbox 2021-04-30 13:22:00 +02:00
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
ffe298710d Lazy merge v5/v6 2021-04-28 20:17:10 +02:00
5cdb7e76fd Update wiki and issue links 2021-04-28 20:06:19 +02:00
361b936aa0 Update ServerLib 2021-04-27 11:58:49 +02:00
9503b0bfc4 Merge branch 'v5' into v6 2021-04-27 11:52:44 +02:00
823beaf268 Update a few dependencies 2021-04-27 11:46:14 +02:00
3ada55989f [ci skip] Setup new issue templates (#2951)
* Setup issue templates

* Exchange issue url
2021-04-26 16:25:15 +02:00
de597391dc Fix keep-inventory flag & adjust disallowed-blocks translation 2021-04-21 11:03:14 +02:00
59599261ff Fixes https://issues.intellectualsites.com/issue/PS-237 2021-04-12 16:08:31 +02:00
e1fb8c1ae5 Take building min height also into consideration 2021-04-11 10:12:37 +02:00
ba4146f82c Update to gradle 7 2021-04-10 16:52:46 +02:00
a5c43bb823 Suggest flag name instead of value 2021-04-10 09:34:53 +02:00
050cf3edb3 Update a few dependencies 2021-04-04 13:30:09 +02:00
84d5ebfa41 Make use of because args 2021-04-03 23:15:40 +02:00
6bc4e5b45c Re add per-world-teleport 2021-04-03 22:34:43 +02:00
496fe09f78 Merge branch 'v5' into v6 2021-04-03 22:31:54 +02:00
19daf1bd52 5.13.12 2021-04-03 22:18:03 +02:00
74a9c2f6b4 Reimplement per-world-visit 2021-04-03 21:48:21 +02:00
dd9edb68b2 Fixes https://github.com/IntellectualSites/PlotSquaredSuggestions/issues/23 2021-04-02 23:48:16 +02:00
b02177e1d0 Add tab completion for gamemode flag 2021-04-02 23:20:39 +02:00
600d38d3e2 Add flag placeholders to flag commands 2021-04-02 17:50:37 +02:00
07fd7e497f Strip commands from translation files 2021-04-02 14:04:17 +02:00
932873ba02 Do not access nms for older versions on newer ones 2021-03-31 12:42:32 +02:00
567f1d4247 Fix backup captions and add placeholders to copy/move/swap 2021-03-30 13:44:04 +02:00
3f05dfe4bf Sort plots for /plot home the same as for /plot visit, fixes PS-188 2021-03-30 11:19:43 +02:00
fbebcf57c1 Fix exporting all plots 2021-03-29 17:07:58 +02:00
30d3a458e2 Addressing more issues 2021-03-28 17:39:02 +02:00
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
22baabf751 Don't fail on Java 17 (and higher) 2021-03-23 10:39:17 +01:00
0cdda8b0ae Fix a few issues with debugexec 2021-03-12 15:05:25 +01:00
295a63087f Strip lesser used debug commands 2021-03-12 14:45:43 +01:00
797d3ed362 Don't invert the debug status message 2021-03-04 21:43:16 +01:00
31de7de385 Cover a couple of NPEs 2021-03-01 16:21:12 +01:00
5780ad370a Strip Java 15 note 2021-03-01 10:58:27 +01:00
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
38b60205e8 Use javax for Nullable + guice, hope I didn't miss anything 2021-02-24 20:35:38 +01:00
027456fd77 Add crop-grow flag 2021-02-24 18:41:36 +01:00
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
d9b5dc5dd7 Sort plots for /plot home the same as for /plot visit, fixes PS-188 2021-02-24 08:46:16 +01:00
c7e6564667 Add new metrics pies 2021-02-22 15:22:38 +01:00
da45813a06 Add new metrics pies 2021-02-22 15:18:20 +01:00
6cc9b5c62b Remove eol config entries 2021-02-22 13:24:46 +01:00
1172e02f1b Fix several issues with debug command 2021-02-21 12:34:14 +01:00
46fbc05040 Don't fail to load when moving components file 2021-02-20 19:41:58 +01:00
fee1ffa2e9 Switch to vanity url 2021-02-17 00:50:50 +01:00
22be81b5cb Switch to vanity url 2021-02-16 23:50:53 +01:00
12d260ca82 Fixes https://issues.intellectualsites.com/issue/PS-23 2021-02-09 18:20:50 +01:00
82e90553bc Enhance continue message 2021-02-03 15:44:18 +01:00
18c1a0e4f6 Remove duplicated translation strings 2021-02-02 16:48:01 +01:00
c42102d1c4 Don't shade without relocation 2021-02-01 15:31:25 +01:00
aca2d2e510 Fixes https://issues.intellectualsites.com/issue/PS-186 2021-01-31 11:44:22 +01:00
666938b738 Update ServerLib 2021-01-30 13:17:36 +01:00
a75db92007 Update ServerLib 2021-01-30 13:16:36 +01:00
aaf2fa8807 Update bStats to 2.1.0 2021-01-24 10:39:03 +01:00
e549235d83 Switch to ServerLib 2021-01-22 23:42:45 +01:00
86e8457574 Move to ServerLib 2021-01-22 23:34:47 +01:00
8292ed9e31 More annotation work 2021-01-10 00:01:48 +01:00
57fc51d013 Initial annotation usage cleanup + EditorConfig 2021-01-09 22:28:41 +01:00
8b332adbe7 Address comments 2021-01-09 21:34:42 +01:00
ae0ee1ebdd fix teleport to "*" 2021-01-09 21:34:42 +01:00
3cea734b9b Fix singleworlds 2021-01-09 21:34:42 +01:00
7ac3f7ca03 Fix sync tasks not being sync 2021-01-09 20:39:25 +01:00
0a5c73478d Fix improper missing permission message on /plot list world 2021-01-08 17:16:38 +01:00
495952acb0 Fixes https://github.com/IntellectualSites/PlotSquaredSuggestions/issues/129 2021-01-08 16:46:57 +01:00
25a8f1522a Move creation date up in plot header 2021-01-08 16:08:42 +01:00
f13f7ce129 Disable destructive operations for plot world plots 2021-01-08 16:06:15 +01:00
cc90127af9 fix two <> errors in lang 2021-01-07 13:45:01 +00:00
98e8476a88 Bring v5 entity spawn changes to v6 2021-01-06 21:56:26 +00:00
ec8bdc9af6 Actually place the debugroadregen blocks 2021-01-04 19:23:31 +00:00
9598416932 handle cancellation properly in DefaultProgressSubscriber 2021-01-04 18:23:45 +00:00
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
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
e09444d94f code style 2021-01-03 23:42:32 +01:00
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
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
f47561b580 Invert leaf-decay message 2021-01-01 21:51:28 +01:00
4f60da292a Add leaf-decay flag
Stop leaves from decaying.
2021-01-01 21:47:09 +01:00
70fb86a1c3 Remove redundant legacy version check
"api-version" backs us up here.
2021-01-01 14:09:59 +01:00
bf79639d07 Update license to 2021
Happy new year 🎆
2021-01-01 00:46:30 +01:00
e8642df674 Update licenses to 2021
Happy new year 🎆
2021-01-01 00:19:45 +01:00
b648717079 5.13.11 2020-12-29 15:14:00 +01:00
3702caa25f Replace toggle permission with plots.toggle 2020-12-28 16:06:24 +01:00
4200bbfd0a Update permission range declaration 2020-12-28 15:38:42 +01:00
0fcca4c141 Use hasPermissionRange to check for trust and add limits 2020-12-28 15:36:00 +01:00
fafdae9ba9 Only check ice-form for ice (#2940)
Co-authored-by: NotMyFault <mc.cache@web.de>
2020-12-28 14:11:30 +00:00
ef215b1b0c fix debugpaste with multiverse 2020-12-28 12:31:51 +00:00
1d0721034d fix debugpaste with multiverse 2020-12-28 12:30:53 +00:00
3cfbe9585a Merge branch 'v6' of github.com:IntellectualSites/PlotSquared into v6 2020-12-28 12:27:12 +00:00
71305e636c cache bukkitworld 2020-12-28 12:10:27 +00:00
ce23c153ee Fix added_list and denied_list placeholders 2020-12-28 12:15:34 +01:00
019da4d2f4 Expose legacy serializer for placeholders 2020-12-28 11:21:35 +01:00
ffc31f565b Use builder for flags component 2020-12-28 00:05:33 +01:00
7f01f2d716 Rename placeholders matching more appropriately 2020-12-27 19:37:09 +01:00
bf20b0dd79 Beautify placeholder output for '*' permission 2020-12-27 19:16:26 +01:00
867826759b Make placeholders translatable 2020-12-26 13:50:00 +01:00
3be370071c fix purge <owner> 2020-12-23 14:13:50 +00:00
2b9a194244 5.13.10 2020-12-23 14:07:42 +00:00
67a928b1ae Merge branch 'v5' of github.com:IntellectualSites/PlotSquared into v5 2020-12-23 13:54:35 +00:00
67a7211b77 use correct UUID pipeline methods in purge command 2020-12-23 13:52:47 +00:00
1d4fe01db0 Rename database chart id 2020-12-22 20:54:22 +01:00
07491d8028 Rename database chart id 2020-12-22 20:53:13 +01:00
7f1baca872 Add database type to debugpaste 2020-12-22 17:55:37 +01:00
8c3a0a8275 Fix compiling 2020-12-21 20:33:49 +01:00
eba6043d26 Update paster 2020-12-21 15:59:12 +01:00
397692d113 Update Paster 2020-12-21 15:58:34 +01:00
035ecc1517 Delete dependabot.yml 2020-12-21 10:58:30 +01:00
bb52301200 Merge remote-tracking branch 'origin/renovate/configure' into v6 2020-12-20 22:38:35 +01:00
f4adf5d7e7 Add renovate.json 2020-12-20 21:24:38 +00:00
e4a8459798 Switch to IncendoPaster "library" 2020-12-19 16:20:44 +00:00
14fa738fbe switch to InvendoPaster "library" 2020-12-19 16:00:13 +00:00
4da7aa38ea @Sauilitired can't spell properly 2020-12-16 13:23:14 +01:00
5147d67318 Add charts for complex plot components 2020-12-16 13:20:23 +01:00
cbc599cb20 don't double-up schematic x/z offsets 2020-12-16 12:13:39 +00:00
09c84e25bf don't double-up schematic x/z offsets 2020-12-16 12:07:36 +00:00
224e3b6ad4 Fix publishing. I am an author. 2020-12-14 18:09:09 +00:00
992a683ba2 another annoying cache thing 2020-12-14 15:22:10 +00:00
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
de3ba9a25c re-send block change for blocks with gravity if they're physicsed
fixes PS-159
2020-12-14 14:53:53 +00:00
5e88cabb4b compare UUID to UUID, not UUIDMapping
fix PS-182
2020-12-14 14:32:34 +00:00
6d71177394 Don't save corrupt schematics so that when they load, they work. 2020-12-13 21:09:05 +00:00
edd9ae5118 Fix more flag message issues. 2020-12-12 22:46:37 +01:00
23ae3b5830 Use builder for flag list message 2020-12-12 21:19:28 +01:00
6746aab7ef Improve /plot info formatting 2020-12-12 18:56:19 +01:00
c85ff7ddda Update README.md 2020-12-12 17:52:24 +01:00
cf70efabb0 we want throwable to be null 2020-12-11 16:51:13 +00:00
6eb2958afc Fix merge issue 2020-12-11 11:42:19 +00:00
18f13b7d15 Merge branch 'v5' into v6 2020-12-10 21:28:28 +00:00
0bb959d26a Merge branch 'v6' of github.com:IntellectualSites/PlotSquared into v6 2020-12-10 21:15:51 +00:00
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
25100c46f7 Don't unclaim claimed plots with /p claim 2020-12-10 22:13:13 +01:00
540f4c0958 fix info for server-plots 2020-12-10 21:05:50 +00:00
8930ebe572 Relight command is pointless as we'd just use FAWE for it anyway. 2020-12-10 18:06:32 +00:00
8f93f2b6d2 Revert "Allow "Server" owner" as that has its own UUID
This reverts commit 9ba91889e0.
2020-12-10 18:02:38 +00:00
9ba91889e0 Allow "Server" owner 2020-12-10 17:58:00 +00:00
67683fbddb Ensure not to parse null parameters into templates for titles 2020-12-10 17:56:22 +00:00
824f9d7ad0 Add missing returns to /plot cluster 2020-12-09 23:14:52 +01:00
3e99f90eb1 Don't spit NPEs on NonNull values 2020-12-09 22:45:47 +01:00
3ca8a94419 Update java 8 notice 2020-12-08 00:18:40 +01:00
714837dd00 Add charts for complex components 2020-12-07 23:05:25 +01:00
bc1d3ddd5d Fix spelling 2020-12-07 21:25:32 +01:00
bf7b75b619 Make titles duration configurable 2020-12-07 21:23:38 +01:00
469d6ab907 Fixes https://github.com/IntellectualSites/PlotSquaredSuggestions/issues/77 2020-12-07 14:46:16 +01:00
a4dd5bb62f Add tab completion to like/dislike and fix more messages 2020-12-07 12:51:14 +01:00
60859de0bd Add an option to teleport the player on plot clearing or deletion 2020-12-07 10:55:34 +01:00
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
c8ad936d26 Clean up PlotPlatform a bit and make the placeholder registry injectible 2020-12-05 18:41:41 +01:00
60b5f5fe48 Add note about Nashorn 2020-12-05 18:38:10 +01:00
14ec7fb816 Fix PlotRangeIterator 2020-12-05 18:03:24 +01:00
b4ea230ff1 Minor translation changes 2020-12-05 15:35:33 +01:00
410879d154 Fixes https://github.com/IntellectualSites/PlotSquaredSuggestions/issues/141 2020-12-05 15:20:19 +01:00
f14121e99c Initiate placeholder registry 2020-12-05 15:08:27 +01:00
19d7444946 Fix flag description 2020-12-04 19:27:34 +01:00
d9aaed0035 Update dependencies 2020-12-04 18:07:59 +01:00
cfd3c159f9 Follow up to 4ff50525ed
Skipping deprecation here, this exists for so long and and has been superseded by permissions now.
2020-12-04 17:33:41 +01:00
4ff50525ed Fixes https://github.com/IntellectualSites/PlotSquaredSuggestions/issues/110 2020-12-04 17:30:11 +01:00
34e02e9f3a Make JavaVersionCheck private 2020-12-04 16:00:18 +01:00
62690c2a53 Postpone java version during startup 2020-12-04 12:25:53 +01:00
5d30e0854f Add java version checker 2020-12-04 12:15:56 +01:00
ec683cdf88 Update ClassicPlotWorld.java 2020-11-29 17:48:59 +01:00
39feed6fac Improve wording of generation steps 2020-11-29 17:35:41 +01:00
ee7f683b76 Bump paperlib, fix single worlds. 2020-11-26 16:54:38 +00:00
209d52e920 Update adventure 2020-11-26 11:35:46 +01:00
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
ef95334fe6 Update actions worflow 2020-11-23 18:35:44 +01:00
4595534a6f Update actions workflow 2020-11-23 18:32:28 +01:00
be9d9264ae Make use of Permission class in tab completion
Plus document a few more permission nodes
2020-11-19 22:29:44 +01:00
a8495c67d4 Update gradle to 6.7.1 2020-11-19 22:05:45 +01:00
eec369ea4f Improve tab completion, adjust permissions and more v6 changes 2020-11-19 21:53:27 +01:00
abed07b613 Add tab completion for /plot area 2020-11-19 21:24:23 +01:00
6cfdedb823 Don't collapse imports 2020-11-19 21:13:35 +01:00
db903ebb0a Revert "Update gradle.yml"
This reverts commit e12c83fd83.
2020-11-19 21:05:48 +01:00
e12c83fd83 Update gradle.yml 2020-11-19 17:44:57 +01:00
12861f6c07 Add tab completion for /plot setowner 2020-11-19 17:39:58 +01:00
52065b8313 Add tab completion for /plot schematic 2020-11-19 17:36:14 +01:00
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
aedf402c17 Fix /plot leave requiring an arg when none is needed 2020-11-19 17:10:01 +01:00
0745b03271 Add tab completion for /plot cluster 2020-11-19 17:00:21 +01:00
bb5c0de367 Fix /plot download world not being clickable 2020-11-19 16:39:44 +01:00
9478251d44 Fix /plot buy message and enhance it with player balance 2020-11-19 16:32:30 +01:00
47cb85d3db Merge pull request #2932 from IntellectualSites/feature/v6/generify-perms
Generify permissions thru Permission class
2020-11-16 10:34:29 +01:00
ce7ceccc1c Merge branch 'v6' into feature/v6/generify-perms 2020-11-16 10:25:48 +01:00
5d4cf3b705 setowner should allow null UUIDs 2020-11-10 17:24:37 +00:00
f33fc092e3 Add java 11 to actions test 2020-11-08 21:48:23 +01:00
0ff8abcd6f Update town template for schem 2 v2 2020-11-08 15:22:31 +01:00
b0d55d434d 5.13.9 2020-11-03 21:14:07 +01:00
092690e9f0 Update permission in regards of https://github.com/IntellectualSites/PlotSquared/pull/2932 2020-11-03 15:44:07 +00:00
5b11175cf3 Add plots.visit.denied permission 2020-11-03 15:44:07 +00:00
7a203a12a3 Merge branch 'v6' of https://github.com/IntellectualSites/PlotSquared into v6 2020-11-03 16:43:48 +01:00
f7dd8af35e Enhance plot claim message 2020-11-03 15:43:28 +00:00
7a9b3442d2 1.16.4 2020-11-03 16:43:18 +01:00
b66e2359d1 Update to 1.16.4
- Bump WorldEdit to 7.2.0 release
2020-11-03 15:58:17 +01:00
81c72ee5d9 Finish up permissions 2020-11-02 21:03:46 +01:00
fed7f89f96 Fix compiling 2020-11-02 11:58:07 +01:00
aefa629509 Generify permissions thru Permission class
- Fixed a few improper permissions
- Fixed a couple of typos
2020-11-02 00:55:58 +01:00
bc32581cbd Improve empty global flag list message 2020-11-02 00:00:38 +01:00
3f7f6af051 Merge pull request #2913 from IntellectualSites/features/v6/queue-features
Features/v6/queue features
2020-11-01 21:16:32 +01:00
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
0b968abfe4 fix merging conflicts 2020-11-01 17:45:38 +00:00
7e7ecd6a0f Update paperlib 2020-11-01 17:17:12 +01:00
7e9a9e14c7 Fix various instances where Adventure is being used incorrectly 2020-10-25 22:38:00 +00:00
333493f351 adventure v4.1.0; project now compiles 2020-10-17 21:10:02 +01:00
38333a6d11 Update to Gradle 6.7 2020-10-17 21:10:02 +01:00
4213957d76 Delete dependabot.yml 2020-10-12 12:21:32 +02:00
565f9e3e29 5.13.8 2020-10-11 19:27:01 +01:00
a1bfc1cb26 correctly handle road flags 2020-10-11 19:24:50 +01:00
cfd432886d Correctly handle road flags 2020-10-11 19:19:17 +01:00
191666a2f2 Fix logo 2020-10-11 13:03:22 +02:00
aeeae7c167 Fix links not being clickable 2020-10-11 12:47:49 +02:00
08c7d4d15e Remove dead imports 2020-10-09 21:03:23 +02:00
29b92659c7 Fix typos 2020-10-09 20:50:12 +02:00
209f25a5cf Update default branch 2020-10-09 20:21:57 +02:00
4622f4b51d Fix plot leave 2020-10-09 20:21:02 +02:00
4d51dc9b6c Switch to translateable captions 2020-10-09 17:47:51 +01:00
76b992509b use format not silly round stuff 2020-10-09 17:29:05 +01:00
925978db8f change default lighting to 1 2020-10-09 17:26:52 +01:00
c0e90ddb33 increase interval of progress notify 2020-10-09 17:25:48 +01:00
a7a29eaf97 Correctly cancel notify tasks and add notifications to commands 2020-10-09 17:24:59 +01:00
a451d2d6f2 Fix the injection 2020-10-09 16:34:59 +01:00
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
f721a7c66c Update build.gradle.kts 2020-10-08 21:25:09 +02:00
bba499649b No need to point if PAPI is not in use 2020-10-08 20:56:33 +02:00
f9cd54c445 Shift logger.info -> error when running in an outdated environment 2020-10-08 20:54:06 +02:00
0d89125a8e Replace sys out with logger factory 2020-10-08 20:52:02 +02:00
6b37d678df Fix plot template tab completion 2020-10-08 20:47:43 +02:00
02698b3a0e Fix plot grant tab completion 2020-10-08 20:42:17 +02:00
6f0512c18c Fix plot set tab completions 2020-10-08 20:16:29 +02:00
e46b38b301 Fix plot set values 2020-10-08 19:51:42 +02:00
5841817fb5 Missing space 2020-10-08 19:29:09 +02:00
e28fb49015 Add override permission for /plot music 2020-10-08 19:27:05 +02:00
841eef6a52 Fix done message on backup and add done message to grant 2020-10-08 18:57:11 +02:00
2eee1ef203 Fix log4j 2020-10-08 14:33:48 +02:00
cd605f4996 Relocate log4j, move slf4j declaration 2020-10-08 14:02:08 +02:00
54a8482a88 Minecraft does not always provide slf4j 2020-10-08 14:02:08 +02:00
e15b5a07fb It runs! And it's small! 2020-10-08 14:02:08 +02:00
c198305b5e Add missing relocations 2020-10-08 14:02:08 +02:00
a637a8970b Add maven publishing 2020-10-08 14:02:08 +02:00
d97f68eec0 Address review issues 2020-10-08 14:02:08 +02:00
c3069a425d Format licence headers 2020-10-08 14:02:08 +02:00
9b1dc7d42e She compiles! 2020-10-08 14:02:08 +02:00
ec23fcdd75 Rewrite build scripts
Co-Authored By: Mariell Hoversholm <proximyst@proximyst.com>
2020-10-08 14:02:08 +02:00
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
b55d836871 5.13.7 2020-10-07 11:59:44 +01:00
a210f523a5 Add more information to debugpaste 2020-10-04 18:19:29 +02:00
e6237d68d0 Also remove BungeePerms from the config 2020-10-04 13:26:56 +02:00
56e6922279 Remove BungeePerms UUID fetcher 2020-10-04 13:26:56 +02:00
6e2f738d86 Stop relying on maxim's repo as it's very unreliable. 2020-10-04 12:24:37 +01:00
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
95f509d337 Stop forcing loiwercase world names 2020-10-02 15:08:14 +01:00
2f5ce67154 add back setShouldAbortSpawn 2020-09-29 15:55:08 +01:00
89318be5f4 Apply e2f9b4245b to paper listener too 2020-09-29 15:53:23 +01:00
f80e8c8d11 For sake of allowing v5 -> v6 2020-09-25 20:08:28 +01:00
8c4bb4140a 5.13.6 2020-09-20 19:51:54 +01:00
ff83931a3f Fix plot grant 2020-09-20 19:42:13 +01:00
2468be4736 Merge branch 'v6' of https://github.com/IntellectualSites/PlotSquared into v6 2020-09-20 17:36:35 +02:00
4e835ed3ff Add missing command description 2020-09-20 00:51:54 +02:00
41f494fbff Remove jetbrains annotations 2020-09-18 12:45:26 +01:00
e974fe5dc7 Merge branch 'v6' into features/v6/queue-features 2020-09-18 12:22:32 +01:00
85a23442cc bump minimessage version to fix build 2020-09-18 12:22:01 +01:00
a822a70f00 bump minimessage so it compiles 2020-09-18 12:11:34 +01:00
819902c24e Fix licenses 2020-09-14 22:00:09 +01:00
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
8547533210 update pom 2020-09-11 15:04:09 +01:00
d843d1715d Allow /plot home [area|world] 2020-09-11 15:03:48 +01:00
1552a8e74b Add option to change lighting behaviour in queues 2020-09-11 14:18:50 +01:00
f0e9a8c5fe Implement progress subscribers 2020-09-11 12:59:40 +01:00
648953ec1f 5.13.5 2020-09-11 12:27:23 +02:00
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
a98b23af02 progress subscriber 2020-09-11 11:20:38 +01:00
5463f15633 Add pigstep music disc 2020-09-11 01:16:57 +02:00
0c6113b0d1 5.13.4 2020-09-09 23:31:30 +02:00
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
f2355a76d6 Add default namespace when wrapping block categories by their ids 2020-09-06 23:36:36 +02:00
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
5c48e4ad19 Add missing license header 2020-09-05 18:39:56 +02:00
f6d1e2b3b8 Check TileState manually on 1.13.2, fixes PS-122 2020-09-05 18:39:56 +02:00
37010d92ee Create CODEOWNERS 2020-09-05 13:42:11 +02:00
babad3ab6d Don't validate plot aliases with offline players (Fixes PS-126) 2020-09-04 14:49:02 +02:00
b12e9832c9 Update pom.xml 2020-09-02 17:20:54 +02:00
0f9554c717 Merge branch 'v5' into v6 2020-09-02 17:19:12 +02:00
d19dde2f85 Add more debugs 2020-09-02 17:18:41 +02:00
7a529e156d Add deb for onBlockIgnite event 2020-09-02 17:03:56 +02:00
cba2474df7 Merge v5/v6 2020-09-02 16:44:18 +02:00
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
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
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
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
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
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
c51c938e8d Merge pull request #2903 from IntellectualSites/dependabot/add-v2-config-file
Create Dependabot config file
2020-09-02 16:10:14 +02:00
49984f2560 Create Dependabot config file 2020-09-02 13:55:15 +00:00
b3c77ef099 Merge branch 'dependabot/gradle/v5/org.jetbrains.kotlin-kotlin-stdlib-1.4.0' into v5 2020-09-02 12:57:05 +02:00
97e34844b4 Add option to opt-out MvDW Placeholder API 2020-09-02 12:13:23 +02:00
e924a1920e Add message to rgar 2020-09-01 00:02:56 +02:00
1441cc293c 5.13.3 2020-08-26 13:57:20 +02:00
311a2ddc75 Replace null checks with NullEconHandler 2020-08-25 12:41:03 +02:00
551d1d9f1a Add NullEconHandler to avoid verbose null checks 2020-08-25 12:41:03 +02:00
a5dea9e7f6 Permission cleanup 2020-08-24 20:51:23 +02:00
02bd83bd90 Merge v5 into v6 2020-08-24 14:33:53 +02:00
c42d5390a4 Allow teleporting to merged plots with multiple owners using /p home 2020-08-24 13:37:12 +02:00
31ea7297c2 Generate signs by default 2020-08-24 13:30:50 +02:00
c53cffb745 Generate signs by default 2020-08-24 13:17:15 +02:00
26a99a122a Minor permission fix 2020-08-23 19:34:22 +02:00
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
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
3a8fa9f5b6 Update WorldEdit version
That doesn't appear to break stuff 👀
2020-08-22 13:18:00 +02:00
e93d7feb2c Fixes PS-114 2020-08-22 11:48:03 +02:00
116b870152 Apply missing license header 2020-08-22 11:44:34 +02:00
667c7b07b6 Merge pull request #2897 from IntellectualSites/features/v6/services 2020-08-21 23:03:29 +02:00
45e75cc06e Merge branch 'v6' into features/v6/services 2020-08-21 23:02:52 +02:00
5c08db2f44 Merge branch 'feature/v5/1.16.2-support' into v5 2020-08-21 19:02:23 +02:00
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
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
1064d777c2 Clean up unused code 2020-08-21 00:02:07 +02:00
62f675adbe Allow visiting all owners of merged plots 2020-08-21 00:01:53 +02:00
cee0bbb805 Revert target usage 2020-08-20 23:29:51 +02:00
77eb75fcc6 Adapt adventure changes 2020-08-20 23:28:42 +02:00
55211907f2 Use command descriptions from translations 2020-08-20 23:16:15 +02:00
e1e7cd1479 Add missing license headers 2020-08-20 17:11:12 +02:00
2d3c729215 Extract plot modifications to external class 2020-08-20 17:10:50 +02:00
f391cfd432 Extract comment logic from the plot class 2020-08-20 16:03:06 +02:00
352136f0c6 Cleanup logging system 2020-08-18 15:50:28 +02:00
b6e7f90f6a Fix logger.info format 2020-08-18 15:34:43 +02:00
86cfeb76b6 More json stuff 2020-08-18 12:22:26 +02:00
d91357a807 Update messages_en.json 2020-08-18 10:59:44 +02:00
3c8d7a808b Prefix changes and others 2020-08-17 23:21:18 +02:00
d6a80c7ea5 More json stuff, fixes and enhancements 2020-08-17 22:26:01 +02:00
05a15ac689 Fix a few typos and spaces 2020-08-17 19:39:43 +02:00
580cc359e5 fabb9b6fd7 (r41530745) 2020-08-17 18:56:27 +02:00
630284e7ae More json fixes 2020-08-17 18:42:42 +02:00
cc562033e7 Fix console requirement 2020-08-17 18:29:51 +02:00
fabb9b6fd7 More json stuff 2020-08-17 18:15:29 +02:00
e8ffcaae46 progress subscriber 2020-08-17 16:21:11 +01:00
47d9895077 Fix ms to ticks conversion on Paper 2020-08-17 16:37:27 +02:00
aacf15757f Use less confusing variable name 2020-08-17 15:32:17 +02:00
914b44069b Convert item display name 2020-08-17 15:22:41 +02:00
4789327378 Encapsulate fields 2020-08-17 15:17:40 +02:00
c55f2945ac Fix sign text 2020-08-17 15:08:21 +02:00
c6a368d6f2 More json fixes 2020-08-17 13:24:15 +02:00
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
7cd1e8ea76 Fix command registration 2020-08-17 04:39:59 +02:00
351ae1b2c7 Synchronize auto queries 2020-08-17 01:27:45 +02:00
457f3e25cc resolve rebase issue 2020-08-17 01:10:46 +02:00
41c670450b Remove PlotFilter 2020-08-17 01:10:46 +02:00
f636db49f7 Remove SetupObject 2020-08-17 01:10:46 +02:00
505bba7612 Fix recursive call 2020-08-17 00:53:39 +02:00
72507aba4b Change player locale on event 2020-08-17 00:29:53 +02:00
9b086b3f2a Insert missing keys into message files 2020-08-17 00:29:53 +02:00
f9d7d2d1dd Fix clickable messages 2020-08-16 19:43:27 +02:00
e9efa3f2d3 Fix some translation issues 2020-08-16 18:24:54 +02:00
665a72a08f Fill out a lot more JavaDoc.
I've left DB stuff alone
2020-08-16 13:22:49 +01:00
61d1dcc231 Ignore Events if they are not caused by real players (i.e. citizens) 2020-08-16 14:09:32 +02:00
6c9b73b100 Apply patch by @SirYwell to construct the ResourceKey without consulting the DimensionManager 2020-08-16 14:02:03 +02:00
a4c9ed90b7 Fix startup issues and make messages send properly 2020-08-16 13:49:16 +02:00
28d6d4db92 Fix shading mess and make the plugin start 2020-08-16 12:44:10 +02:00
12def37194 clean up some javadoc stuff 2020-08-16 11:34:08 +01:00
ed2302e545 Remove illegal import 2020-08-16 12:10:19 +02:00
618adb913d Update license and remove dead module entries 2020-08-15 19:17:29 +02:00
4a220f9bfb Update license header 2020-08-15 14:59:29 +02:00
300abd868a Merge pull request #2888 from IntellectualSites/fix-conversion
Fix problem with config creation
2020-08-14 18:36:57 +02:00
87f0b1fc97 Add service system and rewrite Auto to use the service system 2020-08-14 17:24:34 +02:00
78a6e72fe1 5.13.2 2020-08-14 15:26:32 +02:00
8f1b2a9d2a fix pve against animals on other plots and roads 2020-08-14 14:21:45 +01:00
5b27b652e7 Fix color tag 2020-08-14 12:52:00 +02:00
556ff0baf4 Fix line break 2020-08-14 12:27:38 +02:00
8cc536b20f Fix spelling 2020-08-14 11:57:37 +02:00
5e20c871a5 Fix metrics setting 2020-08-14 11:36:17 +02:00
56fb892818 Fix brackets 2020-08-14 00:37:06 +02:00
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
0eeface374 Remove old translations 2020-08-13 21:37:28 +02:00
ffe1e1e40d Core is Core 2020-08-13 21:25:17 +02:00
5efdef19cf Remove dead asset setting 2020-08-13 21:16:30 +02:00
c9fae6a070 Remove old translation setup and move commands to templates 2020-08-13 21:11:07 +02:00
2b17f730d4 Merge v5 into v6 2020-08-12 18:20:37 +02:00
808bddbfbb Apply scaling to image 2020-08-12 10:30:05 +02:00
d6dfa9a0b9 https 2020-08-11 20:12:31 +02:00
924b73f070 Merge pull request #2896 from luca-gg/patch-1
Update de-DE.yml
2020-08-11 19:33:41 +02:00
64181c6ab8 Update de-DE.yml
adjusted grammar
2020-08-11 19:29:40 +02:00
a1b10a2900 Remove dead files 2020-08-11 17:49:04 +02:00
6315b9ea52 gradle 6.6 2020-08-11 17:43:24 +02:00
7c756304b5 1.16.2 support
- Bump EssentialsX version to the latest release
2020-08-11 16:20:33 +02:00
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
7cd9a03b0f Merge pull request #2894 from TimonMi/patch-1
Update link for contributing
2020-08-09 13:20:17 +02:00
f8bd844c6c Update link for contributing 2020-08-09 13:18:35 +02:00
987d9a267c added german translation for flag-descriptions to de-DE.yml 2020-08-09 13:05:40 +02:00
98d1bb9264 Merge remote-tracking branch 'upstream/v5' into v5 2020-08-08 18:39:47 +02:00
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
6e16ef1246 remove PllayerEvents 2020-08-08 13:21:46 +01:00
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
74a5c48214 Finish up core and bukkit json 2020-08-08 12:16:48 +01:00
11af906c79 Fix a little oopsie 2020-08-07 18:55:22 +02:00
c31c4b4286 More work 2020-08-07 18:52:45 +02:00
7f29b5d1e8 ComponentPreset inventory to json 2020-08-07 13:22:10 +01:00
6012705e95 Implement Permission#format to replace the CaptionUtility#format method 2020-08-07 12:12:16 +01:00
21a97863ac Refactor Captions to Permission, reimplement message list in debug command 2020-08-07 11:53:32 +01:00
50cfecb3fd Several minor progress. Couple of bigger (inboxes and help) 2020-08-07 11:08:03 +01:00
1461804039 Remove last reference to PlotMessage in Core 2020-08-07 10:20:11 +01:00
dc3f45acd4 Added UseFlag check at Roads 2020-08-07 09:57:02 +01:00
6970dfa5f8 More json progress 2020-08-07 02:53:05 +02:00
48d3c2105d Fixes an OfflinePlayerUtil breakage caused by NMS Changes 2020-08-06 15:23:36 +02:00
18f630ba15 Bit more json 2020-08-06 14:06:19 +01:00
f68eb9c778 update plot list 2020-08-06 13:36:15 +01:00
4a960d9f2c update pagination to new json 2020-08-06 12:23:47 +01:00
c745b99922 Added UseFlag check at Roads 2020-08-06 12:01:43 +02:00
f1e3902fea Several more progress 2020-08-05 11:48:10 +01:00
41a623a643 More work towards json 2020-08-04 19:01:25 +02:00
d3fe1d3b2b Fix plot info, sign usage in Plot.class 2020-08-04 15:07:07 +01:00
3fd3baaa47 Making progress on messages 2020-08-03 23:59:16 +02:00
01d2b0024f Add more information to the debugpaste 2020-07-31 20:33:17 +02:00
01e66f8833 Readd skyblock template 2020-07-29 14:53:09 +02:00
afd9b56e71 Merge branch 'v5' of github.com:IntellectualSites/PlotSquared into v5 2020-07-28 13:58:37 +01:00
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
22a007b514 Revert "Update zh-CN.yml"
This reverts commit 240362a16d.
2020-07-28 12:33:04 +02:00
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
704e92c3d0 Use placeholder 2020-07-28 09:38:27 +01:00
97b1a60ae8 Move comments to ChunkCoordinator, remove Range annotations 2020-07-28 08:44:16 +01:00
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
ab121c7eee Fixes https://github.com/IntellectualSites/PlotSquaredSuggestions/issues/133 2020-07-26 21:12:32 +02:00
240362a16d Update zh-CN.yml 2020-07-26 17:08:58 +02:00
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
88df434404 Create CODE_OF_CONDUCT.md 2020-07-25 03:11:07 +02:00
b3ddabda29 Fix DelegateQueueCoordinator 2020-07-24 18:20:26 +01:00
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
615a5212bf update bukkit pom 2020-07-24 17:57:16 +01:00
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
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
7aaa075ba8 Javadoc, some cleanup 2020-07-24 17:00:08 +01:00
4fb590889a Remove all permission related errors 2020-07-24 17:44:47 +02:00
115ca903b2 Remove unused stuff 2020-07-24 17:36:48 +02:00
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
1d0760c630 Formatting, mark nonnull, nullable etc 2020-07-24 16:24:53 +01:00
af44fe74ff Add namespaces for translations 2020-07-24 17:19:25 +02:00
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
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
416e181992 Merge branch 'v6' into feature/v6/pipeline-queue 2020-07-24 13:10:11 +01:00
d7a49e3316 This is not my fault 2020-07-24 14:08:40 +02:00
cf13f13fbf Merge branch 'v6' into feature/v6/pipeline-queue 2020-07-24 13:03:42 +01:00
f53a8d3b06 Fix permissionprofile initialisation order 2020-07-24 14:02:49 +02:00
8c5c1922c9 Merge branch 'v6' into feature/v6/pipeline-queue 2020-07-24 12:34:41 +01:00
707559e023 Merge remote-tracking branch 'origin/v6' into v6 2020-07-24 13:33:00 +02:00
97a2ccbfe0 make sure the PlayerMetaDataKeys keys are loaded 2020-07-24 13:32:46 +02:00
95f2a7a908 fix version 2020-07-24 12:22:13 +01:00
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
d906a85095 Fix some issues I caused with Guice 2020-07-24 12:18:36 +01:00
dc1f669a1f Remove permission caching 2020-07-24 13:01:38 +02:00
0ea862b572 Merge pull request #2886 from IntellectualSites/features/v6/permissions
Permission system fixup
2020-07-24 12:49:37 +02:00
fe7a57b2b7 Remove mainutil cache workaround 2020-07-24 12:48:45 +02:00
c9c62a1083 Remove dumb permission mess. 2020-07-24 12:44:04 +02:00
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
722361aedb Implement suggestions from PR comments 2020-07-24 12:15:25 +02:00
d2f40612f4 Switch from Class<T> to TypeLiteral, and implement managed meta access for temporary meta 2020-07-24 12:15:25 +02:00
6a63e5bb51 Expose the player's lock repository 2020-07-24 12:15:25 +02:00
ad40ab7e1e Grant plots to the correct player 2020-07-24 12:15:25 +02:00
05ce67fbfe Trick the compiler 2020-07-24 12:15:25 +02:00
555860cf83 Add managed persistent meta data access 2020-07-24 12:15:25 +02:00
2575787bd0 Add LockRepository 2020-07-24 12:15:25 +02:00
2cfb646065 Javadoc no fun 2020-07-23 18:11:52 +01:00
a1da452c41 Fix build properly 2020-07-23 18:09:37 +01:00
420e38bead idek? 2020-07-23 18:07:23 +01:00
41c4018a27 Merge branch 'v6' into feature/v6/pipeline-queue 2020-07-23 18:06:45 +01:00
4d4f755607 6.0.0-SUPER-SNAPSHOT 2020-07-23 18:06:14 +01:00
d8e5daf12b Fix missing Main->Chunk Util change 2020-07-23 18:04:01 +01:00
c3322021d0 mavenLocal, poms 2020-07-23 18:02:29 +01:00
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
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
d8e80daa93 Fix annoying guice injection issue 2020-07-23 15:40:43 +02:00
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
a7de76d150 Fix dependencies 2020-07-23 15:03:57 +02:00
2154e237ff Remove construction of fake player entities for offline players. 2020-07-23 15:03:57 +02:00
5fda3e9765 Get rid of PermHandler 2020-07-23 15:03:57 +02:00
b302bb9379 Make VaultPermissionHandler extent BukkitPermissionHandler 2020-07-23 15:03:57 +02:00
bfbb81030f Start working on the new permission system 2020-07-23 15:03:57 +02:00
63ce3292aa Fix PlayerManager injection 2020-07-23 15:03:27 +02:00
b9a8846ee9 Fix WorldManager injection 2020-07-23 14:56:53 +02:00
6ae1d28f80 Fix WorldManager injection 2020-07-23 14:56:06 +02:00
17d358f8fe Fix plot ID issues 2020-07-23 14:14:15 +02:00
cfd71457d2 Clean up BlockUtil 2020-07-23 14:14:15 +02:00
87285e08dc Fix plot ID issues 2020-07-23 14:11:34 +02:00
b3a63123fd Fix dependencies 2020-07-23 14:03:56 +02:00
7fc8238fb0 Remove construction of fake player entities for offline players. 2020-07-23 12:47:00 +02:00
32a0765484 Force more compilation errors 2020-07-22 21:09:38 +02:00
c5e1b87c61 Fix small issues 2020-07-22 21:06:23 +02:00
603d1ee9bb Even more
Ok seriously, I stop here
2020-07-22 20:38:46 +02:00
86a0816b26 Merge remote-tracking branch 'origin/feature/v6/json' into feature/v6/json 2020-07-22 19:55:03 +02:00
287cb0f5ad Fix minor issues 2020-07-22 19:54:35 +02:00
3009db3aa7 Update FlagCommand.java 2020-07-22 19:47:58 +02:00
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
9d6744ec15 Get rid of PermHandler 2020-07-22 12:35:48 +02:00
532f2caa37 Make VaultPermissionHandler extent BukkitPermissionHandler 2020-07-22 12:06:56 +02:00
da2fa24e74 Merge remote-tracking branch 'origin/v6' into v6 2020-07-22 12:05:50 +02:00
8d04728ebc More work 2020-07-22 00:08:51 +02:00
2aa5c276c9 Some more work done towards json 2020-07-21 21:39:52 +02:00
6dba31b257 Start working on the new permission system 2020-07-21 14:28:54 +02:00
6040e1bb5e remove mainutil 2020-07-21 13:14:55 +02:00
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
73e3572c72 Fix the redstone flag on roads 2020-07-21 13:11:28 +02:00
5f76cc4f7b Give ConsolePlayer the same treatment 2020-07-21 13:07:33 +02:00
186a810bf6 Bring back PAPI placeholders and raw colour formatting 2020-07-21 13:05:40 +02:00
207e56969b Remove ChunkManager#chunkTask 2020-07-19 16:03:40 +01:00
94b6a27cf3 add missing license headers 2020-07-19 16:02:30 +01:00
21693e344c Switch from MainUtil 2020-07-19 14:37:42 +01:00
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
ed27422e69 Move IJ/xyz cache out of MainUItil to its own class 2020-07-19 14:21:52 +01:00
d24c89405a Switch to using a Clipboard for regen in preparation for WE changes 2020-07-19 14:17:38 +01:00
2d518dfe2b Clean up BlockUtil 2020-07-19 14:49:26 +02:00
f357fa74f3 Remove unused files 2020-07-19 14:37:53 +02:00
335cf5d2e9 Fix issues 2020-07-19 14:34:42 +02:00
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
23783b8b0b add deprecations 2020-07-19 14:24:42 +02:00
193054f1fc Move shit out of MainUtil into more appropriate classes 2020-07-19 14:23:55 +02:00
87a8ff742f 5.13.1 2020-07-19 14:16:13 +02:00
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
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
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
39fdaa367c Make PlotQuery iterable 2020-07-18 16:18:23 +02:00
7e0cdb12d7 Replace some common messages 2020-07-18 15:06:51 +02:00
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
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
e80ade65c7 Clean up PlotId 2020-07-18 11:05:16 +02:00
4d24112ec7 Fix merge issues 2020-07-17 23:06:40 +02:00
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
d077fafd29 Some random bukkitutil/worldutil improvements 2020-07-17 23:00:09 +02:00
5478e70576 Fix some more captions 2020-07-17 21:46:15 +02:00
66b94ab9f1 Start switching to WorldEdit Worlds 2020-07-17 17:21:32 +01:00
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
22bd2eb238 Super minor issues from previous merges 2020-07-17 18:06:38 +02:00
2a72f274c9 Fix failed merge 2020-07-17 18:00:08 +02:00
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
932052772c Fix edge cases for time conversion 2020-07-17 17:53:30 +02:00
43d058d3db Address comments 2020-07-17 17:53:30 +02:00
020b030667 More fixes 2020-07-17 17:53:30 +02:00
5a3eacde0b Replace method synchronization logic 2020-07-17 17:53:30 +02:00
7f412f5472 Begin work on the task system 2020-07-17 17:53:30 +02:00
33b6ef66d6 Delombok + import organisation 2020-07-17 17:24:45 +02:00
9fefe57c90 Switch to using QueueCoordinators everywhere 2020-07-17 15:41:06 +01:00
ed77522c08 Add wna block setting, use WorldEdit worlds rather than Strings. 2020-07-17 14:38:50 +01:00
09aca839a8 Add back changes to ChunkCoordinator 2020-07-17 14:00:01 +01:00
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
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
01ff9a34c2 Merge branch 'features/v5/placeholders' into v5 2020-07-16 18:48:45 +02:00
ff3a94933a Bump version 2020-07-16 18:43:52 +02:00
97a356c4a0 Very attentive reviewers, can recommend 2020-07-16 18:13:02 +02:00
10ab28c1ec Add missing license headers 2020-07-16 18:08:00 +02:00
2d9cf8b759 Get placeholders working 2020-07-16 18:04:17 +02:00
32b28a4ca5 Turn all UUID messages into debug messages 2020-07-15 22:42:58 +02:00
4996d8bcd1 Remove left over debugs 2020-07-15 14:05:15 +02:00
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
e8c155763b Register placeholders 2020-07-15 12:44:07 +02:00
a52249513e Update MVdW version 2020-07-15 12:05:42 +02:00
5d2d4ac12b fix language issue 2020-07-14 20:47:15 +02:00
64f5580edd Fix code styling issue 2020-07-14 20:46:52 +02:00
b989531a60 Merge branch 'v5' into features/v5/placeholders 2020-07-14 20:41:17 +02:00
34655b8d41 Add (untested) MVdWPlaceholderAPI support 2020-07-14 20:41:08 +02:00
30327d2fa3 update bukkit pom 2020-07-14 19:11:46 +01:00
2e4c43c251 Add config option to disable placing top wall blocks 2020-07-14 19:10:53 +01:00
c0a0d36e5d Remove remaining jetbrains imports 2020-07-14 19:40:47 +02:00
b68d7150f1 Manually fix some merge conflicts 2020-07-14 19:34:44 +02:00
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
8eb903ad72 Merge branch 'v5' into v6
# Conflicts:
#	Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java
2020-07-14 19:18:08 +02:00
c853147635 Merge pull request #2870 from IntellectualSites/feature/v6/platform 2020-07-14 19:13:00 +02:00
0294397021 Manually resolve a bunch of merge issues 2020-07-14 19:10:52 +02:00
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
510ea56431 Finalize DI stuff 2020-07-14 18:49:40 +02:00
7897d78f0d Merge pull request #2868 from IntellectualSites/feature/v6/slf4j 2020-07-14 18:49:34 +02:00
25a58a5c46 Merge branch 'v6' into feature/v6/platform 2020-07-14 17:45:33 +02:00
f9e5fd714d Merge remote-tracking branch 'origin/feature/v6/platform' into feature/v6/platform 2020-07-14 17:07:03 +02:00
55eefd09da Merge branch 'v6' into feature/v6/json 2020-07-14 16:52:40 +02:00
0ce1f3e0f6 Send special message when caption cannot be found 2020-07-14 16:36:13 +02:00
99be181aea Migrate some more captions 2020-07-14 16:31:58 +02:00
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
1dc4da8beb Fix issues from previous merge 2020-07-14 13:21:59 +02:00
1908588fcb Change expansion author and version 2020-07-14 13:17:21 +02:00
af7db08036 Add new placeholder system 2020-07-14 13:14:02 +02:00
e72ce9c90e Update gradle.yml 2020-07-14 12:44:11 +02:00
32264ae5e3 Update gradle.yml 2020-07-14 12:43:45 +02:00
33f2ff7e6d Merge branch 'v6' into feature/v6/slf4j 2020-07-13 23:11:40 +02:00
6664d49928 Prefix all log messages 2020-07-13 23:04:27 +02:00
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
a1f262b5b2 Fix gradle setup and replace all debug calls 2020-07-13 22:51:57 +02:00
b109b76120 Nevermind, it doesn't allow for relocations 2020-07-13 20:50:49 +02:00
1388f280e6 Update module poms 2020-07-13 20:46:34 +02:00
d141b040d6 Fix relocations 2020-07-13 20:45:04 +02:00
e84d82315c Add log4j config (this might work :p) 2020-07-13 20:39:52 +02:00
c6962ef4d2 Shift a few more messages to debug 2020-07-13 19:56:34 +02:00
f93714a44e Properly add prefixes to messages 2020-07-13 13:01:13 +02:00
564efd77f7 Fix some messages 2020-07-12 22:11:23 +02:00
5442c7cc2e Start moving commands to new message system 2020-07-12 22:06:07 +02:00
0fa5a16cd0 replace remaining debug calls 2020-07-12 21:49:05 +02:00
1881cdc9ab Revert "Add prefix"
This reverts commit fb2aa44f78.
2020-07-12 21:28:38 +02:00
fb2aa44f78 Add prefix 2020-07-12 21:25:22 +02:00
e88da3cea9 Add chunk coordinator 2020-07-12 20:58:48 +02:00
14b6f84816 fix typos that were c/p over 2020-07-12 18:50:04 +01:00
ac8841447c 6cf2c0ad97 (r40542418) 2020-07-12 17:11:25 +02:00
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
c045ef698c Add license headers and fix method change in PlotSquared.java 2020-07-12 11:42:45 +01:00
5cdb3f4fd5 Add missing injection points 2020-07-12 12:25:44 +02:00
5a5c5721cc fix compiler crashing 2020-07-12 07:38:57 +02:00
3a11ffc77a Clean up bukkit listeners by splitting them up 2020-07-11 19:03:55 +01:00
916675fb08 Guice progress 2020-07-11 17:19:19 +02:00
a2ec404014 Fix /plot target nearest 2020-07-11 13:40:22 +01:00
6f6cb4b630 More DI progress 2020-07-11 05:29:41 +02:00
c0f69f321d Guice progress 2020-07-10 22:12:37 +02:00
55bf41d2da Remove dumdum static access 2020-07-10 19:25:05 +02:00
7687d7705b Fix merge issue 2020-07-10 18:38:14 +02:00
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
afb72aa102 Don't include eggs with spawn*_eggs* 2020-07-10 17:31:46 +01:00
d00dc658df Inject EventDispatcher and PlotListener 2020-07-10 18:17:44 +02:00
2dab7c8dda Inject PlotAreaManager 2020-07-10 17:32:07 +02:00
c37cc40ad9 Move annotation in BukkitWorld 2020-07-10 12:27:26 +02:00
5341015cb1 Finalize immutable locations and add a platform world implementation 2020-07-10 12:21:29 +02:00
2fb76e6636 Split road and plot paste-on-top settings 2020-07-09 22:39:06 +01:00
5b260ea8da update bukkit pom 2020-07-09 22:33:01 +01:00
55139eb134 Do not respect paste on top for road schematics. 2020-07-09 22:19:23 +01:00
5e44bb60c6 Merge branch 'v5' of github.com:IntellectualSites/PlotSquared into v5 2020-07-09 22:14:38 +01:00
96740fd282 Couple of fixes to road flag logic 2020-07-09 21:52:51 +01:00
cf1b027db9 Start making locations immutable 2020-07-09 22:28:46 +02:00
fb050ac3da 5.12.5 2020-07-09 21:15:28 +02:00
b36c6427d1 Split failed UUID batches into individual requests in order to identify the invalid UUIDs 2020-07-09 20:37:14 +02:00
63c308971b Update location block vector on add and subtract 2020-07-09 20:14:06 +02:00
cfd389883b Improve piston interaction with area border 2020-07-09 20:14:06 +02:00
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
89cb6450fb Fix issue where PlotPlayer#getLocation returns a mutable location 2020-07-09 20:04:00 +02:00
699eb71e2a Fix kill-road-mobs. Fixes PS-73 2020-07-09 19:46:17 +02:00
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
904f5485ab Merge remote-tracking branch 'origin/v5' into v5 2020-07-09 16:38:53 +02:00
e05d817482 Fix plot owner placeholder. Fixes PS-62. 2020-07-09 16:38:46 +02:00
db37077af7 Make signs able to use captions 2020-07-09 12:58:28 +02:00
61de18190f More dispense blocking on roads 2020-07-09 12:33:23 +02:00
1310f9470e 5.12.4 2020-07-08 19:34:08 +01:00
d652225f36 Let players teleport to their merged plots 2020-07-08 19:33:58 +02:00
2936b806f3 Allow players to interact on their own plot 2020-07-08 17:10:09 +01:00
3fa532a3c0 Move message sending into PlotPlayer to make it platform independent 2020-07-08 15:35:58 +02:00
d267d1bb98 Start expiry tasks 2020-07-08 14:35:46 +01:00
9792d4cc4b Remove style.yml 2020-07-08 15:23:33 +02:00
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
c36e311520 Continue cleaning up PlotSquared.java 2020-07-08 15:09:25 +02:00
f2191cb731 Save style.yml again 2020-07-08 13:59:31 +02:00
265c10ec1c Remove commands.yml 2020-07-08 13:59:31 +02:00
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
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
67a49a2ca7 5.12.3 2020-07-07 21:03:30 +02:00
57127537f7 Add permission check for /plot home 2020-07-07 20:45:52 +02:00
3476522c00 Allow /p v <alias> 2020-07-07 20:45:52 +02:00
3d087b1bbe Fix tab completion and usage 2020-07-07 20:45:52 +02:00
c058614fcc Split visit command into home and visit 2020-07-07 20:45:52 +02:00
9e9db0f1df Merge branch 'features/v5/road-respect-flags' into v5 2020-07-07 17:49:32 +01:00
e826836c36 Merge branch 'v5' into features/v5/road-respect-flags 2020-07-07 17:48:46 +01:00
196df855ac Clean up PlotAreaManager and move a bunch of plot area related logic out of PlotSquared 2020-07-07 13:37:03 +02:00
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
298e65a394 Replace remaining references to PlotSquared#log 2020-07-06 17:17:46 +02:00
078b776f60 Implement console messages 2020-07-05 18:14:29 +02:00
4d61a345c6 Small documentation fixes 2020-07-05 18:06:10 +02:00
dc0358957e Add prefix replacement to messages and skip sending empty messages 2020-07-05 18:02:43 +02:00
42d648e338 Use adventure for titles 2020-07-05 17:57:58 +02:00
1c254984c1 Replace logging references in Bukkitmain 2020-07-05 13:56:54 +02:00
f287cc34e7 Remove json message stuff 2020-07-05 13:46:25 +02:00
c8a8806e7d Component progress. The plugin is **very** broken right now. 2020-07-05 13:41:40 +02:00
d061f728bd Merge remote-tracking branch 'origin/feature/v5/json' into feature/v5/json 2020-07-05 12:44:25 +02:00
b5818bfefc Lazy fix for FancyMessage 1.16 2020-07-04 20:25:49 +02:00
6bf5bc60d1 Update messages_en.json with new placeholders 2020-07-04 18:57:56 +02:00
c784c69eb3 progress 2020-07-04 18:53:03 +02:00
e3759d059a Fixing missing license headers. 2020-07-04 18:03:47 +02:00
429f5e55c3 Add option to disable background caching 2020-07-03 13:50:12 +02:00
0e7a6d7a62 Fix typo 2020-07-03 13:47:50 +02:00
ad1ec42b12 Add new clear pipeline to hpw and make some stuff read access as required. 2020-07-02 14:33:22 +01:00
580212d66d fix build 2020-07-01 21:49:53 +01:00
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
35cff29917 Add license header 2020-07-01 17:24:47 +02:00
2910176b97 Add road flag container 2020-07-01 14:53:57 +01:00
c5ec8e1931 actually fix all conflicts 2020-07-01 14:21:18 +01:00
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
eff410d1da Merge pull request #2862 from IntellectualSites/bukkit/1.16.1
Update to 1.16.1
2020-07-01 12:02:57 +02:00
cbe8875b94 Bump gradle version 2020-07-01 11:59:28 +02:00
49c35ec084 Resolve NMF's concerns 2020-06-29 22:05:32 -04:00
f80cadcd7f Draft of Caption resolving 2020-06-29 21:33:57 +02:00
fa2ad8ab22 Improve plot alias command (tab complete, admin permission) fixes PS-63 2020-06-29 13:48:37 +02:00
600f757046 Finish messages 2020-06-29 12:34:09 +02:00
3a2e932d17 Add missing mobs from 1.13.2+ 2020-06-28 18:45:40 -04:00
a2aaa3633a More work 2020-06-28 16:56:42 +02:00
bd9bdc9e03 Separate the Vault Permission Handling from the Economy Handling 2020-06-28 14:28:11 +02:00
3b793929d8 Initialize messages_en.json 2020-06-28 13:51:57 +02:00
e139550949 Make cache expiration configurable 2020-06-27 23:07:20 +02:00
181c5b134f Update old links 2020-06-27 21:48:15 +02:00
74876f9e64 Get biome data from correct schematic for intersections (Fixes PS-50) 2020-06-27 20:44:46 +01:00
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
9c3d2cfb02 Move the caching and static accessors from EconHandler to PlotMain 2020-06-27 06:26:00 +02:00
9d609c2dfe Merge remote-tracking branch 'remotes/origin/v5' into bukkit/1.16.1 2020-06-26 20:40:50 -04:00
cb04c183a8 Update to 1.16.1 2020-06-26 20:38:30 -04:00
38425a1eae Update world border on Plot#claim (Fixes PS-13) 2020-06-26 13:49:17 +02:00
4b997d42df Some slf4j progress 2020-06-26 11:03:42 +02:00
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
e833403e3c Replace split with substring for placeholders 2020-06-25 14:08:44 +02:00
f64026af1a Only initialise EconHandler when economy is enabled and stop accessing the static instance directly. 2020-06-24 15:26:06 +02:00
efab6e92f7 Lower tab completion cache time and fix "Invalid player" message for /plot kick 2020-06-24 13:44:06 +02:00
f69cc5cc98 Merge remote-tracking branch 'origin/v5' into v5 2020-06-24 08:32:14 +02:00
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
159b35c717 Fix OfflinePlayerUUIDService breaking when no worlds have been loaded. 2020-06-24 08:05:06 +02:00
7fbac4f286 Add a second placeholder to support only local flag of current plot 2020-06-24 00:51:27 +02:00
29080de860 5.12.2 2020-06-23 23:57:27 +02:00
e17222dd19 Merge remote-tracking branch 'origin/v5' into v5 2020-06-23 18:37:00 +02:00
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
c52603921d Bump version 2020-06-23 13:13:01 +02:00
f4724a3c87 Fix expiration flag commands 2020-06-23 11:45:04 +02:00
2b4e2fc793 Add plot debugging and make tab completable aliases configurable 2020-06-23 11:39:45 +02:00
14baead342 Add placeholder to get the value of a plot flag 2020-06-23 01:20:17 +02:00
2d6e6ceaeb Improve documentation of BukkitMain#wrapPlayer and improve generic types 2020-06-22 15:45:57 +02:00
1dcf8d3995 Progress on the debug logging API 2020-06-21 15:50:49 +02:00
d07d32e28b Generate plot blocks on correct height when removing intersection
Fixes PS-46
2020-06-20 00:14:04 +02:00
cb969e37a6 Don't teleport players; Fixes PS-14 2020-06-19 11:36:35 +02:00
6259287dff Add tab completion for /plot <deny|kick|remove> 2020-06-13 15:54:38 +02:00
3e2e61d2be Re-introduce online mode 2020-06-13 15:53:03 +02:00
a3586791b5 Remove unused code and use less aggressive colors 2020-06-11 01:01:00 +02:00
bb298ab660 Remove leftover TODO 2020-06-11 01:01:00 +02:00
8c0f581ff0 Add missing license headers to new files 2020-06-11 01:01:00 +02:00
033b87deb5 Resolve TODOs 2020-06-11 01:01:00 +02:00
b6f1610a7e Provide no suggestions instead of player names for commands 2020-06-11 01:01:00 +02:00
e3fbb32399 Formatting and documentation 2020-06-11 01:01:00 +02:00
67b80bb8e8 Fix /plot setup back 2020-06-11 01:01:00 +02:00
ae1427b189 Remove usage of SetupObject 2020-06-11 01:01:00 +02:00
5165c439fc Add tab completion and fix minor bugs 2020-06-11 01:01:00 +02:00
b15c48e074 Implement setup steps 2020-06-11 01:01:00 +02:00
c5bfde330f First draft of redesigned setup processing 2020-06-11 01:01:00 +02:00
d12ecc8616 Softdepend on new complementary UUID services 2020-06-04 11:41:20 +02:00
950640a557 Revert "Don't send chat spy to message sender"
This reverts commit a37ab10414.
Let's not break plotchat when plotspy is enabled
2020-06-04 11:29:02 +02:00
86746e7843 Fixed https://issues.intellectualsites.com/issue/PS-26 2020-06-03 21:18:46 +02:00
2c74d2479f Exchange website url 2020-06-02 17:06:33 +02:00
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
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
edbacb8e47 Bump dependency version 2020-05-25 20:11:57 +02:00
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
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
fdf82d0d1e Merge pull request #2852 from aurorasmiles/features/v5/uuid
Add BungeePerms UUID service
2020-05-25 13:15:41 +02:00
09327b0128 Merge branch 'v5' into features/v5/uuid 2020-05-25 13:13:29 +02:00
8a3ee4cdc2 Merge pull request #2853 from darbyjack/v5
Updated PAPI & EssX dependency to ensure compatibility
2020-05-25 13:02:10 +02:00
8d1033f725 Merge branch 'v5' into v5 2020-05-25 12:58:32 +02:00
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
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
4b0df80878 Updated PAPI & EssX dependency to ensure compatibility 2020-05-25 00:09:28 -05:00
52b90b6757 Merge pull request #2841 from IntellectualSites/features/v5/uuid 2020-05-25 01:40:35 +02:00
31b71ade69 * :D 2020-05-24 23:43:15 +01:00
0021b114de Revert "Slow down queue a bit because 1.13+ performance is bad"
This reverts commit bbde2f5e06.
2020-05-24 23:24:27 +01:00
28a7d027f6 Merge branch 'v5' into features/v5/uuid 2020-05-24 21:14:56 +02:00
e32a2e2723 Merge pull request #2847 from IntellectualSites/features/v5/single-area 2020-05-24 21:13:51 +02:00
46b68e489d Tab complete /p list 2020-05-24 21:08:11 +02:00
2436a6a402 remove debug, whoops 2020-05-24 20:54:10 +02:00
862467c0fa Tab complete /plot visit 2020-05-24 20:53:16 +02:00
69cfb431b1 Unstupidify Visit 2020-05-24 20:18:02 +02:00
172bd6f0f2 This should hopefully fix that broken merge. Maybe. Possibly. Idk. 2020-05-24 19:05:09 +02:00
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
0b12c4e5b2 Update issue link 2020-05-24 18:48:15 +02:00
0ac6383c2c Use PlotQuery in Visit 2020-05-24 18:35:32 +02:00
76913d4a78 immutable -> mutable 2020-05-24 18:35:32 +02:00
a0d1da3274 fix dum typo 2020-05-24 18:35:32 +02:00
1aa144e47d Deprecate old PlotFilter class 2020-05-24 18:35:32 +02:00
6b31743fb3 add missing javadoc 2020-05-24 18:35:32 +02:00
508fdce704 Add missing methods to PlotQuery and use PlotQuery in ListCmd 2020-05-24 18:35:32 +02:00
e912909aad Add plot query system 2020-05-24 18:35:32 +02:00
98322d5d11 Add BungeePerms UUID service. This should probably work. 2020-05-24 14:32:34 +02:00
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
cc168d5ae9 Fix SQLite table creation statement and add legacy SQLite uuids as a provider 2020-05-24 04:48:19 +02:00
d19df3b6eb Fix offline mode UUIDs 2020-05-24 04:28:29 +02:00
75dbc2db98 Fix offline mode UUIDs 2020-05-24 04:27:20 +02:00
2875b050c5 Add plugin UUID services. They probably work. 2020-05-23 19:43:32 +02:00
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
113da81f29 Actually save the schematic 2020-05-23 16:15:48 +02:00
4dd2613f2f Add missing caption 2020-05-23 15:02:53 +02:00
8c37cc5340 Fix minor issues 2020-05-23 15:02:31 +02:00
47c74cfa6d Set correct region height 2020-05-23 14:39:28 +02:00
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
6d0458281b Merge remote-tracking branch 'origin/v5' into features/v5/single-area 2020-05-23 02:30:45 +02:00
6090c7ccac Link issues to new issue tracker for legacy reasons 2020-05-23 01:25:18 +02:00
5e6b27e21f Update README.md 2020-05-23 00:33:30 +02:00
eee04ab87d Shade guava-mini into the bukkot module 2020-05-22 22:04:46 +02:00
a833803bdf Shade rx into the bukkot module 2020-05-22 22:04:46 +02:00
d2af342a5d Shade r-tree into the bukkit module 2020-05-22 22:04:46 +02:00
93619b3988 Don't access tree until it has been created 2020-05-22 22:04:46 +02:00
dd4c5014fc Get rid of unused field 2020-05-22 22:04:46 +02:00
1e3379b00a Fix up the plot area nightmare 2020-05-22 22:04:46 +02:00
bbde2f5e06 Slow down queue a bit because 1.13+ performance is bad 2020-05-22 10:44:51 +01:00
b61dfd6f97 Single plot area progress 2020-05-22 03:20:11 +02:00
f16fa0a3ed Merge branch 'features/v5/worlds' into features/v5/single-area 2020-05-22 02:56:36 +02:00
d4bd08415a Shade guava-mini into the bukkot module 2020-05-22 02:56:23 +02:00
9ad276eeae Merge branch 'features/v5/worlds' into features/v5/single-area 2020-05-22 02:54:24 +02:00
a3179bf114 Shade rx into the bukkot module 2020-05-22 02:54:10 +02:00
0d20dad2a3 Merge branch 'features/v5/worlds' into features/v5/single-area 2020-05-22 02:52:05 +02:00
7c080770f0 Shade r-tree into the bukkit module 2020-05-22 02:51:40 +02:00
9752e5f62b Start working on single plot areas 2020-05-22 02:48:32 +02:00
3b7057ad4f do a second attempt at fetching uuid batches even if it errors 2020-05-21 21:24:55 +02:00
38a7c771be Don't access tree until it has been created 2020-05-21 20:23:36 +02:00
1c6075df2b Get rid of unused field 2020-05-21 20:06:37 +02:00
3ede0447b0 Fix up the plot area nightmare 2020-05-21 20:06:04 +02:00
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
2417dace2d Add UUID caching 2020-05-20 15:12:09 +02:00
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
525ba648ae ignore build/ and update bukkit pom.xml apparently 2020-05-20 09:44:45 +01:00
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
ea41c842bc Fix a bunch of minor issues 2020-05-20 00:31:59 +02:00
8efc78e1c9 IT COMPILES! 2020-05-19 23:05:36 +02:00
973c18623f Port more commands and add more tab completion utilities 2020-05-19 19:34:33 +02:00
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
123ca8efe9 Update more commands and add proper request timeouts 2020-05-19 17:33:59 +02:00
22c26fe962 Add PlotArea#getFlag 2020-05-19 13:07:50 +01:00
761803f777 Add option for roads to respect a plot area's flags and implement to PlayerEvents 2020-05-19 12:41:51 +01:00
d5d18a60fb Fix #2836
getCompoundTag can also be in Core since we're using WorldEdit.
2020-05-19 11:53:18 +01:00
37b065a097 Progress. 2020-05-19 00:28:52 +02:00
fdfc61cf97 Update username on async pre login event 2020-05-18 20:45:51 +02:00
31c84ab18f Basic pipeline setup 2020-05-18 00:22:34 +02:00
a47527857c Fix wonky annotation placement in SQLiteUUIDService 2020-05-17 23:58:39 +02:00
12f2cb0d58 Add a cache uuid service 2020-05-17 23:57:40 +02:00
67bf90e92f Create the SQLite UUID service and cache 2020-05-17 23:41:59 +02:00
b5f92f5003 Add sync catcher to the blocking pipeline methods 2020-05-17 23:26:19 +02:00
58989c9311 Add some missing methods to the pipeline 2020-05-17 23:20:36 +02:00
736004d88b Don't fill in stacktrace for ServiceError 2020-05-17 18:03:04 +02:00
49f51f24f7 Don't loop services when all mappings have been found 2020-05-17 18:02:26 +02:00
95df62e59b Add missing consumer API methods 2020-05-17 17:48:42 +02:00
64cfe240f9 Port OfflinePlayerUUIDService to the new system 2020-05-17 17:36:12 +02:00
29f2863cf4 Progress 2020-05-17 17:26:48 +02:00
792fa1f11d Improve design 2020-05-17 12:55:07 +02:00
7591c440c2 Begin working on the new UUID service API 2020-05-17 12:40:25 +02:00
c58309b385 Add { transitive = false } to HV 2020-05-16 21:37:14 +02:00
5ae70743b1 Always set the generator 2020-05-16 21:37:14 +02:00
29e0479081 Fix preset initialization 2020-05-16 21:37:14 +02:00
441a73839e Add /plot components 2020-05-16 21:37:14 +02:00
ff8f7a0867 Actually create the world managers 2020-05-16 21:37:14 +02:00
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
5442d43918 Update bug-issue-report-for-plotsquared.md 2020-05-15 16:46:47 +02:00
25d4d23958 5.11.2 2020-05-14 23:15:08 +02:00
86edb20c15 Add a FAWE/WE chart 2020-05-14 16:33:26 +02:00
3d30885daf No PlotSquared-Core-Core 2020-05-14 15:47:25 +02:00
194c5aa27b Merge branch 'v5' of https://github.com/IntellectualSites/PlotSquared into v5 2020-05-14 14:45:33 +01:00
20c487238a PlotSquared-Core please 2020-05-14 14:45:27 +01:00
6814b4bef2 Fix Core archive name 2020-05-14 15:24:43 +02:00
e1a25907f2 Merge branch 'v5' of https://github.com/IntellectualSites/PlotSquared into v5 2020-05-14 14:19:37 +01:00
5f896dd39a Properly copy NBT data in containers 2020-05-14 14:19:33 +01:00
f4729310fa Include the core dependency in the Bukkit module 2020-05-14 14:52:43 +02:00
2f02f4392a Fix names of shaded jars 2020-05-14 14:51:23 +02:00
b7f708dcd6 Fix gradle config 2020-05-14 14:32:20 +02:00
501fd9c8e6 Merge remote-tracking branch 'origin/v5' into v5 2020-05-14 14:16:17 +02:00
7ba7df5cb2 Make the upload task work 2020-05-14 14:16:10 +02:00
9dd9201b67 Allow plot auto from non-plot areas if the server has only one plot area 2020-05-14 13:10:53 +01:00
8fb9f29ab7 Fixes #2827
If existing blocks are an instance of container, clear the inventory.
2020-05-14 12:57:26 +01:00
dd852801cc Merge pull request #2825 from IntellectualSites/tile-entity-cap
Fix chunk processing
2020-05-14 13:18:19 +02:00
1fa41e6209 Merge branch 'v5' into tile-entity-cap 2020-05-14 13:17:41 +02:00
a2db2e8268 Add return 2020-05-14 11:27:35 +01:00
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
98b4ceab7d Fix style.yml 2020-05-13 16:29:10 +01:00
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
e6a9daf31a Make the tile entity limit in ProcessedWEExtent apply per chunk rather than per edit 2020-05-13 14:54:54 +02:00
8c0f7b207e Make the chunk listener NOT delete all tile entities in the chunk 2020-05-13 14:39:58 +02:00
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
19fe2efb6e Fix the WE extent and add our own tile entity list 2020-05-13 14:11:17 +02:00
e6878d7804 clean up ProcessedWEExtent 2020-05-13 12:47:52 +02:00
435d877262 Make the tile entity check respect the chunk processor status 2020-05-13 12:25:48 +02:00
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
a038cb6d1b Merge branch 'v5' of https://github.com/IntellectualSites/PlotSquared into v5 2020-05-12 18:53:57 +01:00
637dd7d0c2 correct update messaging 2020-05-12 18:53:26 +01:00
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
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
2d6a5a3804 Update download link 2020-05-12 15:16:51 +02:00
630e81fbfb 5.11.1 2020-05-12 13:42:24 +02:00
6488aafd9d Version bump 2020-05-12 12:56:18 +02:00
4ad90d423d Fix timeout comment 2020-05-12 12:52:45 +02:00
d2dae45082 Add leaves to the blacklist 2020-05-12 12:49:39 +02:00
85c9bd7ceb Add all sign type to blacklist 2020-05-12 12:24:36 +02:00
d0ee579069 Move backup config section to a more appropriate place 2020-05-12 10:44:34 +01:00
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
e8dd5fe903 Merge pull request #2816 from IntellectualSites/backups
Plot backup system
2020-05-12 09:40:25 +02:00
32c23e6ced Merge branch 'v5' into backups 2020-05-11 22:27:16 +02:00
81aaba328a ENGLISH > ROOT 2020-05-11 22:21:37 +02:00
3c5dd3d0d2 Merge remote-tracking branch 'origin/v5' into v5 2020-05-11 22:11:29 +02:00
2dc07d9321 Add a looooot of default disallowed blocks 2020-05-11 22:11:21 +02:00
841dd5e189 Update wiki links 2020-05-11 20:27:06 +02:00
b2bc2887d2 Fix dumdum merge 2020-05-11 20:17:41 +02:00
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
d40160d205 Fix javadoc 2020-05-11 20:04:22 +02:00
f7167d5e83 Fix typo 2020-05-11 20:03:26 +02:00
282773a43f Replace Guava methods with stdlib equivalents 2020-05-11 20:02:33 +02:00
8944be5319 (Complex) command suggestions for /plot set 2020-05-11 19:37:25 +02:00
df01f9bea7 Add a list of blocks that cannot be used in /plot set <component> 2020-05-11 18:35:06 +02:00
3c17b76b1c Remove dum-dum line break 2020-05-11 11:21:32 +02:00
7a6909dab1 Merge branch 'v5' into backups 2020-05-11 11:19:59 +02:00
3064ae80d1 Add a keep-inventory flag 2020-05-11 11:19:36 +02:00
06bb6856a8 Fix bad getApplicablePlotArea(Location) code
- Fixes #2815 alongside 667098268f
2020-05-11 09:48:18 +01:00
702caa6feb Remove rogue line break 2020-05-10 22:09:56 +02:00
fc74c582bf Add option to disable deletion of plot backups when the plot is unclaimed 2020-05-10 21:52:57 +02:00
658361f825 Destroy backups when the plot is uncalimed 2020-05-10 21:31:16 +02:00
e0c9a802d8 Add automatic backups and implement them /plot clear and /plot set <component>. 2020-05-10 20:31:07 +02:00
c4a70c0945 Fix tab completion for the backup command 2020-05-10 19:42:42 +02:00
f7d6ac00e4 Make the backup commands work 2020-05-10 19:20:11 +02:00
8ed5a21b36 Merge branch 'v5' into backups 2020-05-10 17:03:36 +02:00
773a993ee1 Merge branch 'remove-eol-translation-strings' into v5 2020-05-10 17:02:13 +02:00
6fb63c9609 Implement backup restoration command. This might work, idk, we'll see. 2020-05-10 16:53:19 +02:00
079289eb74 Use #getTranslated on GENERIC_UNOWNED 2020-05-10 16:40:12 +02:00
59f96d4455 Translate all backup failure reasons 2020-05-10 16:39:14 +02:00
cdab52fcbe dumdum space go bye bye 2020-05-10 16:04:33 +02:00
63c9037b10 Fix typo 2020-05-10 16:00:20 +02:00
bbc86eba39 /plot debug progress 2020-05-10 15:51:27 +02:00
e0fb6f5440 /plot debug structure 2020-05-10 15:36:20 +02:00
2bd30af361 Cache both backup profiles and backup objects 2020-05-10 15:12:17 +02:00
b136f44f12 Merge branch 'v5' into remove-eol-translation-strings 2020-05-10 15:05:58 +02:00
d0dbb495b0 Add BackupProfile#restoreBackup 2020-05-10 14:58:45 +02:00
8715a27a93 No backups for merged plots 🐮 2020-05-10 14:41:02 +02:00
503fc44208 Updated according to new translations and old removed 2020-05-10 14:12:56 +02:00
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
7adecd0808 Last fix (removed unused translation + added the missing) 2020-05-10 14:12:56 +02:00
c99e081ae0 Fiexed issues reported by CodeFactor 2020-05-10 14:12:56 +02:00
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
723e29cdd0 Continue working on the backup system 2020-05-10 14:02:25 +02:00
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
e6408b35a2 fix merge auto 2020-05-10 10:44:14 +01:00
3eb0de68c4 Begin working on the structure for the backup system 2020-05-09 20:05:39 +02:00
dd1b944205 Update gradle and remove license header from gradle 2020-05-09 16:47:49 +02:00
ae11f0610e Add a few more translation strings for setup wizard 2020-05-09 16:45:32 +02:00
55fc963673 5.10.6 2020-05-09 13:19:29 +01:00
198c7ca58d Remove dead translations 2020-05-09 14:04:08 +02:00
5a2f70238a Typo 2020-05-06 12:53:27 +01:00
8257b0b563 No lazy init when calling toString,equals or hashCode
That prevents premature initialization as NullBlockCategory
2020-05-06 12:53:27 +01:00
9b997d2195 Make constructor private 2020-05-06 12:53:27 +01:00
a19fa1b92c Send a debug message if category not found 2020-05-06 12:53:27 +01:00
2c060db9c0 Lazily initialize block tags 2020-05-06 12:53:27 +01:00
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
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
df5feff9ec Display the correct number of grants used in auto 2020-05-05 13:50:29 +01:00
9226aaff1f In the interest of debug should show everything, add debug when registering an unknown flag. 2020-05-05 12:57:14 +01:00
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
4ad9f12d5d Move plot version to debugpaste top 2020-05-04 23:58:01 +02:00
228c37815a Fix merge all
Fixes #2804
2020-05-04 17:15:53 +01:00
a37ab10414 Don't send chat spy to message sender 2020-05-03 18:13:54 +02:00
d73dbf0c81 5.10.5 2020-05-02 13:34:04 +01:00
daee26681a use strings for spawn reasons to be safe 2020-05-02 12:13:00 +01:00
729469e030 Add config options for all paper events. 2020-05-02 11:58:32 +01:00
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
85a75ad868 Yeet that PaperSPiGoT out of here 2020-05-02 11:58:32 +01:00
8ec8b8d803 Add some paper-specific listeners 2020-05-02 11:58:32 +01:00
d864792d09 Fixes #2800 Allow to wrap OfflinePlayers in 1.15.2 2020-05-02 11:28:06 +01:00
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
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
e06429f3b0 Correct world types given to player 2020-05-01 19:18:11 +01:00
fd4a9a16de Execute commands when clicked for expire messages 2020-05-01 13:34:43 -04:00
acba10ac09 Fix broken url 2020-05-01 17:00:55 +02:00
d6d49e0912 Show suffix in versionString() too 2020-05-01 15:56:35 +01:00
b5de5f30ac Allow suffixes to the version
- Useful for "PlotSquared-5.10.4-SNAPSHOT" etc
2020-05-01 15:53:40 +01:00
17698065a0 Add extra SpawnReasons to spawn listener 2020-04-30 17:00:35 +01:00
135c6f2c15 Send a less obnoxious message if the flag name length exceeds the maximum allowed length 2020-04-30 13:36:03 +02:00
a263fe2f2d Apparently we need to recover from bad flags 2020-04-30 12:15:42 +01:00
cbe46539ca Pick up the rest of the reformating 2020-04-30 11:53:07 +01:00
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
b56d4d0fea Merge branch 'reformat' into v5 2020-04-30 11:39:02 +01:00
42106bb97a I didn't get everything first time 2020-04-30 11:33:59 +01:00
e7216d4aef Merge branch 'v5' into reformat 2020-04-30 11:33:31 +01:00
0751e9cea3 Make LiquidFlowFlag an enum 2020-04-30 11:18:28 +01:00
0091580ae0 Reformat it all. 2020-04-30 11:01:52 +01:00
4a16f9c1a7 LiquidFlow true will override BlockPhysics false 2020-04-30 10:59:43 +01:00
894d673c90 Fix tests 2020-04-30 11:32:50 +02:00
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
53ca62e8fc Bump version 2020-04-29 22:06:23 +02:00
670f6d9f8b Fix coral-dry flag not respecting horn coral blocks 2020-04-29 21:55:55 +02:00
8a21334e66 Merge branch 'v5' of https://github.com/IntellectualSites/PlotSquared into v5 2020-04-28 11:21:51 +01:00
a130d801d5 schem.intellectualsites.com (just forwards to athion.net but cnamed) 2020-04-28 11:21:30 +01:00
51b6f41eff Update papi hook message 2020-04-25 23:54:30 +02:00
a829799b36 Update scripting message 2020-04-25 23:53:46 +02:00
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
5bd53436df Prevent NPE for report comments 2020-04-23 13:44:34 +01:00
caa4a08b26 getOfflinePlayer once 2020-04-23 09:21:52 +01:00
0fa99d7940 Never return null in Placeholder. Also slight cleanup. 2020-04-23 09:06:37 +01:00
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
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
591eb60a71 5.10.2
*bump version after resource update
2020-04-22 08:24:55 +01:00
9081a5aff6 Fix incorrectly formatted biomes in worlds.yml automagically 2020-04-22 08:22:14 +01:00
8ff4566905 Change misleading information 2020-04-21 23:42:31 +02:00
c8d8fb6aff Reformat premium information 2020-04-21 23:38:56 +02:00
6da4994955 Enhance premium verification 2020-04-21 23:06:11 +02:00
4780fcd534 Fixes #2782
Thanks for the contribution :)
2020-04-21 15:53:38 +02:00
5b30711470 Cant use bar chart 2020-04-21 12:39:48 +01:00
336f27f078 Only check update if premium. Add bstats bars for premium vs not. 2020-04-21 12:39:48 +01:00
92ef0d723b 5.10.1 2020-04-21 11:59:10 +01:00
ffee7a518e update default biome to match format WorldEdit accepts. 2020-04-21 09:16:02 +01:00
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
67736bfbca git object is actually needed in Core build 2020-04-21 08:28:22 +01:00
84108b60c2 force version 2020-04-21 08:16:06 +01:00
59f8f2fdff Fix biome setting in 1.13 and 1.14 2020-04-20 23:40:04 +02:00
5c6175badb Merge remote-tracking branch 'origin/v5' into v5 2020-04-20 23:37:02 +02:00
8db8a30455 Fix biome setting 2020-04-20 23:36:56 +02:00
cbe8fda1df Fix update notification 2020-04-20 23:24:28 +02:00
558df450b5 Update spigot updater 2020-04-20 21:04:30 +02:00
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
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
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
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
06d255ccc2 Create FUNDING.yml 2020-04-20 18:48:22 +02:00
bb291b947f Use primite int type for setBiome 1.13 workaround 2020-04-20 17:27:46 +02:00
3c8b22688a I'm dumb. 2020-04-19 21:24:45 +02:00
cdd1fad85c Fix github link in debugpaste 2020-04-19 21:22:45 +02:00
ab6fd06657 Link to bStats 2020-04-18 23:22:05 +02:00
3bb32a5630 Add bStats stats to README 2020-04-18 23:21:01 +02:00
bf5862942a Disable prefixes for flag info headers and footers and suppress NPE in the update utility 2020-04-18 22:26:13 +02:00
cbea595fa0 Don't relocate json-simple. 2020-04-18 21:14:44 +02:00
952ea0b090 Fix setowner none (unclaim) 2020-04-18 17:59:45 +01:00
af951ac11c Update upload to debug the content if incorrect properly. 2020-04-18 17:53:45 +01:00
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
95335df84d Merge branch 'v5' of https://github.com/IntellectualSites/PlotSquared into v5 2020-04-18 17:22:58 +01:00
100861484a Fix plot claim. 2020-04-18 17:22:51 +01:00
70eb588f1f Update issue template for v5/v3 support 2020-04-18 17:04:16 +02:00
c206de263b Merge remote-tracking branch 'origin/v5' into v5 2020-04-18 02:28:29 +02:00
0c12972c03 Register misc-flags. 2020-04-18 02:28:11 +02:00
546c4defb7 Add SirYwell to authors list
Thanks for all your hard work regarding v5 ❤️
2020-04-16 23:49:08 +02:00
814fca3832 Update flag description 2020-04-16 19:15:40 +02:00
3ee29297e0 Add option to force plot chat in plot areas. 2020-04-16 16:55:14 +01:00
6d9d0fff10 Add description caption for chat flag 2020-04-16 12:49:00 +01:00
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
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
4aac3bf7e4 Merge pull request #2757 from IntellectualSites/api/v5/packages
Package Restructure
2020-04-16 10:58:13 +02:00
ee2ed8222d Merge config packages 2020-04-16 06:14:33 +02:00
edaf396894 Merge features/v5/internal-updates into api/v5/packages 2020-04-16 06:11:03 +02:00
6f052f0001 Remove extra line from HEADER 2020-04-16 05:05:58 +02:00
ba40a56c32 Add GPLv3 License headers to all source files. 2020-04-16 04:52:39 +02:00
780be3776a Addressed some comments 2020-04-15 15:26:54 -04:00
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
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
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
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
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
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
5772af37fe Reclassify shulker as a hostile mob 2020-04-12 04:46:51 +02:00
6324bb1134 Use entity categories in events 2020-04-12 01:47:56 +02:00
658f2a3fc3 Finalize entity type categorisation 2020-04-12 01:23:13 +02:00
6e536f81ac Add more entity categories 2020-04-12 00:57:50 +02:00
dd9450d36a Add entity category loading code to WorldUtil (implemented in BukkitUtil) 2020-04-11 22:26:31 +02:00
8ef3a90ce0 Merge remote-tracking branch 'origin/features/v5/internal-updates' into features/v5/internal-updates 2020-04-11 21:49:15 +02:00
e6c76ad3f3 Entity categories implementation 2020-04-11 21:49:08 +02:00
4a249843eb Workaround to accept Slimes and EnderDragons as Monsters 2020-04-11 21:42:52 +02:00
5c1f0f51df Add a custom bStats chart tracking terrain types 2020-04-11 20:56:34 +02:00
2377ce1123 Relocate metrics properly 2020-04-11 19:52:45 +02:00
6f2b31f4a3 Add missing default flag values to GlobalFlagContainer (fixes #2748) 2020-04-11 18:49:04 +02:00
c5590440d6 Merge remote-tracking branch 'origin/features/v5/internal-updates' into features/v5/internal-updates 2020-04-11 17:58:27 +02:00
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
546b857b9d Fail default flag parsing gracefully 2020-04-11 17:19:43 +02:00
ce10d54a9c Don't use legacy IDs to get block types in the hybrid plot manager 2020-04-11 13:28:58 +02:00
965bbb9f3b Extract block queues from AugmentedUtils 2020-04-11 13:23:57 +02:00
e88b331155 Clean up AugmentedUtils and make the code readable by humans 2020-04-11 12:08:46 +02:00
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
5a6dbfda36 Fix javadoc generation issues 2020-04-11 03:23:48 +02:00
6c1caac731 Rename jar from BukkitAPI to Bukkit 2020-04-11 02:57:00 +02:00
9c3c42c3e6 Rename published maven artifacts
# Conflicts:
#	Bukkit/build.gradle
#	Core/build.gradle
2020-04-11 02:54:34 +02:00
5fc33dcc06 Rename published maven artifacts 2020-04-11 02:39:02 +02:00
c196ced0e2 Move org.json into core 2020-04-11 02:28:15 +02:00
dfa977a020 Moved more packaged based on feedback 2020-04-10 20:19:18 -04:00
5be2dfa747 Package Changes 2020-04-10 19:26:07 -04:00
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
79583c011f Replace getOwnerAbs() == null with !hasOwner() 2020-04-10 19:28:10 +02:00
172bcc7677 Revert "Replace getOwnerAbs() == null with hasOwner()"
This reverts commit 79620042
2020-04-10 19:22:12 +02:00
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
c2060ea1a7 Remove deprecation of getOwner() 2020-04-10 19:11:53 +02:00
7962004215 Replace getOwnerAbs() == null with hasOwner() 2020-04-10 19:10:43 +02:00
45476f2867 I missed AbstractDB somehow... 2020-04-10 18:15:35 +02:00
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
474795367e Reformat Plot after the owner changes. It was a bit too messy. 2020-04-10 14:07:52 +02:00
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
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
0d26111fa7 Include golems (snowmen, iron golems and shulkers) in the animal-interact flag. 2020-04-09 21:38:24 +02:00
dada7dbb86 Use relocated org.json instead of including the source files 2020-04-09 17:41:55 +02:00
cb05d34d20 Fixes #2751 2020-04-09 17:07:14 +02:00
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
86149224d1 Don't set walls, wall filling or outline in plots using full vanilla terrain generation 2020-04-09 13:06:45 +02:00
f717589074 Fix typo in MainUtil and switch out Consumer<Integer> to IntConsumer 2020-04-09 11:23:39 +02:00
254a0541cc Fix OfflinePlayerUtil runtime exception 2020-04-08 22:52:13 +02:00
271109a726 Fix dumdum async getLoadedChunks call, but only because Aikar broke everything. 2020-04-08 21:49:41 +02:00
38de74c4ff Make sure PlayerEvents#logout is called 2020-04-08 17:53:11 +02:00
865d11e844 Register vehicle-place and make it disabled by default 2020-04-08 17:28:16 +02:00
ebba9a2290 Fix interval flags 2020-04-08 17:22:53 +02:00
bc45b8b695 Merge branch 'features/v5/internal-updates' into features/v5/async-load 2020-04-08 17:17:17 +02:00
7ac389b698 Fix block ignition location check 2020-04-08 17:15:17 +02:00
616d22ceac Fix liquid-flow 2020-04-08 17:01:41 +02:00
f6332d2cd9 Add tab completions to flyflag 2020-04-08 16:53:39 +02:00
4ca7a81e96 Fix untrusted-visit. 2020-04-08 16:52:10 +02:00
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
ef04ed9151 Fix augmented generation 2020-04-08 04:10:22 +02:00
1522632f5a Don't replace blocks if they have identical states already 2020-04-08 02:02:20 +02:00
be6bcafccc Make sure augmented generation doesn't crash the server 2020-04-08 01:23:22 +02:00
5d332e7d58 Fix plot clearing in normal plot worlds 2020-04-08 00:01:58 +02:00
283ff945f3 Fix /plot auto performance and remove sign-guessing 2020-04-07 23:39:56 +02:00
0d4af3023d Extract TaskManager lambdas for better debugging 2020-04-07 23:18:36 +02:00
7fdb7961ce Merge branch 'features/v5/internal-updates' into features/v5/async-load 2020-04-07 22:13:42 +02:00
e161209a46 Fix plot claiming 2020-04-07 22:12:52 +02:00
5e2e4a8631 Revert testCreate change 2020-04-07 21:43:32 +02:00
e4a6bd0ca5 Don't try to remove players. Fixes #2742. 2020-04-07 20:56:43 +02:00
5547185b3f Prevent synchronous chunk loading whenever possible 2020-04-07 20:19:39 +02:00
7841ee3dcc Fix a few encapsulate merge issues 2020-04-02 13:40:11 +01:00
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
9764d4d226 Actually add biomes to road schematics 2020-03-28 10:43:24 +00:00
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
a285404847 Update gradle, actions and fix typo in branch 2020-03-27 23:44:17 +01:00
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
3a3a06631d Add coral-dry flag 2020-03-25 21:14:58 +01:00
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
f2f7fbce09 Allow trusted users to use /plot set 2020-03-25 11:01:19 +00:00
412a3ee344 Support v2 schematics properly. No 3D biomes are supported by it as yet. (#2716) 2020-03-24 09:08:56 +01:00
2f4eea118a add clear option to /ps purge (#2714) 2020-03-24 09:08:32 +01:00
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
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
58280a20a8 Log don't debug on regenallroad completion 2020-03-20 12:11:39 +00:00
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
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
4bcd926543 Update discord links 2020-03-09 23:50:22 +01:00
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
30b83faab6 Fix plot downloading 2020-02-28 00:31:53 +01:00
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
b99631f1bd Fix regen. Fixes #2692 2020-02-24 14:00:45 +01:00
6be26e8047 Also consider negative locations when cancelling liquid flow 2020-02-24 12:11:22 +01:00
c7de9379ad Prevent liquids from flowing out of block walls. Fixes #2598. 2020-02-24 11:47:52 +01:00
86ea69b65e Update README.md 2020-02-21 00:53:52 +01:00
f2aa9dccd1 Revert "Remove unused code"
This reverts commit 6d779dad05.
2020-02-20 20:08:25 +01:00
464f5e09ae Allow all messages to be formatted by external formatters and add PAPI support 2020-02-20 16:03:17 +01:00
17e4bde720 Update gradle version 2020-02-20 00:41:19 +01:00
6d779dad05 Remove unused code
Or at least I made it unused lul
2020-02-20 00:39:32 +01:00
38d0cc1b29 Fix isPremium method 2020-02-20 00:05:55 +01:00
fc9a221127 Update BukkitMain.java
wiz is quick
2020-02-20 00:02:06 +01:00
95394ec54f Add Premium verification 2020-02-19 23:55:43 +01:00
a3759f93a2 Add placeholders 2020-02-16 20:33:24 +01:00
2632283431 Move recent changes into 1 branch 2020-02-16 15:17:06 +01:00
8a014e3ad5 Remove wiki generator and unnencessary comments from the settings 2020-02-16 15:08:02 +01:00
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
b3c91d866b Lazy cherry-pick 5db1e73eae4b0d4628df8bbbc172670c42d96435 without merge conflics 2020-02-16 14:41:51 +01:00
10dd531cdb Remove paper suggestion 2020-02-16 14:38:33 +01:00
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
7b83f0146e Readd update notification permission implementation 2020-02-16 02:34:51 +01:00
4ed108b5c0 Remove legacy auto updater (v3) 2020-02-16 01:36:24 +01:00
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
5ea03f12fb Update issue template 2020-02-14 17:54:45 +01:00
99a53cb005 DoogiePC doesn't like trees 2020-02-12 18:57:42 -05:00
d7af409d01 Test another workaround 2020-02-12 18:21:23 -05:00
0304e98b00 Workaround for SPIGOT-5574 2020-02-12 15:42:31 -05:00
b16db904cc Removed unused class which should be unbreaking. 2020-02-11 17:09:36 -05:00
4b306d454b Fixed an error with the debug command and added @NotNull to generator methods 2020-02-11 17:06:58 -05:00
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
f79f2ac29e Tweaks to the world generator 2020-02-11 16:16:56 -05:00
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
54348d824c Update authors 2020-02-10 17:36:54 +01:00
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
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
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
2f0bf97162 Fix displaying 1 player remove as players 2020-02-09 01:12:32 +01:00
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
30f37e1e8b Update /plot info placeholders 2020-01-27 23:39:29 +01:00
4e1c90bbcc Fixes space between names in plot info (Fixes #2675) 2020-01-27 23:06:42 +01:00
c31c855952 Update gradle version to 6.1 2020-01-24 18:47:32 +01:00
312b2ad1a8 Send the bStats ID 2020-01-24 18:10:19 +01:00
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
57af89f1d0 Merge pull request #2652 from SynergyMC/breaking
Revert teleportation behavior to pre-4.400
2020-01-22 21:23:25 -05:00
f71f481ff3 Compile against 1.15.2 2020-01-22 23:54:37 +01:00
0ba31ed56b Update dependencies fitting https pattern 2020-01-21 18:25:46 +01:00
edc81bc668 Updated branch names for gh actions testing 2020-01-21 15:52:57 +01:00
7797e33ec5 Update sponsors 2020-01-20 01:24:08 +01:00
118adb42b9 add hungarian translation 2020-01-14 12:27:23 +01:00
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
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
f3187a465c Oops 2020-01-10 19:38:38 +01:00
6fe856c002 Merge remote-tracking branch 'origin/dependabot/gradle/v4/junit-junit-4.13' into v4 2020-01-10 19:06:22 +01:00
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
026233b7e7 Update gradlew 2020-01-10 14:07:33 +01:00
6ee9d91aef Update requriedTypes 2020-01-10 14:01:28 +01:00
808a1ed703 Add wildcards to command args 2020-01-10 13:35:59 +01:00
7142e9e0e3 deprecate metrics settings 2020-01-07 22:45:53 +01:00
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
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
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
33f8df3afe Add teleport cooldown bypass permission to plugin.yml 2020-01-03 01:12:48 +01:00
42a83b56c3 Add clarification of tp bypass permission node to settings.yml 2020-01-03 01:10:32 +01:00
0f39df0e0b Revert teleportation behavior to pre-4.400 2019-12-31 16:05:53 -10:00
a17588199f Merge pull request #1 from IntellectualSites/v4
Merge from upstream
2019-12-31 15:24:42 -10:00
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
568e9537ec Bump WorldEdit version to 7.0.1 2019-12-27 17:33:52 +01:00
58bb0509f7 Bump gradle version to 6.0.1 2019-12-27 17:01:17 +01:00
0ad2682210 Add update and jvm flags to debugpaste 2019-12-27 16:53:38 +01:00
f97e52ea0b Fixes building against 1.15 2019-12-25 10:40:54 +01:00
4c90523121 use 1.15 spigot 2019-12-25 02:39:41 +00:00
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
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
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
ccc7b0ec65 Fix #2634 no such method error 2019-12-20 06:03:23 +00:00
4d1d3a165c Merge pull request #2635 from traksag/interact-fix
Fix interact handling for sneaking players
2019-12-18 22:23:42 -05:00
e54cf24248 Fix interact handling for sneaking players 2019-12-18 19:42:57 +01:00
7103969bba Merge pull request #2634 from traksag/hanging-fix
Fix that players cannot place hanging entities
2019-12-18 12:37:47 -05:00
3bb40a8fff Fix that players cannot place hanging entities 2019-12-17 21:04:44 +01:00
f4dcc9e786 Merge remote-tracking branch 'origin/breaking' into breaking 2019-12-15 13:08:27 -05:00
9fd29b264e Some logging operations to check for tps loss. 2019-12-15 13:08:02 -05:00
478c761750 More PlayerEvent fixes. 2019-12-15 12:53:16 -05:00
dbd6feed4e Update issue template and add link to suggestion repo on issue tab 2019-12-14 18:05:15 +01:00
480c9f11b8 Add 1.15 to templates 2019-12-14 17:46:07 +01:00
ed8fa0a2a5 Revert changes to BlockPlaceEvent 2019-12-10 17:53:55 -05:00
3af05e7960 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-12-09 14:44:16 -05:00
07b6942690 Minor code tweaks 2019-12-09 14:43:53 -05:00
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
241589fdb0 Revert "Bump retrofit from 2.4.0 to 2.6.2"
This reverts commit 1097f44feb.
2019-12-07 18:56:43 +01:00
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
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
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
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
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
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
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
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
7760631751 Remove deprecated method from Captions.java 2019-12-06 21:18:56 -05:00
05d6d557b8 Merge remote-tracking branch 'origin/breaking' into breaking 2019-12-06 21:16:19 -05:00
9925a320f5 Fix event listeners 2019-12-06 21:16:09 -05:00
dca5d84d29 Fixes #2620 2019-12-06 00:28:07 +01:00
0b470f8e01 Update links 2019-12-04 20:11:05 +01:00
7e58f4341e Minor fixes and performance improvement 2019-12-02 17:07:57 -05:00
d8933afb50 Merge remote-tracking branch 'origin/breaking' into breaking 2019-11-28 21:50:31 -05:00
4bb45fc220 Replace ByteArrayUtilities code with Guava and Replace PlotGameMode with WorldEdit equivalent. 2019-11-28 21:50:21 -05:00
09f913cba4 Enhanced Fixes #2595
Updating messages and adding new strings that fit better.
2019-11-28 19:02:58 +01:00
006d730185 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-11-26 18:00:44 -05:00
cf558d8f62 Update DebugPaste.java 2019-11-25 22:40:50 +00:00
a65d546f3b Fix debugpaste split 2019-11-25 22:38:03 +00:00
bf02c9fe5f Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-11-25 22:37:39 +00:00
6908b9f29b Update bug-issue-report-for-plotsquared.md 2019-11-24 19:30:37 +01:00
cd06dbc915 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-11-22 16:12:01 +00:00
977dfa807f potentially fix partial world auto 2019-11-22 16:11:48 +00:00
8b7e8ec635 Update bug-issue-report-for-plotsquared.md 2019-11-22 15:52:25 +01:00
c14e1d7add Update Settings.java 2019-11-22 12:40:27 +01:00
7377366372 Updating some debug colors 2019-11-22 12:28:34 +01:00
9c9841663a Fixes #2595 (leave error) 2019-11-19 01:39:51 +00:00
612e96201c Fixed ItemTypeListFlag issue 2019-11-18 13:43:16 -05:00
d7aa4a0e1f Revert "Fix some flag issues"
This reverts commit 8b741477
2019-11-18 13:41:46 -05:00
8b7414770f Fix some flag issues 2019-11-18 11:09:32 -05:00
a26ede4dae Typo 2019-11-14 12:54:02 -08:00
7591770c40 Update README.md 2019-11-14 12:48:41 -08:00
7623698a00 don't use legacy ids here 2019-11-12 22:31:02 +00:00
f518c47e09 Fixes #1922 Banned people can still "talk" in plot 2019-11-12 20:52:14 +00:00
c23086259d Potentially fixes rename issues
#2450
2019-11-12 20:48:33 +00:00
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
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
322e186c4b Ignore invalid blocks 2019-11-12 07:32:05 +00:00
59b8776814 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-11-11 20:39:44 +00:00
5bb7069c7f Fixes #2571 2019-11-11 20:39:28 +00:00
1a2c15684e Fixed typo 2019-11-11 21:39:27 +01:00
b02565532f Update template checkbox 2019-11-11 21:38:44 +01:00
7d7414ebb9 Fix for single chance parsing 2019-11-11 19:47:26 +00:00
55d6217c32 Check if WORLDEDIT_RESTRICTIONS is enabled
Unregister if disabled.
2019-11-11 19:44:51 +00:00
10e5760ba8 Merge pull request #2564 from IntellectualSites/we
Use patterns instead of BlockBucket
2019-11-10 14:08:47 -08:00
f797141a29 Update Plot.java 2019-11-10 22:08:03 +00:00
968c23113c Fixes #2412 2019-11-10 21:51:29 +00:00
bf4d953f3c No need to convert to a BlockState here 2019-11-10 18:49:31 +00:00
d34f5cc97e Config reading/writing 2019-11-10 18:32:32 +00:00
d254633b77 Use patterns instead of BlockBucket
Still use BlockBucket for loading/saving from config
2019-11-10 17:47:37 +00:00
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
1d9ad94822 Fix plot getRegions off by 1 2019-11-10 14:01:12 +00:00
fe438fd62a swallow stacktrace 2019-11-10 13:29:58 +00:00
93894aca96 Force lowercase 2019-11-10 13:27:37 +00:00
f1b8510708 forgot to find 2019-11-10 13:24:04 +00:00
7dcecf486d Use regex for block bucket, yay 2019-11-10 13:18:15 +00:00
8c1985f9c0 Split by regex 2019-11-10 13:08:34 +00:00
34eb7d05dc Print actual value for setup? 2019-11-10 12:45:51 +00:00
729452038b Check if integer 2019-11-10 12:43:47 +00:00
3e30e9554f Add missing RunnableVal import. 2019-11-10 13:26:59 +01:00
009bcaf6d4 Merge remote-tracking branch 'origin/we' into we 2019-11-10 13:26:27 +01:00
baca8808ee Add missing Location import. 2019-11-10 13:26:15 +01:00
1a923063b5 Merge branch 'breaking' into we 2019-11-10 13:18:16 +01:00
c512189478 fix import 2019-11-10 11:31:47 +00:00
c155c65a8f Remove modifier reflection
Fixes #2484
2019-11-10 11:23:25 +00:00
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
37280779b0 Make /plot setowner require an argument. Fixes #2501. 2019-11-10 12:06:33 +01:00
ed588476e0 Fix single plot areas 2019-11-08 22:31:01 +00:00
19fe39ce2e Merge branch 'we' of https://github.com/IntellectualSites/PlotSquared into we 2019-11-08 05:18:07 +00:00
07fcd53bf8 Fixes IntellectualSites/PlotSquaredSuggestions#58 2019-11-08 05:17:51 +00:00
834d786037 Fix okio 2019-11-07 17:02:34 +01:00
72c6f1165a Fix okio 2019-11-07 17:02:08 +01:00
1570c4d08a Add missing import 2019-11-06 14:20:32 -05:00
252fdefef3 bad regex replace 2019-11-06 11:39:55 +00:00
fed5169724 Get sign lines sync 2019-11-05 15:23:48 +00:00
2cb734bba2 editsession util 2019-11-04 21:55:40 +00:00
46926a4d99 Merge remote-tracking branch 'origin/breaking' into breaking 2019-11-04 16:20:03 -05:00
88732bb88c Use CuboidRegion instead of RegionWrapper 2019-11-04 21:08:33 +00:00
ba3ff08d6c Update BlockStateListFlag.java 2019-11-04 20:17:29 +00:00
8f7f6a4f40 Merge branch 'breaking' into we 2019-11-04 20:17:15 +00:00
e8bf3f0d2c Merge pull request #2558 from IntellectualSites/more-translation-strings
Add translation messages for flag errors
2019-11-04 21:12:39 +01:00
7e6dc48d69 imports 2019-11-04 19:58:24 +00:00
37f608258f Remove PlotBlock 2019-11-04 19:55:55 +00:00
a25511c849 Add custom translations for special flags 2019-11-04 19:22:54 +01:00
930dee9326 Refactor BlockVector2 2019-11-04 17:44:23 +00:00
315f26fb82 Add missing color 2019-11-04 00:46:08 +01:00
e972cb4c1a Make flag error messages translatable 2019-11-04 00:33:04 +01:00
7309e61221 AeSix' template improvements 2019-11-02 12:48:41 +01:00
17e784c283 Revert dependency upgrades 2019-11-01 21:45:06 -04:00
627ecd2b71 Merge pull request #2542 from mindw0rm/UntrustedVisit
New plot flag untrusted-visit
2019-10-31 17:02:48 -04:00
1c5bd55c96 Merge pull request #2553 from IntellectualSites/bukkit-api
Providing bukkit module on maven
2019-10-31 17:02:00 -04:00
6ec3951e4e Add Bukkit module to maven 2019-10-30 15:05:52 +01:00
d1115d62a7 Merge pull request #2548 from IntellectualSites/flag_fix
Flag fixes and others 🐮
2019-10-27 16:13:22 +01:00
e29727827d Fix missing word 2019-10-27 16:02:34 +01:00
1f89948948 Remove unused flags 2019-10-27 16:01:57 +01:00
1067e5f2c2 Remove redundant empty line 2019-10-27 15:19:49 +01:00
25ca011bfe Fixes #2550 2019-10-27 15:10:15 +01:00
3be0be1b60 Make sure DENY_EXIT checks for the admin override permission. Fixes #2411. 2019-10-27 12:11:48 +01:00
2e15934666 Fix /plot flag set allowing for invalid flag values. (Fixes #2519) 2019-10-27 12:01:04 +01:00
cb52ee8cfb Make the flag list output message configurable. 2019-10-27 11:55:15 +01:00
01eee306f1 Fixes #2462 by making flag categories translatable. This reflects (somewhat) recent changes to command categories. 2019-10-27 11:45:18 +01:00
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
cb1767347b Merge branch 'breaking' into UntrustedVisit 2019-10-23 20:51:59 +02:00
32654e1f25 Merge pull request #2506 from mindw0rm/DenyTeleportBugfix
Bugfixes for deny-teleport
2019-10-23 14:37:20 -04:00
91108a5df9 Merge branch 'breaking' into UntrustedVisit 2019-10-22 17:21:24 +02:00
e5e522bc31 Merge branch 'breaking' into DenyTeleportBugfix 2019-10-22 17:20:43 +02:00
5741d5f6a0 Merge pull request #2533 from mindw0rm/PlaceFlagBugfix
Place flag bugfix (fixxes issue #2524)
2019-10-21 21:27:48 -04:00
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
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
469a4f25e5 Merge branch 'breaking' into dependabot/gradle/com.squareup.retrofit2-retrofit-2.6.2 2019-10-19 17:44:27 -04:00
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
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
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
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
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
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
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
20957a75d5 use a new Location convert function to ensure that there will be no side effects 2019-10-18 08:02:44 +02:00
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
24d82e562a merge upstream changes 2019-10-18 07:44:04 +02:00
9ad2537ca2 Merge pull request #2517 from IntellectualSites/debugpaste-update
Improve world generator diagnosis
2019-10-17 12:23:47 +02:00
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
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
039b7aee9e Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into UntrustedVisit 2019-10-10 20:34:41 +02:00
0bcaaf3c0b copy yaw and pitch when converting between Bukkit Location and PlotSquared Location 2019-10-10 20:33:25 +02:00
5315e1e337 let untrusted-visit override deny-teleport 2019-10-10 20:32:48 +02:00
1f4f78a179 this can be done more elegantly 2019-10-10 01:53:27 +02:00
599ef8aa44 Bugfix for #2524 (place flag) 2019-10-10 01:36:40 +02:00
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
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
a3905c68cf Fix links 2019-10-07 19:20:48 +02:00
3d1cd46053 Update Sponsors 2019-10-07 19:09:41 +02:00
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
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
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
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
ae0f1d2a15 Adding "website" to plugin.yml 2019-10-03 01:26:31 +02:00
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
c8c5d777a1 Make paths... idk what to say here 2019-10-03 00:40:41 +02:00
b92d42e7cc Add clarification to what files are pasted 2019-10-01 14:46:19 +02:00
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
ca25b7b3c8 Fix odd space 2019-10-01 13:02:32 +02:00
b074e6e198 Update auto-comment.yml
I created templates and setup Actions to ensure functionality.
2019-10-01 12:54:20 +02:00
267bebd0e8 Improve world generator diagnosis 2019-10-01 12:12:42 +02:00
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
becac84e6e Setup Actions test 2019-09-18 02:06:28 +02:00
ae1273a7f3 Bugfixes for deny-teleport 2019-09-14 12:58:22 +02:00
05ef076ef0 Remove unnecessary spaces 2019-09-12 04:01:47 +02:00
d20d95d29b Remove schematic test command 2019-09-12 03:53:29 +02:00
6e387f3321 Do not remove the schematic file extension 2019-09-12 03:44:31 +02:00
68a5166d2f Fixes the major lag source from GlobalBlockQueue 2019-09-11 19:04:29 -04:00
2bf47478b2 Merge remote-tracking branch 'origin/breaking' into breaking 2019-09-09 15:15:53 -04:00
07b88e3147 Minor changes to the block queue classes to match FAWE more closely. 2019-09-09 15:15:44 -04:00
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
5b3426f4ac Make removing * remove the Everyone node before removing all members 2019-09-09 18:44:36 +02:00
ecfb71b08f Changes made to GlobalBlockQueue to help diagnose lag. 2019-09-08 19:36:02 -04:00
fd6fbebd69 Fixed #2496 2019-09-08 18:43:47 -04:00
758c343e52 Update bug-issue-report-for-plotsquared.md 2019-09-08 20:25:12 +02:00
04f789d404 Fix merging 2019-09-08 20:02:45 +02:00
fe730574c9 Fixes #2490 2019-09-08 01:06:27 +02:00
20b0fa31d0 Update gradle and deprecated methods 2019-09-07 22:46:13 +02:00
ec0281768d Update README.md 2019-09-07 12:50:12 +02:00
3bec76e27a Create CONTRIBUTING.md 2019-09-07 12:46:40 +02:00
462c113ce8 Fixed accidental code reversion 2019-09-06 21:20:54 -04:00
12538c7c27 Merge pull request #2461 from IntellectualSites/midnight-ideas
@N0tMyFaultOG has some random ideas sometimes
2019-09-06 21:16:30 -04:00
e01b470493 Resolve merge conflicts 2019-09-07 03:06:05 +02:00
f7b78595a9 Merge remote-tracking branch 'origin/breaking' into breaking 2019-09-06 20:40:38 -04:00
b3136b4ebe Version number fixes, fixed documentation, new caption added, and tweaks to API functionality. 2019-09-06 20:40:28 -04:00
4d0bd8a3a3 Upgrade build files 2019-09-04 03:04:51 +02:00
e1db27010c Updating command usage formats 2019-09-04 03:01:25 +02:00
40e3b7fa06 Revert "Add new switch conditions to entity listeners"
This reverts commit a0d666ae14.
It seems to break armor stand placing in some cases.
2019-09-03 23:56:08 +02:00
a7012814ab Deprecated a poorly named method 2019-09-01 19:40:16 -04:00
213fd80894 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-09-01 16:55:49 -04:00
5e8909883d Modified internal configuration classes, Updated Mojang UUID fetcher, other various method and documentation tweaks 2019-09-01 16:54:43 -04:00
08cd39749b Create PULL_REQUEST_TEMPLATE.md 2019-08-27 14:44:56 +02:00
a0d666ae14 Add new switch conditions to entity listeners 2019-08-23 23:58:52 -04:00
fa8b18f3d5 Add new switch conditions to entity spawning 2019-08-23 15:57:57 -04:00
267dea4693 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-08-23 17:18:43 +01:00
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
589a69ac6d Update ISSUE_TEMPLATE.md 2019-08-20 15:36:13 -04:00
dc0126b53c Revert PaperLib from later commits too 2019-08-19 20:47:36 +01:00
0ca69d4f03 Don't use PaperLib I guess 2019-08-19 20:39:03 +01:00
ec84b91f84 added a stupid check because of a spigot issue. 2019-08-19 14:51:14 -04:00
a63f8650e5 Create CONTRIBUTING.md 2019-08-18 13:25:11 -04:00
59a1d619d3 Add sponsors 2019-08-18 14:29:37 +02:00
76dc60194d Added an invalid world name check. 2019-08-17 19:17:01 -04:00
cc9c1f63d8 When an exception is actually being used it shouldn't be named ignored 2019-08-17 18:45:07 -04:00
e5da93f359 Added a null check for the very unlikely chance that the command isn't found. 2019-08-17 18:42:31 -04:00
008237b2a4 Fixed #2469 2019-08-17 18:40:39 -04:00
920796d8ec Fixed #2468 2019-08-17 16:28:53 -04:00
c6a4206266 Fix Typo 2019-08-17 17:06:17 +02:00
1cf85ff2c6 Removed unused translation strings
And added a new alias
2019-08-17 02:19:29 +02:00
be20b2404b OCD
- Typo Fixes
- Small amendments (Spelling)
- Reformatting
2019-08-17 01:48:43 +02:00
011baba140 Update PlotSquared.java 2019-08-16 02:05:51 +02:00
b22919a278 Variable renames and fixes 2019-08-16 01:47:22 +02:00
49b7c71fbb Adding some more translation strings 2019-08-16 01:22:24 +02:00
31c81fc9fe Update command aliases format 2019-08-15 17:35:40 +02:00
8653b9b0a2 Update unfitting messages 2019-08-15 16:37:57 +02:00
b3e53e34b6 Simplify help string 2019-08-15 16:20:30 +02:00
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
3473f5dc85 Fixed compatibility with FAWE and compile issue. 2019-08-14 20:47:01 -04:00
b4c33aaa18 Midnight work
Also fixes #2463
2019-08-14 14:36:20 -04:00
a910b542a0 Replace annotations with JetBrains annotations 2019-08-13 23:43:11 -04:00
705d0294b5 Merge remote-tracking branch 'origin/breaking' into breaking 2019-08-13 23:37:22 -04:00
403916748c Variable renaming 2019-08-13 23:37:15 -04:00
fd9e716ec4 Variable renaming 2019-08-13 22:42:01 -04:00
3e6b0b8394 Work on directions and merging 2019-08-13 22:01:23 -04:00
56e055c671 Second attempt at a sign fix. 2019-08-13 18:39:38 -04:00
1341100f03 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-08-13 18:28:54 -04:00
d7c72d5f75 Variable renames 2019-08-13 18:26:55 -04:00
265f0c6615 Potential fix for #1930 2019-08-13 18:06:10 -04:00
9642777750 If NMF can have midnight work, so can I 2019-08-13 17:33:32 -04:00
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
0ac4b7728f Merge pull request #2460 from jewome62/feature/toggle-time
Add toggle for time
2019-08-13 18:44:32 +02:00
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
b1391bd6d7 Fix template export 2019-08-13 03:13:03 +02:00
f1c190028e Fixes #2013
Tested with LuckPerms, result successful.
2019-08-12 23:59:14 +02:00
ad7bcd19d4 Added a debug command to diagnose the issues in #2411 2019-08-12 13:40:22 -04:00
ca954ccc97 Add toggle for time 2019-08-11 21:15:02 +02:00
8ab10de4ad Fix plot title toggling (fixes #2456) 2019-08-10 17:54:44 +02:00
df9d5ae2ac Merge remote-tracking branch 'origin/breaking' into breaking 2019-08-07 19:16:55 -04:00
5ddbf3def4 Update gradle 2019-08-07 19:16:44 -04:00
289f01f7a2 Import changes and variable renames 2019-08-06 21:46:38 -04:00
f3aa9c43ef Fixed a potential NPE 2019-08-06 21:44:39 -04:00
165cf26818 Fix typo 2019-08-07 03:43:49 +02:00
e6a7f4e5a7 Add null checks to validation task
Fixes #2407
2019-08-06 20:45:01 -04:00
8f685b754a Modifications to formatting and UUID Handler
Fixes #2423
2019-08-06 20:35:36 -04:00
539ad9f05c Small changes 2019-08-06 16:08:56 -04:00
5b8f6e466a Minor gradle edit 2019-08-06 15:05:04 -04:00
520be48198 Create fixborders.js 2019-08-05 14:47:19 -04:00
e4a345880e Update addsigns.js 2019-08-05 14:46:54 -04:00
392ef51a6f Revert broken async chunk change 2019-08-05 14:37:56 -04:00
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
fe83ef0975 Get chunks asynchronously 2019-08-05 14:03:09 -04:00
9e8a6c702d Fix gradle script 2019-08-05 14:03:08 -04:00
3e8b8a7575 Remove old files 2019-08-05 14:03:08 -04:00
d3e37e5eab Migrate Templates to new format 2019-08-05 14:03:08 -04:00
0c8b11cedd Update DebugUUID.java 2019-08-05 14:03:07 -04:00
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
cdc01a5bc4 Reformat debugpaste
And upgrade from IC -> IS
2019-08-05 14:03:07 -04:00
1295f7c4bf Merge with breaking 2019-08-05 14:03:06 -04:00
20dd98d3b9 Use PaperLib and make command task return completable futures 2019-08-05 14:02:30 -04:00
bd51292f4c Get chunks asynchronously 2019-08-05 13:33:27 -04:00
cc45208605 Merge remote-tracking branch 'origin/breaking' into paperstuff 2019-08-05 13:32:19 -04:00
7542dbeab8 Fix gradle script 2019-08-04 18:40:39 +02:00
01dfdbe2ef Merge with breaking 2019-08-03 23:26:16 -04:00
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
59517647b5 Remove old files 2019-08-03 23:20:21 +02:00
1eba425087 Migrate Templates to new format 2019-08-03 23:18:50 +02:00
16fcb2f505 Update DebugUUID.java 2019-07-30 23:58:48 +02:00
6d0849eb66 Merge pull request #2431 from IntellectualSites/kelp-grow
Add kelp-grow flag
2019-07-27 21:55:39 +02:00
dbf5084fa1 Reformat debugpaste
And upgrade from IC -> IS
2019-07-25 20:02:39 +02:00
d6779d977a Fixes #2423 2019-07-21 20:43:36 -04:00
e8df39d3c4 Fixes #2435 2019-07-21 20:40:04 -04:00
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
23b88a375d player interact ignore cancel 2019-07-12 02:18:08 +10:00
095dccd30f Revert changes to intersection generation 2019-06-28 13:59:57 +01:00
246845607f Let's first test against Material.matchMaterial for material matching (:
Also update some dependencies
2019-06-27 15:18:54 +01:00
3074e45d2c Fixed #2325
The permission node does not exist on PlotMe anymore
2019-06-25 11:43:28 +02:00
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
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
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
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
a94c588a17 Check if location has PlotArea to avoid NPE 2019-06-03 16:26:20 -04:00
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
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
6b3960fc3f Pass the PlotArea into the PlotManager 2019-06-03 16:26:20 -04:00
908a5784a1 Cache conversions to BaseBlock and fix leaky abstraction 2019-06-03 16:24:59 -04:00
bbff898073 Extract air block into variable to reduce unnecessary function calls 2019-06-03 16:24:59 -04:00
19f8704cb4 Remove leftovers from getting rid of PlotBlocks in LocalChunk 2019-06-03 16:24:59 -04:00
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
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
427523644c Removed unused imports 2019-05-31 12:04:38 -04:00
475e9b50e1 Fixes #2380 2019-05-31 12:00:44 -04:00
812d41092e Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-05-31 11:57:18 -04:00
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
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
fb478de164 Update outdated list of files to check on failed world load (#2365) 2019-05-22 12:09:31 -04:00
1bd7c8ca5f Variable renames 2019-05-21 18:50:52 -04:00
fe471c3571 new library in gradle and another change I can't remember. 2019-05-21 18:32:26 -04:00
8ff833de36 Added Paper to Platform 2019-05-17 18:50:24 -04:00
5dd2610b5e Misc. changes and removal of title manager 2019-05-17 18:49:09 -04:00
4e3a927323 Modifications to the generator code 2019-05-17 16:21:03 -04:00
595a68ecba variable renames 2019-05-17 15:32:05 -04:00
6f5cb30734 Minor message changes and variable changes 2019-05-17 14:38:57 -04:00
427504fd7c Commented out Multiverse-Core and Bump to 1.14.1 2019-05-17 14:26:47 -04:00
b66734a472 Misc. code changes
A lot of renaming
Some formatting
Narrowed scope of variables
Added annotations
2019-05-13 21:57:41 -04:00
84911c1a8c Remove unused title classes 2019-05-13 18:22:17 -04:00
adefe2eeef Titles can be used on Spigot and Paper now 2019-05-13 18:20:58 -04:00
549a4df834 Merge remote-tracking branch 'origin/breaking' into breaking 2019-05-13 15:56:41 -04:00
4daf1c7721 Fixes #2355 2019-05-13 15:56:28 -04:00
728082723c Revert "Don't force metrics. Forcing metrics is against the precedent for all major Spigot plugins"
This reverts commit 4522d98934.
2019-05-12 12:53:25 +01:00
4522d98934 Don't force metrics. Forcing metrics is against the precedent for all major Spigot plugins 2019-05-11 14:31:13 +01:00
0d67c174aa Fix compatibility with 1.13 and 1.14 2019-05-10 23:00:11 -04:00
a841b4ea86 Titles are now exclusive to paper servers 2019-05-10 22:42:07 -04:00
f232334bcc Various formatting tweaks as well as metrics changes. 2019-05-10 21:18:28 -04:00
d8ac6115c7 I never thought it would come to this 2019-05-10 17:16:48 -04:00
885d1b9d7e Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-05-05 16:56:14 +01:00
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
46beb90112 Correcter versioning 2019-05-05 11:58:45 +01:00
0a6fad73c3 Correct versioning 2019-05-05 11:56:08 +01:00
5796db51a7 Update links 2019-05-02 20:51:52 +02:00
2998f45b27 Update JavaDoc link 2019-05-02 16:14:53 +01:00
e156d58769 Generate javadoc with aggregatedJavadocs option 2019-05-02 15:54:14 +01:00
eb9d98d289 Use https://www.athion.net/ISPaster/paste 2019-05-01 19:52:26 +01:00
2ec13e4e76 Replace code with hasFlag() where appropriate. 2019-05-01 12:31:50 -04:00
f72d39ed85 Fixes #1318 2019-05-01 12:11:35 -04:00
72291b09f2 Fix the actual issue and remove whatever junk from the previous commit 2019-04-30 15:11:43 -04:00
ac5cdfae64 Fix for ItemFrames 2019-04-30 14:44:33 -04:00
db6115eae5 Documentation and formatting changes 2019-04-29 15:20:52 -04:00
9e324762b6 Move the update utility setup to it's own method 2019-04-29 15:18:38 -04:00
299fac95fb Add a stupidity fail-safe. 2019-04-29 11:02:47 -04:00
906c1081fa Merge remote-tracking branch 'origin/breaking' into breaking 2019-04-29 10:50:10 -04:00
237b10a2a2 Tidying up the code 2019-04-29 10:49:58 -04:00
b7909cc6e5 Fix typo 2019-04-27 16:16:13 +02:00
dca8594542 Update ISSUE_TEMPLATE.md 2019-04-25 13:06:26 -04:00
0b7e63bafb Added new 1.14 blocks 2019-04-24 22:04:30 -04:00
9f792fa54b Fixes #2328
I hope this doesn't cause more issues than it solves
2019-04-24 21:23:57 -04:00
d0be0780fd Reformatting and cleaning. 2019-04-24 16:11:24 -04:00
bef3dbc6f4 Reformat code 2019-04-23 23:48:22 +01:00
d352804b5d Update gradle lombok version for core 2019-04-23 23:47:00 +01:00
9485f82ea9 Fix signs between 1.13 and 1.14 2019-04-23 23:46:10 +01:00
c7ba94f959 Fix legacy material loading error and Jenkins4J dependencies 2019-04-23 23:03:52 +01:00
5ac00c4920 downgrade Jenkins4J 2019-04-23 22:41:06 +01:00
bd1217810f Should fix the sign issue 2019-04-23 22:30:31 +01:00
1e97392244 Update to gradle 5.4 2019-04-23 22:27:32 +01:00
9b3ca4468c Temporary fix for a working 1.14 build 2019-04-23 14:41:20 -04:00
b2b2f3cd05 attempt to fix signs 2019-04-23 14:24:55 -04:00
bae3774eb6 Merge remote-tracking branch 'origin/breaking' into breaking 2019-04-23 13:45:35 -04:00
1118901ca2 Initial 1.14 Update 2019-04-23 13:45:24 -04:00
0c0a696d36 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-04-23 12:57:46 +10:00
21a5b04b7b remove debug 2019-04-23 12:57:39 +10:00
6fa41efbf5 Merge remote-tracking branch 'origin/breaking' into breaking 2019-04-22 11:55:11 -04:00
ef8d33db41 Minor command changes
Changed RequiredType in some classes and formatting changed in others.
2019-04-22 11:55:05 -04:00
1abe444205 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-04-23 01:53:35 +10:00
145af1e091 fix workaround 2019-04-23 01:53:24 +10:00
f5fa15080c Minor javadoc updates 2019-04-22 11:45:23 -04:00
0c0d0104d7 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-04-23 01:06:52 +10:00
406dd22703 Workaround for effective permission check 2019-04-23 01:06:41 +10:00
bb44c2ea92 parsable build number 2019-04-20 16:26:31 +01:00
ea26ec628d Use Settings.Teleport.ON_LOGIN 2019-04-19 13:02:50 +10:00
815e513093 Fix teleportOnLogin error 2019-04-19 12:53:48 +10:00
8ac23b92d8 Use UUID, not just name 2019-04-17 22:18:03 +10:00
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
000e3de35d Don't allow importing using base directory 2019-04-17 14:36:31 +10:00
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
27eda9eb7c Don't setup single plot worlds 2019-04-17 14:00:01 +10:00
0fdc5eafbd Allow single plot areas to load survival worlds 2019-04-17 13:46:33 +10:00
59f89980a3 Don't need ratio out of 100 anymore 2019-04-17 13:13:56 +10:00
50acf4f51f Print exception on failed schematic setup 2019-04-13 13:06:21 +10:00
04779d28fb Don't fail on metrics error 2019-04-13 12:26:19 +10:00
1e78368115 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-04-13 12:23:24 +10:00
0c46df65e6 Not sure why that last commit was a thing locally 2019-04-12 17:42:35 +01:00
4c788cb51e Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-04-12 17:40:16 +01:00
1c915905c6 Fixes #2275 2019-04-11 23:27:47 -04:00
9f3e3c83e0 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-04-12 12:11:16 +10:00
6916752434 Fixes #2322 2019-04-12 12:11:03 +10:00
b0b328e50b Update offset to match CI 2019-04-11 12:43:16 +01:00
6cea26f436 Add random collection 2019-04-10 17:10:44 +10:00
533edc5f40 Change default threshold to -1 2019-04-10 17:10:17 +10:00
97903f3870 Fix you are not in a plot area for single plot worlds 2019-04-10 11:34:21 +10:00
d571f54c65 Update offset to match ci 2019-04-09 15:48:25 +01:00
e0bd8e3f9d Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-04-09 00:29:30 +10:00
9225a13808 sorry for breaking roads 2019-04-09 00:29:13 +10:00
3f712ed5f0 should check both end/nether 2019-04-08 18:03:38 +10:00
259fe94f83 Potential fix to skip chunks being kept loaded 2019-04-08 01:43:38 +10:00
3651b3ac8d I don't know about coffee, but how about Java? @sauilitired 2019-04-06 23:14:39 +11:00
b32b8a98e2 Fixes #1936 2019-04-06 17:19:48 +11:00
5d515b3863 This shouldn't have been made private 2019-04-06 12:55:45 +11:00
a3cb4e5ffb Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-04-06 03:54:42 +11:00
676ef0159a only change plotY if height not 256 2019-04-06 03:54:27 +11:00
34d11bf23d Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-04-05 17:39:33 +01:00
0c00eb2061 Add clean task back properly 2019-04-05 17:39:16 +01:00
3e3951a3e7 *negate 2019-04-06 02:07:39 +11:00
c71fe00741 Missed this as well 2019-04-06 02:07:14 +11:00
69a029a555 Fix plot schematic y 2019-04-06 01:54:02 +11:00
3f194f90ce Unbreakify things 2019-04-04 18:31:47 +02:00
7e401a83cf Make PlotLoc's immutable 2019-04-04 18:26:10 +02:00
69b05932eb Update to gradle 5. gradlew clean assemble build actually WORKS 2019-04-03 17:15:09 +01:00
ac2d43db68 Update offset to match CI 2019-04-03 14:41:54 +01:00
b5418e4dce Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-04-04 00:20:13 +11:00
6b422582a6 Load WorldEdit onEnable
as otherwise it doesn't work
2019-04-04 00:19:59 +11:00
f5388b9737 Merge remote-tracking branch 'origin/breaking' into breaking 2019-04-01 17:40:10 +02:00
6323fb0041 Add plot like/dislikes 2019-04-01 17:39:28 +02:00
b1835f0998 whoops, wrong schematic 2019-04-01 21:45:55 +11:00
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
0f8b7cd588 fixes #2211 2019-04-01 11:14:47 +02:00
c450e4aed3 Fix interval flags (fixes #2302) 2019-04-01 10:17:50 +02:00
14badf8cfc remove rogue debug message 2019-04-01 09:43:29 +02:00
df3e78ee40 Make the "Display all commands" message configurable too 2019-04-01 09:04:19 +02:00
11689bf855 Configurable help categories 2019-04-01 09:00:08 +02:00
4152582ae0 Fix UUID related NPE 2019-04-01 08:35:06 +02:00
3be7511b7c Fix genChunk setCuboid 2019-04-01 05:01:32 +11:00
f3adeeac0e Fix single plot area NPEs & generator stackoverflow 2019-04-01 04:44:18 +11:00
67cf1b45ed Fix another legacy converter NPE 2019-04-01 04:43:44 +11:00
e396da8ee5 fix converter NPE 2019-04-01 03:19:53 +11:00
04b9b67c9d Fixes #2288 2019-03-31 18:31:16 +11:00
45360f0979 Make sure /plot home ignores server owned plots 2019-03-30 13:32:45 +01:00
ae57264487 Add server-plot flag, and option to disable on-claim teleportation 2019-03-30 13:27:18 +01:00
08ebf57c90 Add hide-info flag 2019-03-30 12:50:32 +01:00
d9407d6329 Merge pull request #2312 from IntellectualSites/async-gen
Add support for Paper async chunk generation
2019-03-29 19:31:02 +01:00
c6ae2456f2 Add support for Paper async chunk generation 2019-03-26 09:27:20 +01:00
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
3a761b3b5f Update offset to match CI 2019-03-20 12:20:09 +00:00
c48116b723 Merge remote-tracking branch 'origin/breaking' into breaking 2019-03-18 19:49:31 +01:00
0b77b863ba Update notifications. 2019-03-18 19:49:22 +01:00
832d60ce87 Update README.md 2019-03-17 12:34:33 +01:00
f863dfee42 Update README.md 2019-03-17 12:32:09 +01:00
c44d180352 Update README.md 2019-03-17 12:31:23 +01:00
a17cb735b7 Update README.md 2019-03-17 12:30:14 +01:00
806124b047 Merge remote-tracking branch 'origin/breaking' into breaking 2019-03-15 13:40:04 -04:00
61cb288382 oops sorry.
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-03-15 13:39:51 -04:00
3956adf291 Update ISSUE_TEMPLATE.md
Added a warning about future legacy version support.
2019-03-15 01:00:55 -04:00
672fb0f829 Merge remote-tracking branch 'origin/breaking' into breaking 2019-03-14 21:49:52 -04:00
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
e146b6a88d Update offset to match CI 2019-03-13 13:21:09 +00:00
cf1764723f Fixes #2291
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-03-12 16:56:51 -04:00
7b788c07b8 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-03-09 00:05:49 -05:00
dffbaf89a3 Fix for offhandedness 2019-03-09 00:28:21 +00:00
578069b3c9 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-03-08 19:26:06 -05:00
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
aa894b8ad9 Fixes #2245
Also some minor fixes to PlayerInteractEvent main/off hand logic
2019-03-09 00:12:21 +00:00
ed10877431 Should fix IndexOutOfBoundsException when copying
fixes#2290
2019-03-08 23:04:38 +00:00
1d327ec346 Fixes an issue with boats
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-03-07 18:38:21 -05:00
56c24a6a56 Type weakening and Direction changes
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-03-06 12:47:38 -05:00
4c8457ad14 OCD
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-22 11:54:13 -05:00
f93cfb9f8b Update build offset 2019-02-22 16:53:11 +00:00
1755272f81 Merge remote-tracking branch 'origin/breaking' into breaking 2019-02-22 11:51:22 -05:00
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
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
7aebd9b74b Set wall filling on merge 2019-02-22 15:11:35 +00:00
be51d8e159 Correct artifact id for maven 2019-02-22 14:38:18 +00:00
bfc6b62213 Stupid docs
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-21 21:31:12 -05:00
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
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
f2d68642f9 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-02-20 14:51:01 +00:00
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
72b031e3e5 Update offset to match CI 2019-02-20 11:59:39 +00:00
d0a4465985 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-02-20 11:55:50 +00:00
0ef8b4ad14 Update to WorldEdit's *breaking* Biome handling changes 2019-02-20 11:55:39 +00:00
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
92718a5ec8 Merge branch 'consumers' into breaking 2019-02-19 22:29:59 -05:00
099a807ce0 CLeaning of code
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-19 22:29:27 -05:00
df47697ca6 CLeaning of code
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-19 19:00:37 -05:00
b7aeeb151d Replace RunnableVal with java Consumer
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-19 18:39:43 -05:00
2e22dfe056 Update offset to match CI 2019-02-16 22:06:31 +00:00
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
4f27abb4a0 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-02-14 17:39:01 +00:00
b999cb4195 Fix players being able to place boats, armorstands etc using offhand 2019-02-14 17:38:36 +00:00
745fd58e2e * 2019-02-13 21:54:13 +00:00
57981a870e Update version offset to match ci 2019-02-13 21:53:11 +00:00
130e1b6300 Fix armorstands, boats etc being placeable on players plots with "use 0" flag 2019-02-13 21:47:54 +00:00
477e698f7e Reformat 2019-02-13 17:13:57 +00:00
11c4a90cc9 Merge remote-tracking branch 'origin/breaking' into breaking 2019-02-13 12:05:42 -05:00
35493662da Cleanup
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-13 12:05:28 -05:00
8710f2f83b Fix NPE when right-clicking a >1.13 block 2019-02-13 13:43:22 +00:00
3e8308ecd7 Catch statement already being null 2019-02-13 13:35:19 +00:00
dae7bbdf9d Fix dropped items being removed from plots 2019-02-13 13:26:19 +00:00
d0994f1b4b Fixes to EntityTask 2019-02-10 23:03:14 +00:00
cae95343ca Update build offset 2019-02-10 22:51:21 +00:00
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
e891873d28 Cleaning and scope changes
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-08 11:21:53 -05:00
b39ea1b68b Cleaning and API clarifications
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-06 21:29:51 -05:00
3d8179a4e6 Small tweaks
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-06 17:30:25 -05:00
9101cb9218 PlotComment API tweaks.
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-06 12:33:14 -05:00
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
d6a801d854 Reformat 2019-02-06 16:42:27 +00:00
6711788dd0 Fix ClassCastException in runEntityTask 2019-02-06 16:38:01 +00:00
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
7e7f14a66b Update build ci offset 2019-02-06 14:10:34 +00:00
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
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
ccc53278a1 Fix the world border issue
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-05 20:36:42 -05:00
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
e3d43509cf Cleanup of some database methods
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-04 18:00:05 -05:00
dfbcecb081 Removes Cluster Flags
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-02-04 12:46:27 -05:00
cf82bc5efb Revert 8ac9b86 2019-02-04 15:18:50 +00:00
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
6d6087b1e3 And don't add the Core/ code into Bukkit/ code 2019-02-04 14:02:21 +00:00
51afbdfcdc Apply correct codestyle 2019-02-04 13:59:11 +00:00
9c90928d07 Remove the debug and don't created a new BloxkBucket for every air block. 2019-02-02 16:13:55 +00:00
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
cd8a1a0816 Fixed some translation mismatches 2019-01-27 00:48:03 +01:00
a4c3fb26c7 Check for road or unowned plot 2019-01-23 14:02:18 +00:00
fd4a5f2aaa Fix item despawning on plots 2019-01-23 13:34:23 +00:00
25ed9d2798 Fix road schematic pasting height 2019-01-23 12:23:05 +00:00
c96a1afaed Don't fuck up road schematics, I guess 2019-01-22 21:32:24 +01:00
344a2afeff Use StringBuilder, like a sane person 2019-01-22 19:54:31 +01:00
e54f964eca Fix #2009 2019-01-22 18:51:13 +01:00
8733dc6dab Fix deny-teleport flag: Fixes #2128 2019-01-22 10:43:29 +01:00
7e56e47046 Fix block list flag permissions 2019-01-21 17:49:36 +01:00
7edfc313d6 I did an oopsie 2019-01-21 12:24:34 +01:00
d37f5b9aa8 Fix schematic pasting offsets 2019-01-21 09:53:04 +01:00
1fbfc767c4 Use PaperLib and make command task return completable futures 2019-01-21 09:20:33 +01:00
bd797b59fe Allow disabling of scientific notation (disabled by default) for DoubleFlags 2019-01-20 15:56:49 +00:00
0609b3d7f6 Safer generation of the BlockBucketChunk 2019-01-19 16:28:49 +00:00
ca883c211a Add merge permission changes from master 2019-01-18 19:02:12 +00:00
330ab83ece possible NPE fix and add useful debug if it fails 2019-01-17 22:34:28 +00:00
d846bc7a2e Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2019-01-17 16:28:55 +00:00
db2e245b13 alphabetise PlayerEvents stuff and add Turtle Eggs 2019-01-17 16:28:42 +00:00
4e79a3aa16 Fix broken group ID 2019-01-17 15:31:18 +01:00
ea422b5561 Fix NPE on world initialise 2019-01-17 13:19:24 +00:00
f366f5e406 Remove needless generateExtBlockSections method that just reduced performance for no reason 2019-01-17 01:06:32 +00:00
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
0817d7de5a Removed PlotMe converting features.
Signed-off-by: matt <4009945+MattBDev@users.noreply.github.com>
2019-01-15 22:19:29 -05:00
0e0a534620 Fix regenallroads extend (height) 2019-01-16 01:55:45 +00:00
61f8ceaaaa I'm an idiot and left one of my debug messages in 2019-01-16 01:28:07 +00:00
7e6b11a21b Fix plot swap and have a nicer static AIR block 2019-01-15 23:58:21 +00:00
28c219c694 /plot leave has a terrible description 2019-01-15 16:20:50 +00:00
f679d3f873 Debug not debug 2019-01-14 18:27:20 +00:00
232b7ccfc1 Don't allow debugroadregen on merged plots 2019-01-14 18:15:44 +00:00
44fc8a55ea Add "kick" meta check in PlotListener 2019-01-14 17:41:28 +00:00
b2d035cf69 Fix deny-exit flag causing plot kick to break 2019-01-14 17:31:22 +00:00
d81d3c72e4 Update scripts and code to work nicely with each other.
Fixes #2208
2019-01-12 19:56:11 +00:00
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
8ba661aa35 Fixed plot owner UUIDs getting unnecessarily randomized. (#2233) 2019-01-12 17:48:53 +00:00
15ea0f3210 Fix BukkitLegacyMappings having maps the wrong way round & fix PlotBlockListFlag to use PlotBlocks.
Fixes #2229
2019-01-12 17:39:29 +00:00
0d76e46fa2 Fix requiring restart for /ps load after /ps save & make descriptions nicer 2019-01-11 12:50:38 +00:00
daf3e3dde5 Merge pull request #2230 from N0tMyFaultOG/breaking
Cleanup - Removing bo3
2019-01-10 22:33:20 +01:00
222585bf01 Update C.java 2019-01-10 22:21:34 +01:00
63af0de9f0 Update Settings.java 2019-01-10 22:20:30 +01:00
5df6f2a13e Update Download.java 2019-01-10 22:18:28 +01:00
c5f1c60ad7 Delete base.yml 2019-01-10 22:16:22 +01:00
3ac7785cc3 Skip empty files in DebugPaste 2019-01-10 21:34:52 +01:00
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
e47b4fef20 Remove update and changelog commands 2019-01-10 17:45:40 +01:00
7302480728 Merge branch 'optional' into breaking 2019-01-09 20:01:32 -05:00
457c520eb6 Fixing debugpaste description 2019-01-09 23:40:08 +01:00
053edb823d Use Incendo pasting instead of Hastebin 2019-01-09 23:12:36 +01:00
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
ea01a5171b Add missing admin unlink permission 2019-01-03 22:36:09 +00:00
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
e12a7bb85f Migrated remaining Optionals 2019-01-02 23:15:42 -05:00
c7b9bfeb4b Migrate from Guava Optionals to Java Optionals 2019-01-02 23:11:26 -05:00
ae9e52f093 Don't dump g_sch 2019-01-02 13:18:20 +00:00
00a5d5ff64 Nicer versioning and match CI build number 2019-01-02 13:01:37 +00:00
29868bdd29 Fix road generation for roads of even width 2019-01-01 14:43:41 +00:00
38a382f8e5 Add missing argument to unlink 2019-01-01 00:55:25 +01:00
f8ce00c2df Also cancel picking water/lava up with a bucket. 2018-12-31 18:03:59 +00:00
6a9038c306 Fix #2205 2018-12-31 17:57:17 +00:00
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
8c52e20736 Use BaseBlocks in regenallroads and minor cleanup of HybridUtils.
Fixes #2210
2018-12-31 16:08:09 +00:00
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
750be6c5fe clean merge up 2018-12-28 17:03:00 +00:00
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
f25581c3f1 Treat tridents as a projectile 2018-12-28 08:14:47 +01:00
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
660754511b Fix rotation of road schematics 2018-12-28 00:47:48 +00:00
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 3521b8aa22.
2018-12-27 20:06:02 +00:00
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
249b5d4068 Revert dors commit 2018-12-27 17:29:35 +01:00
76113cb0ab Allow specifying Y value for default plot home 2018-12-27 16:18:54 +01:00
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
75bcd1adec Update StringMan.java 2018-12-27 01:31:48 +01:00
fba7eac6d8 Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2018-12-26 21:18:38 +00:00
6e127db982 Cleanup 2018-12-26 21:18:22 +00:00
d12bdcfda4 Fix NPE on VehicleMoveEvent. Fixes #2195. 2018-12-26 19:25:20 +01:00
f1cf541606 Merge remote-tracking branch 'origin/breaking' into breaking 2018-12-26 19:16:42 +01:00
2b9fe5afda Fix plot music (and plot inventories) 2018-12-26 19:16:34 +01:00
ba47a21971 - Update code style to format annotations nicely
- Reformat code
2018-12-26 17:21:06 +00:00
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
5bdc5a0fcc Fix road schematics but for real this time 2018-12-26 17:24:35 +01:00
2ebb7d11a8 Fix road schematics 2018-12-26 17:05:37 +01:00
1d08f4d4ff Include a rationale like Spottedleaf was kind enough to suggest 2018-12-26 15:38:31 +01:00
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
f1378013c1 Fix plot home 2018-12-26 01:39:49 +01:00
edc758334c Actually copy over the files as well... 2018-12-25 18:30:42 +01:00
beb0f5708f Whoops... 2018-12-25 18:28:07 +01:00
71baee063c Update maven info for Core 2018-12-25 18:27:07 +01:00
1ca50cdbd2 Merge remote-tracking branch 'origin/breaking' into breaking 2018-12-25 12:05:12 +01:00
afb0a9f17f Forcefully load WorldEdit on startup 2018-12-25 12:05:01 +01:00
c14b76b324 Fix rotational blocks in road generation 2018-12-24 23:14:13 +00:00
af23d3d98e Fix schematic pasting to paste tile entities and blocks with BlockData (e.g. stairs) properly 2018-12-24 17:56:13 +00:00
9fe9c2662b Fix legacy conversion of block lists 2018-12-24 08:57:17 +01:00
9e0c226632 Fix schematic pasting 2018-12-24 08:13:15 +01:00
4f43788307 Merge remote-tracking branch 'origin/breaking' into breaking 2018-12-24 01:50:45 +01:00
8dae2555db Make mv create work again 2018-12-24 01:50:17 +01:00
1bf621fb4b Fix schematic saving (and improve performance slightly) 2018-12-23 22:49:43 +00:00
2ede77318a Add dordsor21 to author list 2018-12-23 20:32:48 +01:00
5c678e86bb Fix configuration loading issues 2018-12-23 20:31:29 +01:00
02937cc543 Add configuration conversion and fix BukkitLegacyMappings 2018-12-23 19:43:36 +01:00
165cac8b13 Fix bStats problem and commit Setup progress 2018-12-23 17:38:27 +01:00
25b34b419f Merge remote-tracking branch 'origin/breaking' into breaking 2018-12-21 23:48:18 -05:00
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
7900a95b25 Implement LegacyConverter 2018-12-21 22:55:47 +01:00
fe12d03916 Remove unused classes. 2018-12-21 21:28:33 +01:00
23b9eca4ab Add bStats support, seeing as mcstats has been down for ages 2018-12-21 21:10:37 +01:00
3c48488c61 Merge remote-tracking branch 'origin/breaking' into breaking 2018-12-21 17:49:15 +01:00
dff64c5c68 Add support for 1.13 blocks 2018-12-21 17:49:04 +01:00
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
e757c3e13c Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking 2018-12-21 13:39:27 +00:00
5fdb60f85d Default plot height is at sea level (62) 2018-12-21 13:39:20 +00:00
aaed3f622a Fix build for gradlew clean assemble build 2018-12-21 13:38:28 +00:00
130274de86 Fix multiverse setup and don't allow unsafe blocks in setup 2018-12-21 03:31:08 +01:00
8bc0bcd9e6 Update BukkitUtil#isBlockSolid to 1.13 2018-12-21 01:04:37 +00:00
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
c53cd1ec91 oops 2018-12-20 23:34:55 +00:00
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
341e386df8 Delete Collection getBlocks to Array getBlocks 2018-12-20 21:46:00 +01:00
f4140ae728 Add getBlockArray() method 2018-12-20 21:40:50 +01:00
1021c6f2b0 Use Math.min and Math.max 2018-12-20 20:25:21 +00:00
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
6ac7948f72 Pretty basic fix for chunk generation 2018-12-20 20:20:31 +00:00
4e10682748 A few minor fixes 2018-12-20 18:46:52 +00:00
096ad1febe Make sure that blocks are actually compiled. Whoopsie 🐮 2018-12-20 19:35:02 +01:00
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
442473368d This slipped through 2018-12-20 12:26:51 +00:00
b35221bf4f Fix crashing on chunk load (chunks are still empty though) 2018-12-20 12:23:49 +00:00
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
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
ffe5cddead 1.13.2 spigot dependancy 2018-12-20 01:05:10 +00:00
821e828f07 Merge pull request #2190 from IntellectualSites/master
Merge
2018-12-20 00:58:44 +00:00
2596f37f66 Merge branch 'breaking' into master 2018-12-20 00:58:28 +00:00
cbc2b70336 Merge commit 'be485075993f8dc807595c524f58c3bb58156a0c' into breaking
# Conflicts:
#	README.md
2018-12-20 00:55:44 +00:00
5aac7d07d2 Remove abstraction of BukkitSchematicHandler 2018-12-20 00:47:04 +00:00
ee6d52efa3 Update all legacy IDs 2018-12-20 00:43:47 +00:00
adc2d980f4 Clean up listeners for legacy versions 2018-12-19 23:49:35 +00:00
11ccfe7ac4 Reformat code 2018-12-19 23:26:20 +00:00
fa2dbb2b89 Update to WorldEdit 7 (and WE7-compatible schematics, *hopefully keeping legacy*) 2018-12-19 23:18:57 +00:00
e7b25d3fc8 Update BukkitLocalQueue to new LegacyMappings 2018-12-19 18:46:30 +00:00
444222c7f9 Improve PlotBlock name matching 2018-12-19 18:36:50 +01:00
e724aa8caf Fix PlotItem. 2018-12-19 18:24:35 +01:00
8f23299e7d Use BlockBuckets everywhere. 2018-12-19 17:19:54 +01:00
361cc9e9f7 Remove old LegacyMappings class from Bukkit
Add "fromAny" method
2018-12-19 15:08:49 +00:00
865de73a83 Merge pull request #2189 from dordsor21/breaking
Refactor legacy mappings to use PlotBlocks
2018-12-19 14:54:55 +00:00
531d8cc706 Merge branch 'breaking' into breaking 2018-12-19 14:54:32 +00:00
4b02bb1df8 Refactor legacy mappings to use PlotBlocks 2018-12-19 14:52:15 +00:00
1d3270d869 BlockBuckets r cool 🐮 2018-12-19 00:01:13 +01:00
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
af9418552a Whoops. 2018-12-18 20:58:52 +01:00
10b87f5728 Add mappings for pre initialized items 2018-12-18 20:56:55 +01:00
ccad0bced9 Progress. 2018-12-18 20:54:20 +01:00
fb7bcef05f 1.13 shizzle 2018-12-17 20:57:21 +01:00
b9482fe5b4 Possible fix for FAWE build failures 2018-12-17 13:16:53 +00:00
be48507599 Merge pull request #2188 from N0tMyFaultOG/master
Adding French translation
2018-12-12 16:15:12 +01:00
8ad75efa0e Adding French translation 2018-12-12 16:12:40 +01:00
820710721e Schematic list command 2018-12-06 18:01:33 +01:00
152e9e0e90 Make it build. 2018-12-06 16:59:10 +01:00
3fc7fb0a7a Bump version (PlotSquared 4 will be new release) 2018-12-06 16:53:21 +01:00
18e969227c Update lombok version build. Disable Sponge and Nukkit builds. 2018-12-06 16:49:49 +01:00
0252cf724a Adding JavaDocs, Maven Repo and API Documentation 2018-11-15 14:02:31 +01:00
4395ca06b4 Add @SuppressWarnings("unused") to listeners. 2018-11-15 00:12:12 +01:00
a4a923c23c Extract duplicated switch statement in EntityUtil 2018-11-15 00:08:32 +01:00
06f64aeff0 Extract duplicated method declaration 2018-11-15 00:06:20 +01:00
a8b4729845 Rename DBFunc#everyone to DBFunc#EVERYONE, and create two string constants 🐱 2018-11-14 23:51:56 +01:00
3c64376abe Fix guest gamemode flag. 2018-11-14 23:40:27 +01:00
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
8df7f63931 Refactor PS (and rename to PlotSquared) 2018-11-14 14:19:57 +01:00
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
ae2869a29b Translation update and fixing wrong lines 2018-11-05 16:00:44 +01:00
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
ea5ffbeb77 Cancel plot chat if message event is cancelled to allow for swear block/etc 2018-10-25 10:51:18 +01:00
302051a6ca Minor cleanup 2018-10-20 14:03:21 +02:00
b6d4872ca4 Merge pull request #2102 from dordsor21/master
Add PlotChangeOwner Event
2018-10-13 15:11:45 +11:00
4b7ca2ff37 Minor cleanup 2018-10-10 18:29:21 +02:00
e4e4694a1c Merge pull request #2127 from Leomixer17/patch-1
Delete chinese.yml
2018-10-10 18:07:07 +02:00
ba6818a5bd Delete chinese.yml 2018-10-10 17:27:29 +02:00
1734c0e357 Rename ko_KR.yml to ko-KR.yml 2018-10-10 16:52:35 +02:00
e2e34f24d6 Rename zh_CN.yml to zh-CN.yml 2018-10-10 16:51:43 +02:00
765db2df0c Added languages 'back' 2018-10-10 16:49:31 +02:00
e1e6d95f75 Merge pull request #2049 from f0rb1d/master
Updated Simplified Chinese translation and formalized language codes.
2018-10-10 16:40:52 +02:00
70584a338c Update PS.java 2018-10-10 16:38:01 +02:00
11e2777f60 Update PS.java 2018-10-10 16:36:14 +02:00
b6303a7615 Update PS.java 2018-10-10 16:33:03 +02:00
88e80f54f7 Updating locale names 2018-10-10 16:30:38 +02:00
c6f8a6ddc1 Merge pull request #2088 from N0tMyFaultOG/master
Minor translation and template changes
2018-10-10 15:13:55 +02:00
9e9b21779c Add PlotChangeOwner Event 2018-09-19 16:57:33 +01:00
eab918bcd4 minor sponge cleanup 2018-09-10 07:46:56 +10:00
2e7d95f5a6 Fix sponge schem save 2018-09-10 07:45:00 +10:00
906f16d075 Fixes #2092 2018-09-10 06:38:22 +10:00
979b3c0408 Added bridge template and korean translation 2018-09-03 00:04:32 +02:00
5b2428559a Bridge template from the spigot page 2018-09-03 00:02:07 +02:00
f001eebad4 Update Settings.java 2018-09-02 23:51:45 +02:00
f5a981fda7 Fix plot visit sorting 2018-08-24 06:47:16 +10:00
032484b0f5 Pull out duplicated method sub in BukkitPlayer 2018-08-20 12:15:03 +02:00
587c942d88 Suppress PlotAPI warnings 2018-08-20 11:36:59 +02:00
e98c648244 Move PlotAPI to Core and move bukkit specific methods to BukkitUtil. 2018-08-20 11:35:41 +02:00
be9fb3bd3a Remove deprecated methods without internal use. 2018-08-20 11:05:00 +02:00
01a927ccad Allow PlotRateEvent to be cancelled. Fixes #2017 2018-08-19 23:12:59 +02:00
3c86531b58 * ;) 2018-08-19 22:21:42 +02:00
847ce7f20d (W.I.P) TeleportEntityWrapper as alternative to replicating entity wrapper 2018-08-19 22:18:58 +02:00
4b8c434669 Fix compile (var must be final) 2018-08-12 21:36:04 +10:00
9105294965 Update auto-comment.yml 2018-08-11 15:48:33 +02:00
5378c9007c Create auto-comment.yml 2018-08-11 15:43:36 +02:00
40e91de111 Create stale.yml 2018-08-11 15:38:22 +02:00
b1246adac2 Update README.md 2018-08-11 15:29:31 +02:00
86e7f4e2b3 Update ISSUE_TEMPLATE.md 2018-08-11 15:28:41 +02:00
af461e1fc2 Add alternative maven link and re-enable gradle daemon 2018-08-10 23:41:31 +02:00
d9bc1fcfe7 Disable daemon (temporarily) to allow for CI builds to not run out of memory. 2018-08-10 23:38:28 +02:00
369ccb7c8d Prettify BukkitUtil 2018-08-10 20:54:17 +02:00
724fb34b1f Prettify BukkitMain 2018-08-10 20:46:38 +02:00
2898e9ae2b Fix error from refactoring 2018-08-10 20:30:05 +02:00
b551424ced Update gradle 2018-08-10 20:29:50 +02:00
b0348cfc34 Update packages. This will not be appreciated 🐱 2018-08-10 17:53:15 +02:00
1646cd0f5a Reformat code 2018-08-10 17:01:11 +02:00
02ee1e8fa1 Update README.md and commit code style 2018-08-10 16:52:35 +02:00
a2813a2427 Merge pull request #2057 from IntellectualSites/Sauilitired-patch-1
Remove unnecessary lines in Configuration javadoc
2018-08-10 16:05:06 +02:00
bbcd508bc3 Remove unnecessary lines in Configuration javadoc 2018-08-10 16:04:43 +02:00
a4f176fd07 Updated Simplified Chinese translation and formalized language codes. 2018-08-03 20:35:36 +08:00
3d8d75170d Check admin for setowner null 2018-07-31 14:28:22 +10:00
2c11a292f4 Prevent multiple uses of plot auto 2018-07-29 21:43:07 +10:00
cd9d22cb9b Fix augmented generator not clearing column 2018-07-27 14:02:40 +10:00
645c5fb529 Fix nukkit augmented generator 2018-07-27 13:25:46 +10:00
2d98da47cf Debug generator error 2018-07-27 10:57:34 +10:00
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
be8172ce91 Assume spigot 1.13 if NumberFormatException is fired 2018-07-22 09:17:38 -05:00
768e21d1b5 Update NBTFactory to support spigot 1.13 2018-07-22 09:09:39 -05:00
bbee2debff Remove unneeded changes and add back support for 1.9 through 1.12 2018-07-21 10:32:38 -05:00
d5b01aced2 Use MaterialData instead of block id and data for chunk generation 2018-07-21 00:15:13 -05:00
f533efb2c8 Add support for spigot 1.13-pre7 2018-07-20 23:51:09 -05:00
aaa70888bd Merge pull request #2028 from PhanaticD/patch-3
fix dispensers
2018-07-21 12:40:54 +10:00
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
ae1e58c0ac Add -f override for plot move 2018-07-07 09:22:24 +10:00
5d04c64d48 Fix typo 2018-07-07 09:11:23 +10:00
185fe39942 Fix check for UUID support 2018-07-07 08:50:43 +10:00
18c92bea38 Allow specifying area for move command 2018-07-05 19:33:17 +10:00
79e1ea9a8f * 2018-06-23 14:13:06 +10:00
1772fdab16 Fixes #1988 2018-06-23 14:12:21 +10:00
9020d740d1 Revert "possible fix for mob damage"
This reverts commit df6914fb1e.
2018-06-23 11:46:19 +10:00
df6914fb1e possible fix for mob damage 2018-06-21 07:48:45 +10:00
da5478f141 Only check int flag ranges 2018-06-20 07:48:51 +10:00
d454602888 Fixes #1961 2018-06-19 03:44:45 +10:00
3039331976 Add account age expiry filter 2018-06-19 03:29:14 +10:00
6ed6f607b5 Sort flag list alphabetically 2018-06-13 09:28:32 +10:00
37b0cdeace Revert "Don't cancel chat event"
This reverts commit dc5fc5af47.
2018-06-10 19:35:34 +10:00
9897890e6a *Add console sender to nukkit chat 2018-06-09 15:49:54 +10:00
ce3e3be59e Tweak nukkit plot chat 2018-06-09 15:37:49 +10:00
9ed5847c0a Fixes #1768 2018-06-09 06:20:31 +10:00
dc5fc5af47 Don't cancel chat event 2018-06-09 05:45:25 +10:00
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
c7a1526e12 Fix errors with tab completion on Sponge.
Fixes #1768
2018-06-08 11:17:02 +01:00
740de4932b Fix flag perm check 2018-06-07 12:30:39 +10:00
442513b592 Fixes #1970 2018-06-07 08:15:28 +10:00
40635255e3 Probably fixes #1953 2018-05-18 14:48:17 +10:00
550df7f232 Fixes #1952 2018-05-17 17:46:54 +10:00
4ffc4e67ab Fixes #1822 2018-05-17 16:30:31 +10:00
d6c472fcdf Fixes #1484 2018-05-17 16:23:27 +10:00
a83b51eb12 Fixes #1951 2018-05-17 15:21:53 +10:00
67a70d4ade Fixes #1928 2018-05-17 15:17:45 +10:00
f479a70594 Fixes #1729 2018-05-17 15:11:44 +10:00
9f9527d2e2 Fixes #1784 2018-05-17 14:53:34 +10:00
98b7a84119 Fixes #1483 2018-05-17 14:50:47 +10:00
5cb94f3e45 Fixes #1928 2018-05-17 14:43:51 +10:00
ecf94b8706 minor web tweaks 2018-05-13 10:32:48 +10:00
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
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
2d617fc05e Merge pull request #1942 from N0tMyFaultOG/patch-2
Typo fixes
2018-05-11 11:36:49 +10:00
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
59e06c2319 Fixes #1929 2018-05-07 10:44:16 +10:00
9a7ce84e1c Potentially fixes #1769 2018-05-07 10:20:13 +10:00
ef54775ca7 wtf, this has its own spawn reason, thanks spigot
Fixes #1803
2018-05-07 10:15:21 +10:00
d49bfa612e Merge pull request #1933 from Leomixer17/patch-1
Update italian.yml
2018-05-02 00:52:53 +10:00
72f30d8aef usernames can be 2 characters 2018-05-02 00:43:27 +10:00
ef6b1cb932 Update italian.yml 2018-05-01 01:29:18 +02:00
154bad6188 * 2018-04-28 21:53:39 +10:00
613d79fb39 Fixes #1691 2018-04-28 21:51:26 +10:00
5f9bd853ec Fixes #1903 2018-04-28 09:41:09 +10:00
ef83b5a1b7 Fixes #1931 2018-04-28 09:28:55 +10:00
9fe1e53d9d Fix single generator biomes 2018-04-15 10:47:00 +10:00
4f63cdf560 Fixes #1920 2018-04-13 20:37:28 +10:00
7f257e2bf3 * 2018-04-12 00:20:13 +10:00
c5b332246e Fix setblock npe 1.8 2018-04-11 23:41:09 +10:00
0c7be7e11d Merge pull request #1915 from Foorack/master
Fix maven compilation
2018-04-09 17:05:27 +02:00
c5a30bd708 Filter Core resources 2018-04-07 20:52:31 +02:00
90c3fac4fa Fix PlotVersion when compiling with Maven 2018-04-07 20:52:19 +02:00
e4f6c39bb7 Fix Maven compiling 2018-04-07 12:05:37 +02:00
39084be791 Fix nukkit compile 2018-03-19 16:05:12 +11:00
ded33aa9be Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2018-03-18 09:28:36 +11:00
3565e67137 Prevent entity portal use from plotworld 2018-03-18 09:28:23 +11:00
0e5483c050 Merge pull request #1901 from bibo38/nlfix
Fixed wrong newlines in german language file
2018-03-17 15:24:39 +11:00
fb706e0d60 Fixed wrong newlines in german language file 2018-03-16 18:07:29 +01:00
368b9a0168 Fixes #1786 2018-03-15 16:34:28 +11:00
c208c530ff Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2018-03-12 17:27:00 +11:00
b36d42811a Fixes #1897 2018-03-12 17:26:40 +11:00
5921e1865b Merge pull request #1895 from BrainStone/master
using newer MySQL driver
2018-03-12 17:23:27 +11:00
515405aa9e using newer MySQL driver
- Newer driver doesn't need manual loading
- Fixes #1783
2018-03-10 21:34:11 +01:00
8f5e2eb439 Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2018-03-08 08:37:36 +11:00
5b18b918a9 Ignore unsupported statement isClosed 2018-03-08 08:37:17 +11:00
7dcb85d5d4 Fix typo in database update error message 2018-03-07 21:02:19 +00:00
1cd30b84d5 check for closed connections 2018-02-15 23:12:42 +11:00
eb1c3263ec Fix deny-exit flag 2018-02-15 18:59:40 +11:00
c98f2b4261 update to latest nukkit 2018-02-13 02:16:13 +11:00
d9a17bd379 Fixes #1872 2018-02-08 19:48:40 +11:00
c5d5b52df4 Tweak item drop check 2018-02-08 19:42:36 +11:00
73d0068d07 Update to latest nukkit 2018-02-02 15:19:58 +11:00
4b50276ba0 Fixes #1844 2018-01-31 13:05:11 +11:00
8815c83ba1 Various minor
Teleport on login fixes
World unloading fixes
2018-01-27 16:26:09 +11:00
c5778137f6 Update asm 2018-01-25 17:46:41 +11:00
d22c0349f7 * 2018-01-25 15:32:25 +11:00
785ba10ca1 Update to latest sponge 2018-01-25 14:51:39 +11:00
0e183f5627 Fixes #1839 2018-01-13 12:47:02 +11:00
b239cb4a18 Fixes #1828 2018-01-10 17:50:38 +11:00
02b358133e Better idea, send the packet. Closes #1837 2018-01-10 17:39:12 +11:00
4f464439e5 * 2018-01-10 17:22:46 +11:00
4716104951 Revert broken changes to visit 2018-01-10 17:15:05 +11:00
bc8b2af164 Fixes #1774 (backwards compatibility) 2018-01-10 17:06:35 +11:00
03337fe080 Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2018-01-10 16:58:42 +11:00
4ff02831f3 Fixes #1767 (performance issue) 2018-01-10 16:58:37 +11:00
09e83bcbf8 Merge pull request #1793 from Leomixer17/patch-3
Update italian.yml
2018-01-10 16:50:17 +11:00
57ae3945d7 Merge pull request #1836 from PhanaticD/patch-1
nukkit world height is 256
2018-01-10 16:45:52 +11:00
17e4c1ec60 Update NukkitMain.java 2018-01-10 16:45:41 +11:00
b9a4f2256e Update NukkitMain.java 2018-01-10 00:44:38 -05:00
5ddefcea22 when PlayerQuitEvent is never called 2018-01-04 19:24:00 +11:00
47314ce00d Update italian.yml 2017-12-10 15:28:35 +01:00
452bf593e0 Update italian.yml 2017-12-10 14:35:43 +01:00
a9bd6566b7 Update italian.yml 2017-12-10 12:53:22 +01:00
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
48bdfd75e5 Update italian.yml 2017-12-07 19:50:02 +01:00
6c06e48a1f Merge pull request #1792 from Opachl/PS-#1791
fix: p visit issue in latest builds
2017-12-07 08:54:36 +01:00
70a82d9fc6 fix: p visit issue in latest builds
p visit issue in latest builds #1791
2017-12-06 21:40:26 +01:00
61e045aa50 Update italian.yml (#1789) 2017-12-04 17:02:11 +01:00
d373a4dafa Merge pull request #1787 from Leomixer17/patch-1
Improved the italian translation
2017-12-03 22:47:16 +01:00
9daf13c897 Update italian.yml 2017-12-03 21:13:39 +01:00
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
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
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
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
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
734c4bb5fe Fix vehicle deletion 2017-11-14 17:24:02 +11:00
6b7adcdf34 Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2017-11-14 17:10:05 +11:00
a752780eeb Minor fixes
Update message color
CME on plot action
Creative middle click banner/head
2017-11-14 17:09:51 +11:00
01fafc3be4 Merge pull request #1766 from Opachl/master
fix: Interaction flag with item_frame #1761
2017-11-13 16:13:19 +11:00
c281620d75 Update PlayerEvents.java
added missing import
2017-11-12 17:49:14 +01:00
c3f93a1960 fix: Interaction flag with item_frame
Interaction flag with item_frame #1761
2017-11-12 17:36:58 +01:00
b4e8d782a1 Revert "fix: nteraction flag with item_frame"
This reverts commit a2eb727e25.
2017-11-12 17:35:59 +01:00
a2eb727e25 fix: nteraction flag with item_frame
nteraction flag with item_frame #1761
2017-11-12 17:34:50 +01:00
6e9c103b55 Fix typo 2017-11-12 13:32:09 +11:00
cbf7956a32 Add gradle jar 2017-11-12 12:49:19 +11:00
6e841543b8 Closes #1731 2017-11-09 10:57:17 +11:00
585f1b75a1 Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2017-11-09 10:18:58 +11:00
534d627b05 Fixes #1732 2017-11-09 10:18:52 +11:00
fe534bccbe Merge pull request #1753 from Leomixer17/patch-1
Improved italian translation
2017-11-09 10:16:37 +11:00
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
515aca5f06 Merge pull request #1757 from IntellectualSites/FixVehicles
Implement VehicleMoveEvent for Bukkit.
2017-11-08 11:59:46 +11:00
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
faa24bbdf4 Update italian.yml 2017-11-04 21:36:03 +01:00
5b6d5664e4 Fix fireworks being spawnable in other plots 2017-11-03 06:58:57 +11:00
22429fc3e0 Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2017-10-31 23:26:18 +11:00
7e2a911530 Closes #1750 2017-10-31 23:26:08 +11:00
7b04ec9ff3 Merge pull request #1746 from Gabscap/fix-location_equals
Fix Location.equals
2017-10-29 21:08:58 +11:00
097159d606 Fix wrong sign height 2017-10-23 18:23:37 +11:00
04bfe73c29 Fix Location.equals 2017-10-20 14:23:35 +02:00
d4614007ae Fixes #1743 2017-10-14 20:52:35 +11:00
9480c70655 Save world before download 2017-09-30 00:28:39 +10:00
8b6cc7a193 * 2017-09-29 23:23:40 +10:00
0d608245f5 Some tweaks / optimizations 2017-09-25 16:57:42 +10:00
92f94ecedc Tweaks
Use sign with plot schematic
Tweak world unloading
2017-09-24 00:13:05 +10:00
2360782234 * 2017-09-23 20:09:34 +10:00
1d20ae2777 allow air 2017-09-23 19:28:40 +10:00
6b55b8cd67 Allow configuring a separate nonmember home position 2017-09-23 19:10:57 +10:00
c645c4a6cb * 2017-09-23 18:20:27 +10:00
8e55860f77 Center plot schematic 2017-09-23 16:25:28 +10:00
abfbeffbb0 Skip y=255, block when finding a free spot 2017-09-23 15:09:03 +10:00
31908090b8 Buld height check 2017-09-23 14:07:52 +10:00
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
ce90b36d28 Wrap plot.schematic 2017-09-13 13:57:07 +10:00
20d7a0eea2 Don't overwrite online player names from uuid cache 2017-09-06 19:49:57 +10:00
24b3b60983 Might fix #1704 2017-09-01 23:11:37 +10:00
17154ef1d5 idk why that wasn't working 2017-08-18 23:34:27 +10:00
538e2a6002 Varios
Fixes #1697
Fixes #1689
2017-08-18 12:37:26 +10:00
84a6a6daf4 Closes #1643 2017-08-10 17:24:59 +10:00
a2324190bb Fixes #1619 2017-08-10 17:18:35 +10:00
af99c6a706 * 2017-08-10 17:15:03 +10:00
c9cee8a4a8 Fixes #1504 2017-08-10 17:12:27 +10:00
da51be20a3 Fix compile 2017-08-10 16:55:57 +10:00
c808257b7c Fixes #1668 2017-08-10 16:52:17 +10:00
c3759f8963 Fixes #1672 2017-08-10 16:46:51 +10:00
c36ef1d237 Fixes #1673
+ unrelated plotme conversion fix
2017-08-10 16:35:53 +10:00
f49d43d6a3 Notify player when using an invalid purge argument 2017-08-10 16:11:50 +10:00
cc1324f581 Fixes #1682 2017-08-09 15:45:27 +10:00
ac9042bbe4 Various minor
New plugin updater and versioning
In game changelog
fix login teleporting
2017-08-09 15:05:13 +10:00
b280644661 Delete build 2017-08-09 15:01:16 +10:00
b924809c91 Fixes #1608 2017-08-03 23:13:04 +10:00
a913983d99 Add plot leave 2017-07-25 06:39:59 +10:00
3633576e03 Fix teleport for single plot worlds 2017-07-08 23:22:05 +10:00
73318f23a1 Fixes #1660 2017-07-08 21:56:15 +10:00
248751378b Fixes #1661 2017-07-08 21:50:47 +10:00
1918000668 Merge pull request #1645 from dordsor21/master
Lower TPS threshold please
2017-07-07 16:12:26 +10:00
9037b74720 Closes #1659 2017-07-07 16:11:46 +10:00
f6540bbfcb bypass owner check for download 2017-06-29 15:38:37 +10:00
507d0f19e4 Lower TPS threshold please 2017-06-24 16:11:52 +01:00
355e16fe92 Ignore searching top block for teleportation 2017-06-09 17:43:46 +10:00
2b1905889c Minor sponge fix 2017-05-16 13:20:28 +10:00
7ee67c8b41 Merge pull request #1599 from Gabscap/fix-min_height
Fix world.min_height setting
2017-05-03 14:58:16 +10:00
f8ab36b67c Fix world.min_height setting 2017-05-01 21:23:21 +02:00
b5ef5df20d * 2017-04-28 01:47:05 +10:00
509b1f1c3d Fixes #1593 2017-04-28 00:59:59 +10:00
bfe98f3285 Some claiming fixes 2017-04-20 14:12:40 +10:00
47915b8b86 Read sign on main thread 2017-04-20 01:09:52 +10:00
3c110bb125 Fixes #1585 2017-04-18 22:55:04 +10:00
a87fee1224 Merge pull request #1583 from manuelgu/patch-3
Added useSSL=false to JDBC connection URL
2017-04-17 22:28:20 +10:00
757b9c695f Fix compile 2017-04-17 19:11:55 +10:00
193948d4fd Fix claim 2017-04-17 11:56:10 +10:00
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
37977f1da4 Check database before claiming plot 2017-04-15 12:40:23 +10:00
7eb7cd9b53 Ensure world loading occurs on the main thread 2017-04-11 01:49:01 +10:00
ddfcc5b077 Player login tweaks 2017-04-10 09:06:44 +10:00
9f6bf14649 Log when a plot is created/deleted 2017-04-09 17:10:23 +10:00
f99994737c Print error when failing to close database 2017-04-09 17:09:06 +10:00
6e0ade4f63 Some sponge fixes 2017-04-07 08:25:08 +10:00
c1a6c75ebe * 2017-04-04 08:07:54 +10:00
022372e9b7 Fixes #1534 + various
Auto world loading/unloading
Auto player teleporting on login
2017-04-04 07:59:36 +10:00
3f54ba23c2 Fix world delete 2017-04-01 04:36:45 +11:00
e8672df760 Add Gitter badge (#1565) 2017-03-27 12:03:33 -04:00
5d6f4c6668 Some plot area restructuring 2017-03-23 11:10:29 +11:00
a07ed4eafd * 2017-03-18 00:50:43 +11:00
5262ff665a Fix door break 2017-03-18 00:49:41 +11:00
1129a80329 Fixes #1510 2017-03-17 17:41:58 +11:00
a628c5927f Fixes #1560 2017-03-17 16:40:29 +11:00
478ad9670b Fixes #1476 2017-03-16 14:15:00 +11:00
8e3407505a Recover on database error
Might resolve #1476
2017-03-15 02:10:57 +11:00
e208d7f72a Fix mass purge 2017-03-15 01:28:02 +11:00
b0df79bb80 Break up purge task 2017-03-15 00:16:27 +11:00
411c75b219 Fixes #1556 Close #1555 2017-03-14 01:56:14 +11:00
491cc50440 Fixes #1528 2017-03-13 18:45:37 +11:00
e9723f5be1 Fixes #1532 2017-03-13 18:38:58 +11:00
a015039dad Fixes #1535
Set `misc_spawn_unowned`
2017-03-13 18:36:40 +11:00
a0640a1e66 Fixes #1536 2017-03-13 18:12:38 +11:00
0b6d2d3dd6 Fixes #1538 2017-03-13 18:07:48 +11:00
ad11ad3472 Fixes #1517 2017-03-13 18:02:05 +11:00
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
38a33248e7 Send message on perm check 2017-03-13 09:04:40 +11:00
52496af9a1 Fix road interact on sponge 2017-03-13 07:16:16 +11:00
4d4950090d Fix 1.7 block placer 2017-03-10 07:07:50 +11:00
c8c144b6da Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2017-03-08 16:51:29 +11:00
e94adb04ea Add maven repo
closes #1394
2017-03-08 16:51:01 +11:00
395c1c743f Merge pull request #1537 from HexagonMC/master
Fix plot teleport.
2017-03-06 15:40:28 +11:00
b1fb01303d Fix plot teleport.
Fixes https://github.com/IntellectualSites/PlotSquared/issues/1302
2017-02-20 20:29:43 +01:00
aa7b770c03 tweak highest block check 2017-01-31 16:45:02 +11:00
e7990a06e2 Check player name for invalid character first 2017-01-30 19:42:16 +11:00
88f5e5b0bc Sort player names 2017-01-15 22:51:54 +11:00
47db330764 Fix title global flag 2017-01-13 08:05:13 +11:00
35ebc8c830 Permission check fix 2017-01-13 07:22:28 +11:00
686a6c499f Fixes #1502 2017-01-11 07:53:53 +11:00
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
6af96f43d4 Optimize schematic paste 2016-12-31 17:23:46 +11:00
e3eccfd476 Fix debugpaste 2016-12-31 17:23:38 +11:00
15d4b6d34b Bump spigot version 2016-12-29 07:23:51 +11:00
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
6ec96870c0 Fix SO 2016-12-23 15:33:19 +11:00
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
3240fc9559 Exit plot on unclaim
Fixes #1471
2016-12-15 17:37:26 +11:00
5fd1486cec Merge pull request #1478 from EvilOlaf/patch-2
Update ISSUE_TEMPLATE.md
2016-12-13 01:44:37 +11:00
d648148f51 Update ISSUE_TEMPLATE.md 2016-12-12 15:42:00 +01:00
d554dab8c8 Fix potential NPE with claiming 2016-12-10 14:33:48 -05:00
9ad45750ee Unclaiming a plot should call plotExit() 2016-12-09 20:58:05 -05:00
a554ae5633 Potential fix for commands 2016-12-09 16:58:32 -05:00
7b1c4a5042 Check border when claiming a plot
Also fixes #1467
2016-12-10 01:09:07 +11:00
9fc464e896 Shorter border teleportation 2016-12-10 00:44:42 +11:00
bec11b244e Use the correct plot id 2016-12-10 00:26:40 +11:00
dc94418b51 Only expand border to current plot. 2016-12-09 23:52:48 +11:00
72ab10c079 remove debug 2016-12-03 23:08:10 +11:00
f50d32f06b * 2016-12-02 17:17:16 +11:00
6cc744a2e6 Fixes #1444 2016-12-02 17:16:19 +11:00
e40dc37f89 Fix versioning messup. 2016-12-01 21:56:19 -05:00
7e34d9e20a Fix title logic 2016-11-30 21:26:52 +11:00
c891abce09 Allow added players to use frost walker
Properly fixes #1438
2016-11-30 20:46:48 +11:00
2b561f2efa Rename to ice-form 2016-11-30 19:06:03 +11:00
dea0a452df Add fading 1.11 titles 2016-11-30 16:28:50 +11:00
81418b07a8 Fixes #1438 (unless other things call this event) 2016-11-30 16:15:20 +11:00
a3c1ad3ec8 Fixes #1449 2016-11-30 16:10:08 +11:00
7c6c19ba63 Fixes #740 2016-11-30 16:07:16 +11:00
2e23ae0811 Fixes #1243 2016-11-30 16:00:47 +11:00
28e7f5bc08 Fixes #1349
Non standard plot managers/areas not supported
2016-11-30 15:57:24 +11:00
7a1417dc56 Fixes #1415 2016-11-30 15:45:28 +11:00
e7fa9e01be Fixes #1419 2016-11-30 15:43:23 +11:00
93414d54c1 Fixes #1453 2016-11-30 15:41:08 +11:00
5642fd3899 Fixes #1359
plots.chat.color
and
PLOT_CHAT_SPY_FORMAT
2016-11-30 15:36:13 +11:00
f3d950f6e1 Fix flame enchant damaging entities 2016-11-30 15:03:48 +11:00
95f8aaa2fe this could be here? 2016-11-30 13:10:36 +11:00
878010255c Java 9 2016-11-28 18:02:03 +11:00
8edc357d01 Fixed #1448 2016-11-27 01:26:06 -05:00
588639d9c2 3.5.1 Start 2016-11-27 01:08:35 -05:00
ff401b65c4 3.5.0 Release 2016-11-26 18:02:39 -05:00
11913bfbe5 Fix compile issue 2016-11-26 17:53:44 -05:00
62b353f82d Various Sponge changes
- many improvements
- inventory utilities broke when updating to Sponge API 6.0.0
2016-11-26 16:49:13 -05:00
8d442f58d4 Fixes #1445 2016-11-26 12:05:08 -05:00
5cbd2f44bd Update Sponge Gradle 2016-11-26 11:55:59 -05:00
dc673f9715 Fixed #1440 , Fixed #1446 2016-11-26 11:55:38 -05:00
deb5441bcf *Fix compile error 2016-11-24 11:05:28 +11:00
8ebf71c87f DB fix 2016-11-24 10:19:00 +11:00
9fd53af483 Add world argument 2016-11-23 15:47:18 +11:00
fb729df59e Setting to sort plots by area 2016-11-23 15:36:25 +11:00
ce6e1be13e Fix maven dependencies (#1439)
* Fixes

* Fix wrong version
2016-11-21 09:59:11 -05:00
e126054053 Fixes #1429 Removes duplicate aliases. 2016-11-20 22:29:14 -05:00
77281017d4 Fixes #1428 , Fixes #1431 2016-11-20 22:24:27 -05:00
e0208aa369 Fix plot help category pagination 2016-11-18 10:49:03 +11:00
fdc42a3d5c Seems the new spigot 1.11 sqlite driver has issues parsing timestamps, no idea why. 2016-11-18 09:08:41 +11:00
3070557a3a Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2016-11-13 22:18:11 +11:00
2ec0b55482 Fix database lock error 2016-11-13 22:17:17 +11:00
10dd9b6371 Merge pull request #1424 from c7w/master
translation
2016-11-13 06:41:25 +11:00
c7w
1ac0a7dad0 translation
translation of chinese
2016-11-12 12:52:43 +08:00
f8b1fcffa1 Fix worldedit mask area 2016-11-12 00:14:12 +11:00
17762f5ae7 Tweak delete message 2016-11-09 00:13:46 +11:00
1d7cdde84a Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2016-11-02 04:28:11 +11:00
c950b0021f Notify inbox permission 2016-11-02 04:27:52 +11:00
e4bc2b30b1 Update ISSUE_TEMPLATE.md (#1409) 2016-10-28 10:15:38 -04:00
e0c4c944bb Merge remote-tracking branch 'origin/master' 2016-10-26 23:01:01 -04:00
dd09ef18e6 Add missing gradle batch
Signed-off-by: MattBDev <mattbdev@outlook.com>
2016-10-26 23:00:43 -04:00
68011f43cd Fixes #1390 2016-10-21 03:51:27 +11:00
93c4854454 Add misc-interact flag 2016-10-18 05:03:14 +11:00
e594227d95 Fix some height issues 2016-10-14 16:56:28 +11:00
d6be5703ae Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2016-10-14 15:14:35 +11:00
c97544d083 Minor fixes 2016-10-14 15:14:08 +11:00
a05fd2dd11 Fix #1386
Signed-off-by: MattBDev <mattbdev@outlook.com>
2016-10-10 00:18:35 -04:00
5978c9c3c0 Fix center 2016-10-03 00:56:27 +11:00
5d3e096501 *Fix the toggle 2016-10-03 00:56:26 +11:00
39e99c0593 Merge pull request #1381 from filoghost/patch-1
Fix permission checks being ignored
2016-10-02 14:08:22 +11:00
cd33aaa1b6 Fix permission checks being ignored 2016-10-01 21:35:57 +02:00
0244c0241c Trim deletes expired plots 2016-10-01 20:17:50 +10:00
5ed2190cb3 Fixes #1369 2016-09-30 23:32:49 +10:00
c533f0bae9 Fix area removal 2016-09-30 17:05:18 +10:00
cd2b6c8ccc Fixes #1379 2016-09-30 17:04:06 +10:00
6f2c7de0ff Minor fix to conversion 2016-09-30 16:46:10 +10:00
62373c0737 * 2016-09-30 16:15:15 +10:00
499120963a Streamline PlotMe conversion
Use reflection to disable PlotMe and forward DefaultGenerator to
PlotSquared
Fix border material copying from plotme config
You no longer need to delete the PlotMe jar for conversion
Fix some outdated messages
2016-09-30 16:14:35 +10:00
f1d581a8d8 Fixes #1377 2016-09-30 15:29:50 +10:00
6074fc8033 Nukkit generator fixes 2016-09-30 14:26:20 +10:00
e4d7270c28 Fix some merged plot events 2016-09-30 03:30:34 +10:00
b6df07f723 Add snow-form flag 2016-09-27 01:38:59 +10:00
177b33154f Multiple
Fixes #1362
Fixes border id for PlotMe converter
2016-09-27 00:56:39 +10:00
6bf2fbcfcf Command tweaks 2016-09-26 18:33:27 +10:00
12f8861d07 Various
externalize strings
plotme conversion fixes
2016-09-26 18:31:08 +10:00
c99e23bd3c Fixes #1367 2016-09-25 18:48:38 +10:00
1b6d08b3fe Fixes #1365 2016-09-25 18:43:53 +10:00
3b4490c1c6 Fixes #1366 2016-09-25 18:42:05 +10:00
04c011164a Add near cmd 2016-09-25 18:06:20 +10:00
86b776f742 Nukkit perms 2016-09-25 16:49:51 +10:00
61022b717a Fixes #1360 2016-09-21 13:42:59 +10:00
9e5af7a642 Possible fix for redstone in merged plots 2016-09-20 23:49:22 +10:00
364b4347d1 Fix area id parsing 2016-09-19 14:18:47 +10:00
d89274ce09 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	Bukkit/src/main/java/com/plotsquared/bukkit/BukkitMain.java
2016-09-17 16:03:57 +10:00
264114332b Let generator be up to the implementation 2016-09-17 16:02:05 +10:00
a4363bdb27 Fix #1355
There is the possibility this will cause issues with sponge

Signed-off-by: MattBDev <mattbdev@outlook.com>
2016-09-14 19:27:30 -04:00
8e7e5dcb25 Cleanup
Signed-off-by: MattBDev <mattbdev@outlook.com>
2016-09-14 12:16:22 -04:00
56227a6d7d Fixes #1351 2016-09-14 10:21:14 +10:00
63259ec269 Merge pull request #1352 from MisterErwin/master
A (possible) fix to #1351
2016-09-14 10:17:11 +10:00
0286a7b046 Fixes #1131 2016-09-14 10:12:53 +10:00
b6dac54677 Code cleaning and Gradle Update
Updated gradle wrapper to 3.0
Updated Gradle files for Nukkit
Added/cleaned minor Nukkit code
Removed duplicate TitleManagement code

Signed-off-by: MattBDev <mattbdev@outlook.com>
2016-09-13 18:10:01 -04:00
bf1d487508 A (possible) fix to #1351 2016-09-12 17:05:13 +02:00
a95b68b73c Add villager-interact flag 2016-09-09 15:17:37 +10:00
85ff8bf639 Minor tweaks 2016-09-07 00:28:01 +10:00
0557671b80 Recover from third party generator error 2016-09-04 14:22:01 +10:00
d75ab130da Sponge fixes 2016-09-02 15:58:24 +10:00
6a12a6ba64 print chat to console
Fixes #1339
2016-09-02 15:47:19 +10:00
22901bf9f2 Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2016-09-01 16:57:52 +10:00
07ee19b4bb Fixes #1337 2016-08-31 19:09:17 +10:00
27c21b9ab6 Fix #1321 2016-08-30 21:50:52 -04:00
da7a12bc00 Fixes #1234 2016-08-29 16:21:14 +10:00
3b73b2e9d8 Fix grant check 2016-08-29 15:33:26 +10:00
970c80cb15 Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2016-08-29 15:01:27 +10:00
dd665ed9ce Fence rotation 2016-08-29 15:01:19 +10:00
572da7d436 Merge pull request #1332 from manuelgu/patch-2
Might resolve #1331
2016-08-29 14:41:48 +10:00
ab05b026e9 Merge pull request #1335 from Herocraft/fix/vault-repo
Switch Vault repository to the real one
2016-08-29 12:19:48 +10:00
2fcb59f8cf Switch Vault repository to the real one 2016-08-28 18:26:11 -07:00
20250bc989 Might resolve #1331
Wasn't able to reproduce the issue
2016-08-28 20:14:58 +02:00
5e4798165b Merge pull request #1330 from MinelinkNetwork/fix-pom
Fix Spigot artifact in POM
2016-08-28 18:26:57 +10:00
7fc3fb097e Fix Spigot artifact in POM
Use the correct groupId, artifactId and version of Spigot dependency
installed by BuildTools
2016-08-28 01:13:21 -07:00
3a08e5c091 Merge pull request #1326 from SupremeMortal/SupremeMortal-patch-1
Update Non-existent Repo
2016-08-28 00:52:04 +10:00
50770a78d7 Fixed mistake 2016-08-27 14:09:03 +01:00
1266eed86a Add Replacement Repo For Vault 2016-08-27 14:08:35 +01:00
c0996299b4 Remove non-existent Repo
"nexus.theyeticave.net" does not exist anymore.
2016-08-27 14:03:41 +01:00
90d48b2cd0 Fixes #1289 2016-08-26 13:54:22 +10:00
a95d18499e Fixes #1285 2016-08-26 13:19:42 +10:00
61d00e51ef Fixes #1303 2016-08-26 03:02:50 +10:00
b5349e16f0 Fixes #1305
Just teleports the player further back
Combine move/tp since tp extends move
2016-08-26 02:31:50 +10:00
a801127036 Merge pull request #1301 from MisterErwin/master
Calling events when players are removed from plots & correct calling of Member & Trusted events
2016-08-26 02:02:40 +10:00
2806f8b20c Fixes #1307 2016-08-26 01:36:35 +10:00
7d11147836 Add Lazzy "Offline -> Offline Lowercase" conversion 2016-08-20 21:40:54 +10:00
74a6df1fa7 Update README.md 2016-08-20 00:26:53 -04:00
bc0c0abe7e Fix NPE 2016-08-19 12:16:13 +10:00
56907e4580 Version Bump
3.4.6-SNAPSHOT
2016-08-18 10:38:06 -04:00
005e13a216 Maybe #1239 2016-08-17 18:30:58 +10:00
3558105789 Fix default flags NPE 2016-08-17 15:08:01 +10:00
f651607d2f Might work? 2016-08-17 12:22:45 +10:00
6b95e57d9e Merge pull request #1313 from MinelinkNetwork/blocked-cmds
Only show blocked-cmds message when event is cancelled
2016-08-17 12:13:27 +10:00
98d0819383 Only show blocked-cmds message when event is cancelled 2016-08-16 19:09:02 -07:00
30da060f83 Potential fix for schematic placement on clear 2016-08-16 15:53:26 +10:00
e4408d56ec *And this 2016-08-16 14:32:31 +10:00
f07ac646f3 Possible fix for greeting spam 2016-08-15 09:31:03 +10:00
ef3380dc0a Merge remote-tracking branch 'origin/master' 2016-08-12 15:04:18 -04:00
749ab83e5d Move permission check out of loop
See #1307
2016-08-12 15:04:11 -04:00
daea9cf60d Allow teleportation for console 2016-08-10 12:33:18 +10:00
2f74368879 Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2016-08-09 12:45:45 -04:00
63d4476d97 Fix #1181 2016-08-09 12:40:38 -04:00
db69da5b07 *Wrong runnable 2016-08-09 08:52:31 +10:00
634802ef98 Got rid of that auto-optimize-imports option 2016-08-08 23:20:31 +02:00
37e4a652dd Now calling the respective events when a user is removed from a plot.
And switched the event calling of adding Helpers and Trusted players. (Correct me if that was wrong)
2016-08-08 22:45:08 +02:00
d22f7b8781 Merge remote-tracking branch 'origin/master' 2016-08-08 14:03:17 -04:00
112da17614 Squashed commit of the following:
commit 91c78407cd
Author: Jesse Boyd <jessepaleg@gmail.com>
Date:   Sun Aug 7 11:29:59 2016 +1000

    Use a queue for expiry

commit 395d6364be
Author: Jesse Boyd <jessepaleg@gmail.com>
Date:   Sun Aug 7 04:43:41 2016 +1000

    Cache on fail as well

commit facd43700d
Author: Jesse Boyd <jessepaleg@gmail.com>
Date:   Sun Aug 7 04:00:50 2016 +1000

    Cache entity count every second

commit 1ae694ff5b
Author: Jesse Boyd <jessepaleg@gmail.com>
Date:   Sun Aug 7 03:52:37 2016 +1000

    Tweak entity counting

commit c99dd1e74a
Author: Jesse Boyd <jessepaleg@gmail.com>
Date:   Sat Aug 6 00:10:11 2016 +1000

    Needs sponge builds

commit f408ac82be
Author: Alexander Söderberg <Sauilitired@users.noreply.github.com>
Date:   Fri Aug 5 12:13:39 2016 +0200

    Update README.md

commit 9b95990ba6
Author: Alexander Söderberg <Sauilitired@users.noreply.github.com>
Date:   Thu Aug 4 16:50:37 2016 +0200

    Update this here as well
2016-08-08 14:02:25 -04:00
91c78407cd Use a queue for expiry 2016-08-07 11:29:59 +10:00
395d6364be Cache on fail as well 2016-08-07 04:43:41 +10:00
facd43700d Cache entity count every second 2016-08-07 04:00:50 +10:00
1ae694ff5b Tweak entity counting 2016-08-07 03:52:37 +10:00
c99dd1e74a Needs sponge builds 2016-08-06 00:10:11 +10:00
f408ac82be Update README.md 2016-08-05 12:13:39 +02:00
9b95990ba6 Update this here as well 2016-08-04 16:50:37 +02:00
77fb329c9e Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2016-07-31 21:26:18 -04:00
a13b9fb31b flag tix 2016-08-01 11:20:06 +10:00
ea3306d070 Fix #1034 2016-07-31 20:17:35 -04:00
bcbcd6d916 Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2016-07-31 18:14:12 +10:00
415c6fb0d4 Fixes #1283 2016-07-31 18:14:06 +10:00
e801c6d7e8 Merge branch '3.4.5' 2016-07-31 00:16:37 -04:00
409456e895 Minor sponge fix 2016-07-31 09:16:58 +10:00
e8f4eae6f7 Merge remote-tracking branch 'origin/3.4.5' into 3.4.5
# Conflicts:
#	Sponge/build.gradle
#	Sponge/src/main/java/com/plotsquared/sponge/util/SpongeSetupUtils.java
2016-07-29 21:45:34 -04:00
c8419f4a4a Added more Java 8 warnings 2016-07-29 21:40:23 -04:00
09994724db Fix #1277 2016-07-29 21:40:02 -04:00
610e204d12 Fix #1281 , Fix #1282 , and Sponge gradle 2016-07-29 12:47:42 -04:00
1f341e6ba9 Merge remote-tracking branch 'origin/master' into 3.4.5
# Conflicts:
#	Sponge/src/main/java/com/plotsquared/sponge/SpongeMain.java
#	Sponge/src/main/java/com/plotsquared/sponge/generator/SpongeAugmentedGenerator.java
#	Sponge/src/main/java/com/plotsquared/sponge/util/SpongeSetupUtils.java
#	Sponge/src/main/java/com/plotsquared/sponge/util/SpongeUtil.java
#	Sponge/src/main/java/com/plotsquared/sponge/util/block/GenChunk.java
#	build.gradle
2016-07-29 12:25:11 -04:00
ffddf5c187 Fix sponge generator cast 2016-07-29 12:12:28 +10:00
b5ec6232f9 Sponge Fixes and minor changes. 2016-07-25 22:25:15 -04:00
34c2da55ca Change Sponge method behavior 2016-07-25 22:25:15 -04:00
33ec80c2cb Fix Sponge generation casting 2016-07-25 22:25:15 -04:00
48064da1ee Fixed deny-teleport flag 2016-07-25 22:25:15 -04:00
adc021109f Added Polar Bear where missing 2016-07-25 22:25:15 -04:00
d23d8c2fd8 *should use this cause instead 2016-07-25 22:25:15 -04:00
3498f309e8 Minor sponge fixes 2016-07-25 22:24:31 -04:00
0b5177f192 Minor uuid cache changes 2016-07-25 22:23:49 -04:00
07dc6a46fb Remove metrics depend 2016-07-25 22:23:19 -04:00
0b19cc7d9d Possible fix + add guest-gamemode flag 2016-07-25 22:23:19 -04:00
4e019ab796 UUID cache changes 2016-07-25 22:23:19 -04:00
b2fdcad317 Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared into 3.4.5
# Conflicts:
#	Sponge/src/main/java/com/plotsquared/sponge/util/SpongeUtil.java
#	Sponge/src/main/java/com/plotsquared/sponge/util/block/GenChunk.java
2016-07-25 22:08:54 -04:00
80ea3e9ce7 Sponge Fixes and minor changes. 2016-07-25 20:00:59 -04:00
5f8c77a6cd Change Sponge method behavior 2016-07-25 18:43:11 -04:00
290e5c68dc Fix Sponge generation casting 2016-07-25 18:42:31 -04:00
5d92701100 Fixed deny-teleport flag 2016-07-25 18:04:17 -04:00
1a86d5fb9e Added Polar Bear where missing 2016-07-25 01:19:29 -04:00
30d18c917d *should use this cause instead 2016-07-25 09:54:35 +10:00
b91eab2f0c Minor sponge fixes 2016-07-25 09:47:49 +10:00
770b9be160 Minor uuid cache changes 2016-07-25 09:23:20 +10:00
14b2b11bf3 Remove metrics depend 2016-07-25 08:09:57 +10:00
975a5765c1 Possible fix + add guest-gamemode flag 2016-07-25 08:02:17 +10:00
2b9c2959cf Merge branch '3.4.5' of https://github.com/IntellectualSites/PlotSquared into 3.5.0 2016-07-24 17:45:34 -04:00
07977ac2ce UUID cache changes 2016-07-25 07:44:47 +10:00
9e5ac80435 Merge remote-tracking branch 'origin/3.4.5' into 3.4.5 2016-07-24 17:42:21 -04:00
dda6849412 Fix sponge compile 2016-07-24 17:42:03 -04:00
85d6e42462 Merge branch '3.4.5' of https://github.com/IntellectualSites/PlotSquared into 3.5.0 2016-07-24 17:27:41 -04:00
b1ee223b0a Merge pull request #1271 from manuelgu/patch-1
Make debug output useful
2016-07-24 07:51:45 +02:00
98e865cdf0 Make debug output useful 2016-07-23 12:50:39 +02:00
8b084839fd Fix #1261 2016-07-19 10:22:50 -04:00
c1d4c481fb Fix #1244 2016-07-17 23:20:31 -04:00
269e409e3e Version Bump 2016-07-17 23:19:37 -04:00
8538170cba Metrics 2016-07-16 22:51:49 -04:00
76bce7c0ef Catch CommandException 2016-07-14 20:29:11 +10:00
ba568a3f60 Recover from invalid flag value 2016-07-14 00:28:46 +10:00
a43430b722 Fix NPE for null arg 2016-07-13 00:14:26 +10:00
e2c57cea52 . 2016-07-12 23:56:59 +10:00
ca776b2912 Fixes #1226 2016-07-12 22:12:14 +10:00
e859a7f56c Change to interact perm, not build 2016-07-11 20:27:25 +10:00
ad2db9b836 Merge pull request #1245 from manuelgu/fix/CentreCenterName
Add additional alias for /p middle
2016-07-10 22:58:54 +10:00
279084b043 Add additional alias for /p middle
http://grammarist.com/spelling/center-centre/
2016-07-09 09:18:55 +02:00
8b0e59209c Remove getServerName() 2016-07-05 23:43:08 -04:00
ca8b82dcbe Version Bump 2016-07-05 23:39:38 -04:00
cf5d2a5e86 Entity Fix and Gradle changes 2016-07-01 17:13:49 -04:00
b9ad75ad84 Add teleport flag 2016-06-29 21:22:55 +10:00
185352d3cf Fixes #1229 2016-06-29 15:23:10 +10:00
f4fe762135 * 2016-06-28 20:21:50 +10:00
06682b18a5 Fix compile
Recover on unknown command error
Fixes #1224
Close #1213 (fixed elsewhere)
Fixes #1212
2016-06-28 19:55:51 +10:00
f8e97f14d6 Fix end crystal spawn cap 2016-06-28 02:03:23 +10:00
a579df00db Merge remote-tracking branch 'origin/master' 2016-06-27 10:14:28 -04:00
29a0b68dcb Fix currently online for seen info. 2016-06-27 23:59:38 +10:00
d2581bf38b Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared 2016-06-27 09:58:17 -04:00
817a5bc16e Various
Fix compatibility with bukkit 1.5
Recover on failed fancy message initialization
Fix /2 remove *
2016-06-27 18:38:14 +10:00
047f9a75b9 Fix #1222 2016-06-27 17:45:19 +10:00
96d0bb0e5e bump pom version 2016-06-26 17:08:54 +10:00
7da0b9877f Fixes #1221 (the NPE at least) 2016-06-26 17:07:46 +10:00
f20ef15774 Revert creature spawn message + change expire to seen 2016-06-26 04:30:12 +10:00
3a973342ae Merge remote-tracking branch 'origin/master' 2016-06-24 10:59:18 -04:00
6e25aab51f Cleanup some docs. 2016-06-24 10:56:38 -04:00
a49492aae3 Fix roadregen 2016-06-24 16:16:22 +10:00
dbe965e901 init script engine on get 2016-06-24 15:41:34 +10:00
2c82d1106a Fixed kick message 2016-06-23 23:19:02 -04:00
5b9dc59abf Updates to docs, code style tweaks, and some code optimizations 2016-06-23 20:12:17 -04:00
b587b430b8 #1211 2016-06-24 05:30:26 +10:00
8fd2599686 Fixes #1211 2016-06-24 02:20:21 +10:00
56000d60e7 Just in case 2016-06-23 13:14:29 +10:00
1643399fc6 Alternatives for setowner none if the username is taken 2016-06-23 13:11:26 +10:00
532fd09800 Merge remote-tracking branch 'origin/master' 2016-06-22 23:10:15 -04:00
e6387419f7 Potential fix for plot biome (untested) 2016-06-23 13:09:56 +10:00
30d49880b6 Fix #1208 NPE 2016-06-22 16:31:04 -04:00
16d191db2c Fixes /plot kick * 2016-06-23 04:08:06 +10:00
7dc7714261 Update Gradle to 2.14 2016-06-22 12:31:25 -04:00
9e1f6d8748 Closes #1209 2016-06-22 13:33:32 +10:00
7fb2631421 Cast to string if necessary 2016-06-21 14:23:04 +10:00
718831e8e0 * 2016-06-21 14:10:20 +10:00
df4585a847 Check args for grant 2016-06-21 13:38:08 +10:00
88d8339cfd fix other NPE 2016-06-21 13:32:28 +10:00
e08db3d12b Check teleportation on command location prefix 2016-06-21 03:02:41 +10:00
2ff4e07919 Setup border on world creation 2016-06-21 01:13:09 +10:00
f6fec56677 Potential fix for terrain 3 worlds. 2016-06-21 00:29:39 +10:00
3fabfa10d7 Add liquid-flow flag 2016-06-20 22:48:04 +10:00
a2ca9a52ea Merge pull request #1205 from manuelgu/fix/deadlink
Remove dead link
2016-06-20 18:52:35 +10:00
e5e3600206 Why were these restricted to players? 2016-06-20 18:52:00 +10:00
7ad50b6314 Remove dead link 2016-06-20 10:49:40 +02:00
01d508edf4 Fix remove * 2016-06-20 15:08:56 +10:00
988 changed files with 88657 additions and 68733 deletions

1013
.editorconfig Normal file

File diff suppressed because it is too large Load Diff

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 updated 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.18.2'
- '1.18.1'
- '1.18'
- '1.17.1'
- '1.16.5'
- '1.15.2'
- '1.14.4'
- '1.13.2'
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.

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

@ -0,0 +1,42 @@
name: build
on: [ pull_request, push ]
jobs:
build:
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Validate Gradle Wrapper"
uses: gradle/wrapper-validation-action@v1
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Clean Build
run: ./gradlew clean build
- 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 }}

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

@ -0,0 +1,37 @@
name: "CodeQL"
on:
push:
branches: [ v6 ]
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@v2
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

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

@ -0,0 +1,19 @@
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 }}

269
.gitignore vendored
View File

@ -1,134 +1,137 @@
### Others ###
*.bat
*.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
### 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/
# 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/
checkstyle.xml
classes/
*.bat
docs/
build/

4
.lift.toml Normal file
View File

@ -0,0 +1,4 @@
jdkVersion = "17"
build = "gradle clean build -x test"
tools = ["findsecbugs", "ErrorProne", "Semgrep", "Detekt", "Infer"]
ignoreRules = ["CatchAndPrintStackTrace", "ReferenceEquality", "FallThrough", "FutureReturnValueIgnored", "MixedMutabilityReturnType", "EmptyCatch", "MissingCasesInEnumSwitch", "OperatorPrecedence", "StaticAssignmentInConstructor", "ReferenceEquality", "EqualsHashCode", "EqualsGetClass", "TypeParameterUnusedInFormals", "StringSplitter", "InlineMeSuggester", "NULL_DEREFERENCE"]

View File

@ -1,38 +0,0 @@
dependencies {
compile project(':Core')
compile 'org.bukkit:bukkit:1.10-R0.1-SNAPSHOT'
compile 'org.mcstats.bukkit:metrics:R7'
compile 'net.milkbowl.vault:VaultAPI:1.6'
}
sourceCompatibility = 1.7
targetCompatibility = 1.7
processResources {
from('src/main/resources') {
include 'plugin.yml'
expand(
name: project.parent.name,
version: project.parent.version
)
}
}
apply plugin: 'com.github.johnrengelman.shadow'
// We only want the shadow jar produced
jar.enabled = false
shadowJar {
dependencies {
include(dependency(':Core'))
include(dependency('org.mcstats.bukkit:metrics:R7'))
}
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);

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

@ -0,0 +1,105 @@
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://papermc.io/repo/repository/maven-public/")
}
maven {
name = "EssentialsX"
url = uri("https://repo.essentialsx.net/releases/")
}
}
dependencies {
api(projects.plotSquaredCore)
// Metrics
implementation(libs.bstats)
// Paper
compileOnly(libs.paper)
implementation(libs.paperlib)
// Plugins
compileOnly(libs.worldeditBukkit) {
exclude(group = "org.bukkit")
exclude(group = "org.spigotmc")
}
compileOnly(libs.fastasyncworldeditBukkit) { isTransitive = false }
testImplementation(libs.fastasyncworldeditBukkit) { isTransitive = false }
compileOnly(libs.vault) {
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(libs.serverlib)
// Our libraries
implementation(libs.arkitektonika)
implementation(libs.http4j)
implementation(libs.paster)
// Adventure
implementation(libs.adventurePlatformBukkit)
}
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.google.code.findbugs", "com.plotsquared.core.findbugs")
relocate("javax.inject", "com.plotsquared.core.annotation.inject")
// Get rid of all the libs which are 100% unused.
minimize()
mergeServiceFiles()
}
tasks {
withType<Javadoc> {
val opt = options as StandardJavadocDocletOptions
opt.links("https://papermc.io/javadocs/paper/1.18/")
opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-bukkit/" + libs.worldeditBukkit.get().versionConstraint.toString())
opt.links("https://javadoc.io/doc/com.plotsquared/PlotSquared-Core/latest/")
opt.links("https://jd.adventure.kyori.net/api/" + libs.adventure.get().versionConstraint.toString())
opt.links("https://google.github.io/guice/api-docs/" + libs.guice.get().versionConstraint.toString() + "/javadoc/")
opt.links("https://checkerframework.org/api/")
}
}

View File

@ -1,732 +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 java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import org.bukkit.Location;
import org.bukkit.OfflinePlayer;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
/**
* 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());
}
/**
* Register a flag for use in plots.
*
* @param flag the flag being registered
*
*/
public void addFlag(Flag<?> flag) {
Flags.registerFlag(flag);
}
/**
* Get 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");
}
/**
* Get the PlotSquared class.
*
* @return PlotSquared Class
*
* @see PS
*/
public PS getPlotSquared() {
return PS.get();
}
/**
* Get 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());
}
/**
* Get 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());
}
/**
* Get the numbers 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();
}
/**
* Get 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,93 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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,667 +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.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.ForceFieldListener;
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.BukkitPlainChatManager;
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.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 java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.UUID;
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.java.JavaPlugin;
public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
public static WorldEdit worldEdit;
private int[] version;
@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, 9, 2};
}
}
return this.version;
}
@Override
public void onEnable() {
new PS(this, "Bukkit");
}
@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 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 ENDER_CRYSTAL:
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:
// managed elsewhere | projectile
continue;
case ITEM_FRAME:
case PAINTING:
// Not vehicles
continue;
case ARMOR_STAND:
// Tempirarily classify as vehicle
case MINECART:
case MINECART_CHEST:
case MINECART_COMMAND:
case MINECART_FURNACE:
case MINECART_HOPPER:
case MINECART_MOB_SPAWNER:
case MINECART_TNT:
case BOAT: {
if (!Settings.Enabled_Components.KILL_ROAD_VEHICLES) {
continue;
}
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;
}
case SMALL_FIREBALL:
case FIREBALL:
case DRAGON_FIREBALL:
case DROPPED_ITEM:
// dropped item
continue;
case PRIMED_TNT:
case FALLING_BLOCK:
// managed elsewhere
continue;
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) {
continue;
}
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) {
HybridGen result = new HybridGen();
if (!PS.get().setupPlotWorld(world, id, result)) {
return null;
}
return (ChunkGenerator) result.specify();
}
@Override
public void registerPlayerEvents() {
PlayerEvents main = new PlayerEvents();
getServer().getPluginManager().registerEvents(main, this);
if (PS.get().checkVersion(getServerVersion(), 1, 8, 0)) {
try {
getServer().getPluginManager().registerEvents(new PlayerEvents_1_8(), this);
} catch (Throwable e) {
e.printStackTrace();
}
}
if (PS.get().checkVersion(getServerVersion(), 1, 8, 3)) {
try {
getServer().getPluginManager().registerEvents(new PlayerEvents183(), this);
} catch (Throwable e) {
e.printStackTrace();
}
}
if (PS.get().checkVersion(getServerVersion(), 1, 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() {
getServer().getPluginManager().registerEvents(new ForceFieldListener(), this);
}
@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) {
e.printStackTrace();
MainUtil.canSendChunk = false;
}
if (PS.get().checkVersion(getServerVersion(), 1, 9, 0)) {
return QueueProvider.of(BukkitLocalQueue_1_9.class, BukkitLocalQueue.class);
}
if (PS.get().checkVersion(getServerVersion(), 1, 8, 3)) {
return QueueProvider.of(BukkitLocalQueue_1_8_3.class, BukkitLocalQueue.class);
}
if (PS.get().checkVersion(getServerVersion(), 1, 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() {
TaskManager.runTaskLaterAsync(new Runnable() {
@Override
public void run() {
if (new LikePlotMeConverter("PlotMe").run(new ClassicPlotMeConnector())) {
return;
}
if (new LikePlotMeConverter("PlotMe").run(new PlotMeConnector_017())) {
return;
}
}
}, 20);
return Bukkit.getPluginManager().getPlugin("PlotMe") != null;
}
@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(new HybridGen());
}
}
@Override
public HybridUtils initHybridUtils() {
return new BukkitHybridUtils();
}
@Override
public SetupUtils initSetupUtils() {
return new BukkitSetupUtils();
}
@Override
public UUIDHandlerImplementation initUUIDHandler() {
boolean checkVersion = PS.get().checkVersion(getServerVersion(), 1, 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
+ " &6PlotSquared 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 + " &6PlotSquared 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 InventoryUtil initInventoryUtil() {
return new BukkitInventoryUtil();
}
@Override
public String getServerName() {
return Bukkit.getServerName();
}
@Override
public void startMetrics() {
Metrics metrics = new Metrics(this);
metrics.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", "PlotSquared");
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);
} else {
try {
if (!PS.get().hasPlotArea(worldName)) {
SetGenCB.setGenerator(BukkitUtil.getWorld(worldName));
}
} catch (Exception ignored) {
PS.log("Failed to reload world: " + world);
Bukkit.getServer().unloadWorld(world, false);
}
}
world = Bukkit.getWorld(worldName);
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 BukkitPlainChatManager();
}
}
@Override
public GeneratorWrapper<?> wrapPlotGenerator(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,887 +0,0 @@
package com.plotsquared.bukkit.chat;
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 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;
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 static com.plotsquared.bukkit.chat.TextualComponent.rawText;
/**
* 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<MessagePart>(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));
}
public FancyMessage(final com.plotsquared.bukkit.chat.TextualComponent firstPartText) {
messageParts = new ArrayList<MessagePart>();
messageParts.add(new MessagePart(firstPartText));
jsonString = null;
dirty = false;
if (nmsPacketPlayOutChatConstructor == null) {
try {
nmsPacketPlayOutChatConstructor = com.plotsquared.bukkit.chat.Reflection.getNMSClass("PacketPlayOutChat").getDeclaredConstructor(com.plotsquared.bukkit.chat.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((com.plotsquared.bukkit.chat.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(com.plotsquared.bukkit.chat.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 = com.plotsquared.bukkit.chat.Reflection.getMethod(com.plotsquared.bukkit.chat.Reflection.getOBCClass("CraftStatistic"), "getNMSAchievement", Achievement.class).invoke(null, which);
return achievementTooltip((String) com.plotsquared.bukkit.chat.Reflection.getField(com.plotsquared.bukkit.chat.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 occured durring 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 = com.plotsquared.bukkit.chat.Reflection.getMethod(com.plotsquared.bukkit.chat.Reflection.getOBCClass("CraftStatistic"), "getNMSStatistic", Statistic.class).invoke(null, which);
return achievementTooltip((String) com.plotsquared.bukkit.chat.Reflection.getField(com.plotsquared.bukkit.chat.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 occured durring 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 = com.plotsquared.bukkit.chat.Reflection.getMethod(com.plotsquared.bukkit.chat.Reflection.getOBCClass("CraftStatistic"), "getMaterialStatistic", Statistic.class, Material.class).invoke(null, which, item);
return achievementTooltip((String) com.plotsquared.bukkit.chat.Reflection.getField(com.plotsquared.bukkit.chat.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 occured durring 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 = com.plotsquared.bukkit.chat.Reflection.getMethod(com.plotsquared.bukkit.chat.Reflection.getOBCClass("CraftStatistic"), "getEntityStatistic", Statistic.class, EntityType.class).invoke(null, which, entity);
return achievementTooltip((String) com.plotsquared.bukkit.chat.Reflection.getField(com.plotsquared.bukkit.chat.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 occured durring 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 = com.plotsquared.bukkit.chat.Reflection.getMethod(com.plotsquared.bukkit.chat.Reflection.getOBCClass("inventory.CraftItemStack"), "asNMSCopy", ItemStack.class).invoke(null, itemStack);
return itemTooltip(com.plotsquared.bukkit.chat.Reflection.getMethod(com.plotsquared.bukkit.chat.Reflection.getNMSClass("ItemStack"), "save", com.plotsquared.bukkit.chat.Reflection.getNMSClass("NBTTagCompound")).invoke(nmsItem, com.plotsquared.bukkit.chat.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 com.plotsquared.bukkit.chat.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 = com.plotsquared.bukkit.chat.Reflection.getHandle(player);
Object connection = com.plotsquared.bukkit.chat.Reflection.getField(handle.getClass(), "playerConnection").get(handle);
com.plotsquared.bukkit.chat.Reflection.getMethod(connection.getClass(), "sendPacket", com.plotsquared.bukkit.chat.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 occured durring 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 = com.plotsquared.bukkit.chat.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 = com.plotsquared.bukkit.chat.Reflection.getNMSClass("ChatSerializer");
} else {
chatSerializerClazz = com.plotsquared.bukkit.chat.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, com.plotsquared.bukkit.chat.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<String, Object>();
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 (com.plotsquared.bukkit.chat.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<String, Object>(); // 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 = com.plotsquared.bukkit.chat.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 java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import com.google.gson.stream.JsonWriter;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
/**
* 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,155 +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<ChatColor>();
String clickActionName = null, clickActionData = null, hoverActionName = null;
JsonRepresentedObject hoverActionData = null;
TextualComponent text = null;
String insertionData = null;
ArrayList<JsonRepresentedObject> translationReplacements = new ArrayList<JsonRepresentedObject>();
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<String, Object>();
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,218 +0,0 @@
package com.plotsquared.bukkit.chat;
import org.bukkit.Bukkit;
import java.lang.reflect.Field;
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 {
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;
}
/**
* Stores loaded classes from the {@code net.minecraft.server} package.
*/
private static final Map<String, Class<?>> _loadedNMSClasses = new HashMap<String, Class<?>>();
/**
* Stores loaded classes from the {@code org.bukkit.craftbukkit} package (and subpackages).
*/
private static final Map<String, Class<?>> _loadedOBCClasses = new HashMap<String, Class<?>>();
/**
* 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 = null;
try {
clazz = Class.forName(fullName);
} catch (Exception e) {
e.printStackTrace();
_loadedNMSClasses.put(className, null);
return null;
}
_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 = null;
try {
clazz = Class.forName(fullName);
} catch (Exception e) {
e.printStackTrace();
_loadedOBCClasses.put(className, null);
return null;
}
_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) {
try {
return getMethod(obj.getClass(), "getHandle").invoke(obj);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
private static final Map<Class<?>, Map<String, Field>> _loadedFields = new HashMap<Class<?>, Map<String, Field>>();
/**
* 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<String, Field>();
_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 (Exception e) {
// Error loading
e.printStackTrace();
// Cache field as not existing
loaded.put(name, null);
return null;
}
}
/**
* 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<Class<?>, Map<String, Map<ArrayWrapper<Class<?>>, Method>>>();
/**
* 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>
* <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>
* <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<Class<?>>(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,297 +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);
}
@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;
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 && ((ComplexTextTypeComponent) component).getKey().equals("translate");
}
/**
* 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 {
public ArbitraryTextTypeComponent(String key, String value) {
setKey(key);
setValue(value);
}
@Override
public String getKey() {
return _key;
}
public void setKey(String key) {
Preconditions.checkArgument(key != null && !key.isEmpty(), "The key must be specified.");
_key = key;
}
public String getValue() {
return _value;
}
public void setValue(String value) {
Preconditions.checkArgument(value != null, "The value must be specified.");
_value = value;
}
private String _key;
private String _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());
}
@SuppressWarnings("serial")
public Map<String, Object> serialize() {
return new HashMap<String, Object>() {{
put("key", getKey());
put("value", getValue());
}};
}
public static ArbitraryTextTypeComponent deserialize(Map<String, Object> map) {
return new ArbitraryTextTypeComponent(map.get("key").toString(), map.get("value").toString());
}
@Override
public String getReadableString() {
return getValue();
}
}
/**
* Internal class used to represent a text component with a nested JSON value.
* Exception validating done is on keys and values.
*/
private static final class ComplexTextTypeComponent extends TextualComponent implements ConfigurationSerializable {
public ComplexTextTypeComponent(String key, Map<String, String> values) {
setKey(key);
setValue(values);
}
@Override
public String getKey() {
return _key;
}
public void setKey(String key) {
Preconditions.checkArgument(key != null && !key.isEmpty(), "The key must be specified.");
_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.");
_value = value;
}
private String _key;
private Map<String, String> _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 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();
}
@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());
}
}};
}
public static ComplexTextTypeComponent deserialize(Map<String, Object> map) {
String key = null;
Map<String, String> value = new HashMap<String, String>();
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(((String) valEntry.getKey()).substring(6) /* Strips out the value prefix */, valEntry.getValue().toString());
}
}
return new ComplexTextTypeComponent(key, value);
}
@Override
public String getReadableString() {
return getKey();
}
}
/**
* Create a textual component representing a string literal.
* 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>
* </p>
*
* @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);
}
}

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("PlotSquared 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.getName();
// 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(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;
private String prefix;
@Override
public Connection getPlotMeConnection(FileConfiguration plotConfig, String dataFolder) {
this.plugin = this.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,351 +0,0 @@
package com.plotsquared.bukkit.database.plotme;
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.generator.HybridGen;
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 org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.WorldCreator;
import org.bukkit.command.CommandException;
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.Map.Entry;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
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->&3PlotSquared&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);
content = content.replace("PlotMe-DefaultGenerator", "PlotSquared");
content = content.replace("PlotMe", "PlotSquared");
content = content.replace("AthionPlots", "PlotSquared");
content = content.replace("PlotZWorld", "PlotSquared");
Files.write(path, content.getBytes(StandardCharsets.UTF_8));
} catch (IOException ignored) {}
}
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(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 'plotme-convert.enabled' 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 {
for (String world : plots.keySet()) {
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 pathHeight = plotmeDgYml.getInt("worlds." + plotMeWorldName + ".RoadHeight", 64); //
PS.get().worlds.set("worlds." + world + ".road.height", pathHeight);
PS.get().worlds.set("worlds." + world + ".wall.height", pathHeight);
PS.get().worlds.set("worlds." + world + ".plot.height", pathHeight);
int plotSize = plotmeDgYml.getInt("worlds." + plotMeWorldName + ".PlotSize", 32); //
PS.get().worlds.set("worlds." + world + ".plot.size", plotSize);
String wallblock = plotmeDgYml.getString("worlds." + plotMeWorldName + ".WallBlock", "44"); //
PS.get().worlds.set("worlds." + world + ".wall.block", wallblock);
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);
int height = plotmeDgYml.getInt("worlds." + plotMeWorldName + ".RoadHeight"); //
if (height == 0) {
height = plotmeDgYml.getInt("worlds." + plotMeWorldName + ".GroundHeight", 64); //
}
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);
}
} catch (IOException ignored) {}
}
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-convert.enabled' 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);
}
String actualWorldName = world.getName();
sendMessage("Reloading generator for world: '" + actualWorldName + "'...");
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 PlotSquared");
} 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:PlotSquared");
} else {
// Load using Bukkit API
// - User must set generator manually
Bukkit.getServer().unloadWorld(world, true);
World myWorld = WorldCreator.name(actualWorldName).generator(new BukkitPlotGenerator(new HybridGen())).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-convert.enabled' 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(FileConfiguration plotConfig, String dataFolder) {
this.plugin = 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 {
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 = !this.plugin.equals("plotme") && 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,34 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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,41 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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,38 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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,94 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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,38 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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,54 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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,6 +1,33 @@
package com.plotsquared.bukkit.object.entity;
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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.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;
@ -8,25 +35,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;
@ -35,18 +58,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;
@ -59,22 +81,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();
@ -86,73 +104,65 @@ public class EntityWrapper {
if (depth == 1) {
return;
}
if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), 1, 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(), 1, 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());
@ -164,68 +174,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();
@ -272,38 +289,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 {
@ -345,31 +370,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(), 1, 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) {
entity.getInventory().setContents(this.inventory);
try {
entity.getInventory().setContents(this.inventory);
} catch (IllegalArgumentException e) {
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();
@ -381,9 +409,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;
@ -393,13 +421,8 @@ public class EntityWrapper {
}
void storeEquipment(EntityEquipment equipment) {
if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), 1, 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();
@ -438,28 +461,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) {
@ -467,8 +492,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);
@ -483,102 +509,99 @@ public class EntityWrapper {
if (this.depth == 1) {
return entity;
}
if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), 1, 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(), 1, 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);
@ -589,36 +612,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) {
@ -637,27 +649,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) {
@ -674,47 +700,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)) {
@ -724,9 +766,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,35 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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,123 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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,77 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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.IndependentPlotGenerator;
import com.plotsquared.core.location.ChunkWrapper;
import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.queue.QueueCoordinator;
import com.plotsquared.core.queue.ScopedQueueCoordinator;
import com.sk89q.worldedit.bukkit.BukkitWorld;
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 BlockStatePopulator extends BlockPopulator {
private final IndependentPlotGenerator plotGenerator;
private final PlotAreaManager plotAreaManager;
private QueueCoordinator queue;
public BlockStatePopulator(
final @NonNull IndependentPlotGenerator plotGenerator,
final @NonNull PlotAreaManager plotAreaManager
) {
this.plotGenerator = plotGenerator;
this.plotAreaManager = plotAreaManager;
}
@Override
public void populate(final @NonNull World world, final @NonNull Random random, final @NonNull Chunk source) {
if (this.queue == null) {
this.queue = PlotSquared.platform().globalBlockQueue().getNewQueue(new BukkitWorld(world));
}
final PlotArea area = this.plotAreaManager.getPlotArea(world.getName(), null);
if (area == null) {
return;
}
final ChunkWrapper wrap = new ChunkWrapper(area.getWorldName(), source.getX(), source.getZ());
final ScopedQueueCoordinator chunk = this.queue.getForChunk(wrap.x, wrap.z,
com.plotsquared.bukkit.util.BukkitWorld.getMinWorldHeight(world),
com.plotsquared.bukkit.util.BukkitWorld.getMaxWorldHeight(world) - 1
);
if (this.plotGenerator.populateChunk(chunk, area)) {
this.queue.enqueue();
}
}
}

View File

@ -1,14 +1,40 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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.generator.AugmentedUtils;
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 +51,8 @@ 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) {
AugmentedUtils.generate(source, world.getName(), source.getX(), source.getZ(), null);
}
}

View File

@ -1,229 +1,125 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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.HybridGen;
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 java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
import java.util.Set;
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;
public class BukkitPlotGenerator extends ChunkGenerator implements GeneratorWrapper<ChunkGenerator> {
private final GenChunk chunkSetter;
private final PseudoRandom random = new PseudoRandom();
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.Set;
public class BukkitPlotGenerator extends ChunkGenerator
implements GeneratorWrapper<ChunkGenerator> {
@SuppressWarnings("unused")
public final boolean PAPER_ASYNC_SAFE = true;
private final PlotAreaManager plotAreaManager;
private final IndependentPlotGenerator plotGenerator;
private final List<BlockPopulator> populators = new ArrayList<>();
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;
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.populators = new ArrayList<>();
this.populators.add(new BlockStatePopulator(this.plotGenerator, this.plotAreaManager));
this.full = true;
MainUtil.initCache();
}
public BukkitPlotGenerator(final String world, final ChunkGenerator cg) {
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!");
throw new IllegalArgumentException("ChunkGenerator: " + cg.getClass().getName()
+ " is already a BukkitPlotGenerator!");
}
this.plotAreaManager = plotAreaManager;
this.levelName = world;
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 new HybridGen().getNewPlotManager();
}
@Override
public String getName() {
return cg.getClass().getName();
}
@Override
public PlotArea getNewPlotArea(String world, String id, PlotId min, PlotId max) {
return new HybridGen().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));
if (cg != null) {
this.populators.addAll(cg.getDefaultPopulators(BukkitUtil.getWorld(world)));
}
MainUtil.initCache();
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);
PlotSquared.get().loadWorld(name, this);
final Set<PlotArea> areas = this.plotAreaManager.getPlotAreasSet(name);
if (!areas.isEmpty()) {
PlotArea area = areas.iterator().next();
if (!area.MOB_SPAWNING) {
if (!area.SPAWN_EGGS) {
if (!area.isMobSpawning()) {
if (!area.isSpawnEggs()) {
world.setSpawnFlags(false, false);
}
world.setAmbientSpawnLimit(0);
@ -245,101 +141,114 @@ public class BukkitPlotGenerator extends ChunkGenerator implements GeneratorWrap
}
ArrayList<BlockPopulator> toAdd = new ArrayList<>();
List<BlockPopulator> existing = world.getPopulators();
for (BlockPopulator populator : this.populators) {
if (!existing.contains(populator)) {
toAdd.add(populator);
if (populators == null && platformGenerator != null) {
populators = new ArrayList<>(platformGenerator.getDefaultPopulators(world));
}
if (populators != null) {
for (BlockPopulator populator : this.populators) {
if (!existing.contains(populator)) {
toAdd.add(populator);
}
}
}
return toAdd;
}
@Override
public ChunkData generateChunkData(World world, Random random, int cx, int cz, BiomeGrid grid) {
GenChunk result = (GenChunk) 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);
PlotSquared.get().loadWorld(name, this);
this.loaded = true;
}
// 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 = (GenChunk) 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) {
@ -351,12 +260,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,108 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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
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,56 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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,155 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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,50 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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,50 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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,182 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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 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.UUID;
@SuppressWarnings("unused")
public class BlockEventListener117 implements Listener {
@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;
}
Plot plot = location.getOwnedPlot();
if (plot == null || !plot.getFlag(MiscInteractFlag.class)) {
if (entity instanceof Player player) {
BukkitPlayer plotPlayer = BukkitUtil.adapt(player);
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 (!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 = BukkitUtil.adapt(blocks.get(i).getLocation());
if (location.isPlotArea()) {
blocks.remove(i);
}
}
return;
} else {
Plot origin = area.getOwnedPlot(location);
if (origin == null) {
event.setCancelled(true);
return;
}
for (int i = blocks.size() - 1; i >= 0; i--) {
location = BukkitUtil.adapt(blocks.get(i).getLocation());
if (!area.contains(location.getX(), location.getZ())) {
blocks.remove(i);
continue;
}
Plot plot = area.getOwnedPlot(location);
if (!Objects.equals(plot, origin)) {
event.getBlocks().remove(i);
}
}
}
Plot origin = area.getPlot(location);
if (origin == null) {
event.setCancelled(true);
return;
}
for (int i = blocks.size() - 1; i >= 0; i--) {
location = BukkitUtil.adapt(blocks.get(i).getLocation());
Plot plot = area.getOwnedPlot(location);
if (!Objects.equals(plot, origin) && (!plot.isMerged() && !origin.isMerged())) {
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;
}
switch (event.getNewState().getType()) {
case COPPER_BLOCK:
case EXPOSED_COPPER:
case WEATHERED_COPPER:
case OXIDIZED_COPPER:
case CUT_COPPER:
case EXPOSED_CUT_COPPER:
case WEATHERED_CUT_COPPER:
case OXIDIZED_CUT_COPPER:
case CUT_COPPER_STAIRS:
case EXPOSED_CUT_COPPER_STAIRS:
case WEATHERED_CUT_COPPER_STAIRS:
case OXIDIZED_CUT_COPPER_STAIRS:
case CUT_COPPER_SLAB:
case EXPOSED_CUT_COPPER_SLAB:
case WEATHERED_CUT_COPPER_SLAB:
case OXIDIZED_CUT_COPPER_SLAB:
if (!plot.getFlag(CopperOxideFlag.class)) {
plot.debug("Copper could not oxide because copper-oxide = false");
event.setCancelled(true);
}
}
}
}

View File

@ -0,0 +1,372 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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,446 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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.Permissions;
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 "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)) {
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 (area.isRoadFlags() && area.getRoadFlag(InvincibleFlag.class)) {
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 (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) {
entity.remove();
event.setCancelled(true);
}
return;
}
if (plot.isAdded(pp.getUUID()) || Permissions
.hasPermission(pp, 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,237 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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();
if (plot == null) {
EntityType type = entity.getType();
if (!area.isMobSpawning()) {
switch (type) {
case DROPPED_ITEM:
if (Settings.Enabled_Components.KILL_ROAD_ITEMS) {
event.setCancelled(true);
return;
}
case 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);
}
switch (entity.getType()) {
case ENDER_CRYSTAL:
if (BukkitEntityUtil.checkEntity(entity, plot)) {
event.setCancelled(true);
}
case 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,133 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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.common.collect.Iterables;
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 com.plotsquared.core.util.Permissions;
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 : Iterables
.filter(player.getNearbyEntities(5d, 5d, 5d), Player.class)) {
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 : Iterables
.filter(player.getNearbyEntities(5d, 5d, 5d), Player.class)) {
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 (!Permissions
.hasPermission(oPlayer, Permission.PERMISSION_ADMIN_ENTRY_FORCEFIELD)) {
((BukkitPlayer) oPlayer).player
.setVelocity(calculateVelocity(plotPlayer, oPlayer));
}
}
} else {
PlotPlayer<?> oPlayer = hasNearbyPermitted(player, plot);
if (oPlayer == null) {
return;
}
if (!Permissions
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_ENTRY_FORCEFIELD)) {
player.setVelocity(calculateVelocity(oPlayer, plotPlayer));
}
}
}
}
}

View File

@ -0,0 +1,406 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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.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.implementations.DoneFlag;
import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.util.Permissions;
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 "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();
if (!area.isMobSpawning()) {
switch (type) {
case DROPPED_ITEM:
if (Settings.Enabled_Components.KILL_ROAD_ITEMS) {
event.setShouldAbortSpawn(true);
event.setCancelled(true);
return;
}
case 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());
if (!this.plotAreaManager.hasPlotArea(location.getWorldName())) {
return;
}
PlotPlayer<Player> pp = BukkitUtil.adapt((Player) shooter);
Plot plot = location.getOwnedPlot();
if (plot == null) {
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_ROAD)) {
pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_ROAD))
);
entity.remove();
event.setCancelled(true);
}
} else if (!plot.hasOwner()) {
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) {
pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED))
);
entity.remove();
event.setCancelled(true);
}
} else if (!plot.isAdded(pp.getUUID())) {
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER))
);
entity.remove();
event.setCancelled(true);
}
}
}
@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) {
}
}
}

View File

@ -0,0 +1,94 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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;
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,194 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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.world.PlotAreaManager;
import com.plotsquared.core.util.Permissions;
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
public void onProjectileLaunch(ProjectileLaunchEvent event) {
Projectile entity = event.getEntity();
ProjectileSource shooter = entity.getShooter();
if (!(shooter instanceof Player)) {
return;
}
Location location = BukkitUtil.adapt(entity.getLocation());
if (!this.plotAreaManager.hasPlotArea(location.getWorldName())) {
return;
}
PlotPlayer<Player> pp = BukkitUtil.adapt((Player) shooter);
Plot plot = location.getOwnedPlot();
if (plot == null) {
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_ROAD)) {
pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_ROAD))
);
entity.remove();
event.setCancelled(true);
}
} else if (!plot.hasOwner()) {
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) {
pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED))
);
entity.remove();
event.setCancelled(true);
}
} else if (!plot.isAdded(pp.getUUID())) {
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER))
);
entity.remove();
event.setCancelled(true);
}
}
}
@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) {
PlotPlayer<?> pp = BukkitUtil.adapt((Player) shooter);
if (plot == null) {
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) {
entity.remove();
event.setCancelled(true);
}
return;
}
if (plot.isAdded(pp.getUUID()) || Permissions
.hasPermission(pp, 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;
}
}
}
}

View File

@ -0,0 +1,57 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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,106 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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;
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 {
ReflectionUtils.RefClass classChunk = getRefClass("net.minecraft.world.level.chunk.Chunk");
this.shouldSave = classChunk.getField("r").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,70 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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,277 +0,0 @@
package com.plotsquared.bukkit.listeners;
import static com.intellectualcrafters.plot.util.ReflectionUtils.getRefClass;
import com.intellectualcrafters.plot.PS;
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 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 java.lang.reflect.Method;
import java.util.HashSet;
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("PlotSquared/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);
}
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();
this.mustSave.of(c).set(false);
if (chunk.isLoaded()) {
chunk.unload(false, 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 (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("[PlotSquared] &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("[PlotSquared] &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("[PlotSquared] &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("[PlotSquared] &a detected unsafe chunk and processed: " + (chunk.getX() << 4) + "," + (chunk.getX() << 4));
}
if (tiles.length > Settings.Chunk_Processor.MAX_TILES) {
if (unload) {
PS.debug("[PlotSquared] &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,100 +0,0 @@
package com.plotsquared.bukkit.listeners;
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.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.util.Vector;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
public class ForceFieldListener implements Listener {
private static Set<PlotPlayer> getNearbyPlayers(Player player, Plot plot) {
Set<PlotPlayer> players = new HashSet<>();
for (Entity entity : player.getNearbyEntities(5d, 5d, 5d)) {
PlotPlayer plotPlayer;
if (!(entity instanceof Player) || ((plotPlayer = BukkitUtil.getPlayer((Player) entity)) == 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 (Entity entity : player.getNearbyEntities(5d, 5d, 5d)) {
if (!(entity instanceof Player)) {
continue;
}
PlotPlayer plotPlayer;
if ((plotPlayer = BukkitUtil.getPlayer((Player) entity)) == null) {
continue;
}
if (!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,151 +0,0 @@
package com.plotsquared.bukkit.listeners;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C;
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 (!newLore.equals("[(+NBT)]") || (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 (!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,96 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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,70 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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,64 @@
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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.
*/
@Deprecated(forRemoval = true, since = "6.0.0")
@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,207 +0,0 @@
package com.plotsquared.bukkit.object;
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.player.PlayerTeleportEvent.TeleportCause;
import java.util.UUID;
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 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;
}

View File

@ -1,15 +0,0 @@
package com.plotsquared.bukkit.object.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

@ -1,13 +0,0 @@
package com.plotsquared.bukkit.object.entity;
class EntityBaseStats {
EntityWrapper passenger;
float fall;
short fire;
int age;
double vZ;
double vY;
double vX;
}

View File

@ -1,12 +0,0 @@
package com.plotsquared.bukkit.object.entity;
import org.bukkit.entity.Horse;
class HorseStats {
double jump;
boolean chest;
Horse.Variant variant;
Horse.Color color;
Horse.Style style;
}

View File

@ -1,28 +0,0 @@
package com.plotsquared.bukkit.object.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,9 +0,0 @@
package com.plotsquared.bukkit.object.entity;
import org.bukkit.entity.AnimalTamer;
class TameableStats {
AnimalTamer owner;
boolean tamed;
}

View File

@ -1,145 +0,0 @@
package com.plotsquared.bukkit.object.schematic;
import com.intellectualcrafters.jnbt.ByteTag;
import com.intellectualcrafters.jnbt.CompoundTag;
import com.intellectualcrafters.jnbt.ListTag;
import com.intellectualcrafters.jnbt.ShortTag;
import com.intellectualcrafters.jnbt.Tag;
import com.intellectualcrafters.plot.object.schematic.ItemType;
import com.intellectualcrafters.plot.util.MathMan;
import com.plotsquared.bukkit.util.BukkitUtil;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
public class StateWrapper {
public BlockState state = null;
public CompoundTag tag = null;
public StateWrapper(BlockState state) {
this.state = state;
}
public StateWrapper(CompoundTag tag) {
this.tag = tag;
}
public boolean restoreTag(String worldName, int x, int y, int z) {
if (this.tag == null) {
return false;
}
switch (this.tag.getString("id").toLowerCase()) {
case "chest":
List<Tag> itemsTag = this.tag.getListTag("Items").getValue();
int length = itemsTag.size();
short[] ids = new short[length];
byte[] datas = new byte[length];
byte[] amounts = new byte[length];
byte[] slots = new byte[length];
for (int i = 0; i < length; i++) {
Tag itemTag = itemsTag.get(i);
CompoundTag itemComp = (CompoundTag) itemTag;
short id = itemComp.getShort("id");
String idStr = itemComp.getString("id");
if (idStr != null && !MathMan.isInteger(idStr)) {
idStr = idStr.split(":")[1].toLowerCase();
id = (short) ItemType.getId(idStr);
}
ids[i] = id;
datas[i] = (byte) itemComp.getShort("Damage");
amounts[i] = itemComp.getByte("Count");
slots[i] = itemComp.getByte("Slot");
}
World world = BukkitUtil.getWorld(worldName);
Block block = world.getBlockAt(x, y, z);
if (block == null) {
return false;
}
BlockState state = block.getState();
if (state instanceof InventoryHolder) {
InventoryHolder holder = (InventoryHolder) state;
Inventory inv = holder.getInventory();
for (int i = 0; i < ids.length; i++) {
ItemStack item = new ItemStack(ids[i], amounts[i], datas[i]);
inv.addItem(item);
}
state.update(true);
return true;
}
}
return false;
}
public CompoundTag getTag() {
if (this.tag != null) {
return this.tag;
}
if (this.state instanceof InventoryHolder) {
InventoryHolder inv = (InventoryHolder) this.state;
ItemStack[] contents = inv.getInventory().getContents();
Map<String, Tag> values = new HashMap<>();
values.put("Items", new ListTag("Items", CompoundTag.class, serializeInventory(contents)));
return new CompoundTag(values);
}
return null;
}
public String getId() {
return "Chest";
}
public List<CompoundTag> serializeInventory(ItemStack[] items) {
List<CompoundTag> tags = new ArrayList<>();
for (int i = 0; i < items.length; ++i) {
if (items[i] != null) {
Map<String, Tag> tagData = serializeItem(items[i]);
tagData.put("Slot", new ByteTag("Slot", (byte) i));
tags.add(new CompoundTag(tagData));
}
}
return tags;
}
/*
* TODO: Move this into the sponge module!
*
public Map<String, Tag> serializeItem(final org.spongepowered.api.item.inventory.ItemStack item) {
final Map<String, Tag> data = new HashMap<String, Tag>();
// FIXME serialize sponge item
return data;
}
*/
public Map<String, Tag> serializeItem(ItemStack item) {
Map<String, Tag> data = new HashMap<>();
data.put("id", new ShortTag("id", (short) item.getTypeId()));
data.put("Damage", new ShortTag("Damage", item.getDurability()));
data.put("Count", new ByteTag("Count", (byte) item.getAmount()));
if (!item.getEnchantments().isEmpty()) {
List<CompoundTag> enchantmentList = new ArrayList<>();
for (Entry<Enchantment, Integer> entry : item.getEnchantments().entrySet()) {
Map<String, Tag> enchantment = new HashMap<>();
enchantment.put("id", new ShortTag("id", (short) entry.getKey().getId()));
enchantment.put("lvl", new ShortTag("lvl", entry.getValue().shortValue()));
enchantmentList.add(new CompoundTag(enchantment));
}
Map<String, Tag> auxData = new HashMap<>();
auxData.put("ench", new ListTag("ench", CompoundTag.class, enchantmentList));
data.put("tag", new CompoundTag("tag", auxData));
}
return data;
}
}

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