Commit Graph
100 Commits
Author SHA1 Message Date
dordsor21 46c96b45fc Fix build 2021-08-25 11:16:01 +01:00
dordsor21 012e55e780 Fix links 2021-08-25 11:08:14 +01:00
dordsor21 7d9abc9273 Skip corrupt tile entities in legacy schematics 2021-08-23 21:46:50 +01:00
dordsor21 6301a7adb9 Deprecate and add the warnings for BlockType#getState as it is broken 2021-08-23 21:28:06 +01:00
dordsor21 c0893a404d Set default number of iterations for snow smooth brush to 1. 2021-08-23 21:27:35 +01:00
dordsor21 0aadef97d0 Quick fix for SnowHeightMap 2021-08-23 21:26:59 +01:00
dordsor21 ddc59809d8 Update adapters to https://github.com/IntellectualSites/FastAsyncWorldEdit-Adapters/commit/ff01bfd70d1a9cc305ba6bb5297d60aa41dd38fa 2021-08-23 20:59:29 +01:00
dordsor21 1a0f7df3f4 Fix #1243 2021-08-23 13:08:10 +01:00
dordsor21 2e0de7b197 Fix nullability issue with SnowHeightMap mask, apply some cleanup and reduce needless object creation 2021-08-23 11:57:00 +01:00
dordsor21 cd576a2a87 Fix #1241 2021-08-20 16:33:58 +01:00
dordsor21 8e899b8524 Skip registering "custom" biome.
Update adapters to 332c1f6bb17d2ded53fe5b09f3f2a4578f3f9bfc
2021-08-20 16:30:51 +01:00
dordsor21 3dd943f961 Avoid paper-only method 2021-08-20 15:53:12 +01:00
dordsor21 cf68caff99 Correct default biome loading method 2021-08-19 14:12:55 +01:00
dordsor21 f412796f28 Load default biomes into registry at earliest convenience, then load custom biomes later. 2021-08-19 13:48:24 +01:00
dordsor21 563ad7761a Fix LocalBlockVectorSet
- Fixes #1238
2021-08-19 13:10:09 +01:00
dordsor21 6a932f2eda Preloading is paper only. 2021-08-17 22:34:51 +01:00
1d9b1a3d5e Remove hardcoding of world limits (#1199)
* Remove hardcoding of world limits
 - seems to be working fine without the datapack for world height changing
 - particular attention should be given to LocalBlockVectorSet and MathMan changes

* update adapters

* Override getMinY in various classes and ensure selections have a world attached to them

* no message

* Address comments
 - Fix for lighting mode 1

* A few more changes

* Fix LocalBlockVectorSet

* Fix range statement

* Various fixes/comment-addressing
- There's not much point in having a different file name now for history. We've broken it before...
- Fix history read/write
- Fix range on for loops in CharBlocks

* undo bad CharBlocks change

* Fix history y level

* Fix biome history

* Fix lighting

* Fix /up

* Make regen fail not because of these changes

* Fixes for y < 0

* Fix isEmpty where only the uppermost chunksection is edited

* Fix javadocs/FAWE annotations

* Better explain why BiomeMath is removed

* If history task throws an error, it should only be caught and printed if not completing now.

* Min|max world heights for new patterns

* Load biomes from NMS instead of bukkit (#1200)

* Update adapters

* Update adapters

* Don't initialise BlockTypes when biomes aren't set up yet so all BiomeTypes.BIOME are no longer null thanks.

* Address some comments.

* rename layer -> sectionIndex to imply inclusivity

* Javadoctored.

Co-authored-by: NotMyFault <[email protected]>
Co-authored-by: Hannes Greule <[email protected]>
2021-08-17 22:13:51 +01:00
dordsor21 f7161ea890 Update adapters 2021-08-17 18:45:08 +01:00
dordsor21 664cd4e33d Preloader is null for spigot users 2021-08-17 18:06:57 +01:00
dordsor21 51eee01eef Update adapters 2021-08-17 17:52:28 +01:00
dordsor21 347bd04065 Fix initialisation 2021-08-17 17:09:52 +01:00
dordsor21 4cae37fbbf Add back extra angle mask prefixes 2021-08-17 17:07:37 +01:00
dordsor21 569fdc3861 Reimplement radius mask, fix wall mask 2021-08-17 17:03:25 +01:00
dordsor21 46f6395279 Improve mask parsing
- Fixes #1230
2021-08-17 17:02:11 +01:00
dordsor21 0ffab8ee69 Add null check to preloader 2021-08-17 15:38:47 +01:00
dordsor21 8c11ba7fea Preload chunks up to the configured limit, cancel preloading on EditSession complete 2021-08-17 12:07:48 +01:00
dordsor21andGitHub da7aca8ef8 Add basic preloading (#1221) 2021-08-16 20:47:09 -04:00
d4d98708f9 Re-implement richer mask and transform parsing (#1223)
Co-authored-by: dordsor21 <[email protected]>
Co-authored-by: Hannes Greule <[email protected]>
2021-08-16 09:03:06 +00:00
dordsor21 50137b31c4 Update adapters 2021-08-15 15:59:30 +01:00
dordsor21 c287739be7 Minecraft uses the global block palette if there are more than 8 bits per entry in a chunk section
- Fixes #1228
2021-08-14 14:29:57 +01:00
dordsor21 98673b5743 Update adapters 2021-08-13 11:59:24 +01:00
dordsor21 3c75ed7d46 javadoc 2021-08-13 11:51:05 +01:00
dordsor21 c65c72b249 Allow adapters to override World#getEntities to avoid AsyncCatcher
- Even if we access (cache) the entities synchronously, we'd then be doing stuff asynchronously so adapters can override this and either use the world#getEntities normally (pre 1.17) or get entities async anyway.
2021-08-13 11:44:18 +01:00
dordsor21 3e4f1d5cd8 Better Mathman#isInteger 2021-08-11 20:38:52 +01:00
dordsor21 00a6a2d917 Fix stash failure 2021-08-11 15:03:59 +01:00
dordsor21 3ba42df321 Use more MutableBlockVector3s 2021-08-11 14:56:10 +01:00
dordsor21 6f5430a940 Some cleanup of mutables 2021-08-11 14:00:12 +01:00
dordsor21 8928556c1d Minor improvement to MathMan#isInteger 2021-08-11 12:32:46 +01:00
dordsor21 31b41235ac Update adapters 2021-08-09 14:34:39 +01:00
dordsor21 57f7c93033 Fix history rollback
- Fixes #959
2021-08-08 19:35:57 +01:00
dordsor21 6562f8adbd Update adapters 2021-08-08 12:09:05 +01:00
dordsor21 08ebef2905 Break file to make git notice it 2021-08-08 12:08:55 +01:00
dordsor21 c58b143552 Update adapters to https://github.com/IntellectualSites/FastAsyncWorldEdit-Adapters/commit/3f6df1adeed711ba5339517fc3342c4daa515274 2021-08-08 12:03:52 +01:00
dordsor21 2376ce8d9d Add thickness to //hcyl and //br cylinder -h
- Closes #753
2021-08-08 10:02:58 +01:00
dordsor21 9af77c06b8 Fix ParallelQueueExtent#setBlocks(Region, <B extends BlockStateHolder>)#
- Fixes removeabove/removebelow
2021-08-07 17:38:09 +01:00
dordsor21 346223977d Add javadoc comments to generateTree 2021-08-07 16:28:41 +01:00
dordsor21 e90b261196 Trees should be generated on the main thread
- Also remove warning when using tree tool
2021-08-07 16:19:41 +01:00
dordsor21 0d84967853 Fixes #1219 2021-08-07 16:12:03 +01:00
dordsor21 d62a1b5ad3 Always trim chunk GET in ChunkHolder
- Possibly something to do with #1169
2021-07-29 20:37:10 +01:00
dordsor21 8ba2eb3330 [CI-SKIP] update bug report template to reflect 1.17 FAWE 2021-07-24 17:17:43 +01:00
8c0195970b Add and apply .editorconfig from P2 (#1195)
* Consistenty use javax annotations.
 - Unfortunately jetbrains annotations seem to be exposed transitively via core somewhere, but with the correct IDE settings, annotations can be defaulted to javax
 - Cleaning up of import order in #1195
 - Must be merged before #1195

* Add and apply .editorconfig from P2
 - Does not rearrange entries

* Address some comments

* add back some javadoc comments

* Address final comments

Co-authored-by: NotMyFault <[email protected]>
2021-07-24 16:34:05 +01:00
dordsor21 3b4beba7d6 Improve performance of various commands/actions
- Add chunk preloading to RegionVisitor if supplied with a suitable Extent
 - Where extents are used in masks, set EditSession as the extent as they are otherwise initialised with WorldWrapper that is very slow
 - Fixes #1073
2021-07-24 15:47:22 +01:00
f2ee2248e0 Consistenty use javax annotations. (#1197)
- Unfortunately jetbrains annotations seem to be exposed transitively via core somewhere, but with the correct IDE settings, annotations can be defaulted to javax
 - Cleaning up of import order in #1195
 - Must be merged before #1195

Co-authored-by: NotMyFault <[email protected]>
2021-07-24 15:52:08 +02:00
dordsor21 5e9535db41 Re-add shading/relocation of fastutils and add a dumb class because minimise doesn't scan worldedit-adapters 2021-07-24 14:12:59 +01:00
dordsor21 b599d86a1c Assume it's safe not to shade or relocate fastutils 2021-07-24 13:14:58 +01:00
dordsor21 8f55d3f9a4 update adapters 2021-07-24 13:14:19 +01:00
dordsor21 41f4aadf40 Update to 1.17.1 texture jar 2021-07-24 12:19:44 +01:00
dordsor21 d46af0136b Fix nullable world in regions 2021-07-24 10:04:04 +01:00
dordsor21 39defaea5e and reupdate adapters without a borked jar file because the hash wasn't different the first time round 2021-07-23 21:57:06 +01:00
dordsor21 c37ce767d7 update adapters 2021-07-23 21:54:49 +01:00
dordsor21 4341001a1c Update adapters 2021-07-23 21:03:02 +01:00
dordsor21 0be8746c11 Add more directionals
- Fixes #1122
 - Levers and buttons can be flipped/rotated vertically
2021-07-23 20:15:22 +01:00
dordsor21 ad102ab7a9 clipboard brush is supposed to be -o not -p 2021-07-23 11:27:14 +01:00
dordsor21 8e16acde1d Fix error in clipboard brush switches 2021-07-23 09:54:30 +01:00
dordsor21 6acd8498b2 Update adapters 2021-07-22 17:59:48 +01:00
dordsor21 1e49f59001 Much better hinge handling 2021-07-21 20:00:39 +01:00
dordsor21 1ec927f30c Add check when obtaining BlockState from id to prevent edits losing large amounts of data 2021-07-20 20:49:47 +01:00
dordsor21 5f8addbb5b Fix #1185
TODO: fix door hinge placement on rotate/flip sometimes
2021-07-20 20:49:13 +01:00
dordsor21 ca1744aa97 Likely fix for rotation issue
fixes #996
2021-07-19 20:33:50 +01:00
dordsor21 6ab927fa4d Fix #1167 2021-07-19 20:28:36 +01:00
dordsor21 e6b18cf230 Run residence permission playerHas check on main thread 2021-07-18 13:18:55 +01:00
dordsor21 861fb45e5c Fix #1075 2021-07-16 19:07:02 +01:00
dordsor21 420c45a29a Entity removal should be on the main thread as we're just passing through rather than doing chunk operations
- Fixes #1164
 - Not working: butcher/remove history
2021-07-16 18:48:21 +01:00
dordsor21 c98f6e4f37 Do not allow generation commands to generate outside selection 2021-07-16 10:44:52 +01:00
dordsor21 2485f5eccc EditSession needs to override some Extent methods to ensure block changes are correctly set through the various extents
Fixes #1152
2021-07-16 10:43:15 +01:00
dordsor21 d9418ec8ae Undo part of 41073bb1a0
Fixes #1178
2021-07-16 09:52:44 +01:00
dordsor21 41073bb1a0 More exact testing for scaling/flipping in AffineTransform and only combine transforms when not equal in ForwardExtentCopy
- Fixes #1162
 - Also fixes rotation in x/z axes
2021-07-10 19:47:39 +01:00
dordsor21 338be0ff31 Undo/redo should not be allowed outside allowed regions by default.
Fixes #949
2021-07-10 14:14:34 +01:00
aa3ae63682 Feature/1.17 (#1120)
* start v6

* Update classes to v6 method signatures

* change rootVersion to signify p2v6 compat

* Use 16 as toolchain version but target 11 for build output

* add minimessage as api

* Require v6 and don't attempt to "setup" hook from FAWE

* Address comments

* *address /all/ comments

* FAWE classes should only act as a delegate

* Uppercase logger

* Settings for v6-hook have moved to P2-v6, remove unneeded if statements

* Rename classes to Delegate

* add whenDone task to setCuboids

* Remove bad spaces

* Fix plot swap

* Initial work on 1.17 support

* Remove data versions from the Bukkit adapters (#1507)

* Remove data versions from the Bukkit adapters

* Don't allow saving schematics without an adapter in place on Bukkit.

* Removed confusing line

(cherry picked from commit 2056218b4a8644836b1d127105dfa289e9cdbc1c)

* More progress

* Fix chunk sending

* Repackage from com.boydti to com.fastasyncworldedit.<module> (#1119)

* Preliminary work on repackaging

* Rename build artifacts matching our pattern

* Finish up repackaging

* Fix a few field accesses and old imports

* Dirty fix for chunks container ChunkSections outside of 0-15

* Correctly read from NibbleArrays for lighting

* Fix getSections and BlockMaterial for 1.17

* Fix writing blocks to the world.
 - The issue isn't the presence of a "-1" chunk, it's the constructor for ChunkSection requiring the layer (0 to 15) rather than the y chord

* Fix more field accesses

* More work towards 1.17

* Update Upstream

a57f66f Fix watchdog, add negative y support. (1782)

* Add azalea tree to `/tool tree`

* Don't define toolchain twice

* Repackage GriefDefender

* Relocate under new namespace

* Bye bye ecma left overs

* Add 1.17 to issue templates and instructions

* Move to adventure-nbt (#918)

* Initial work for adventure-nbt

* Some more FAWE specific stuff

* Fix erroneous deprecation check

* Workflow change

* Continued merging all adventure NBT related changes

* Continued merging all adventure NBT related changes

* Made a constructor public again

This needs to be public for BlockTransformExtent.java

* Finished converting all NBT data to adventure.

* Make this compile

* Fix conflicts

Co-authored-by: Matt <[email protected]>

* Update adapters to 1.17

* Change build prefix to 1.17

* Move more nms classes to adapters

* Move left over nms classes

* Move Spigot 1.17 class

* Remove unneeded adapter loader code
The loader will find the appropriate class now itself

* Update adapters

* Update adapters

* Lazy fix tests

* Update adapters

* Update Upstream

43da91a Remove method reflection for getMinHeight in BukkitWorld. (1796)

* Relocate adventure-nbt under proper namespace

* Add LazyCompoundTag as a non-version-specific class to be used by adapters

* Better integration between old NBT and Adventure NBT - begin fixing the issues seen recently

* Correctly NBT conversion method

* LazyCompoundTags should actually be overriding and correctly returning a CompoundBinaryTag.

* Update worldedit-adapters
Fixes #1141

* Remove unnecessary massive lag machine

* Refactor apply to applyBlock in subclasses

* applyBlock should be overriden by all subclasses.
Default apply to applyBlock

* Closes #1130 Closes #1132

* Squashed commit of the following:

commit a9bfa1a07c77083c844a0c3ba62f4bd94bed107c
Author: NotMyFault <[email protected]>
Date:   Sun Jun 27 21:53:21 2021 +0200

    [ci skip] Update gradle wrapper validation

commit aa7471f95317d28a16f62e4b200de8d0fea2fa95
Author: Matthew Miller <[email protected]>
Date:   Sat Oct 10 15:49:13 2020 +1000

    Add ^x,y,z relative offset support to the offset parser (#1545)

    * Add ^x,y,z relative offset support to the offset parser

    * Wrap in a try-catch

    (cherry picked from commit 28bdf7ff9254bbc85bb4f5f792b303943a3930a8)

* Add `fawe.error.schematic.not.found` translation key

* Update Upstream

728a152 Skip notify if chunk section doesn't exist (1794)

* Fixed #1157

* Add a null check to prevent NPE in nbt code

* Update adapters

* Update Upstream

fbb047a Optimize legacy schematic loading (1808)

* Hurr durr I don't want to update Java

* Update Upstream

0790e6e Fix CLI Mess (1811)

* Fixes #1160

* Expose minimessage transitively thru PlotSquared

Touches #32

* [ci skip] Remove unneeded maven repository

* Steal tab completion from PlotSquared for P2 related commands

* Don't error on startup when building locally

Co-Authored-By: goldfishapp <[email protected]>

* [ci skip] Update gh actions to Java 16

* Update textures to grab 1.17 jar

Co-authored-by: NotMyFault <[email protected]>
Co-authored-by: SirYwell <[email protected]>
Co-authored-by: Matthew Miller <[email protected]>
Co-authored-by: Matt <[email protected]>
Co-authored-by: goldfishapp <[email protected]>
2021-07-01 22:16:25 +02:00
dordsor21 a0e84d7a44 Fix superpickaxe item dropping
Fixes #1079
2021-06-18 23:48:23 +01:00
dordsor21 391869cf3a Fix up LimitExtent
- Correctly handle block state limit checks.
- Don't quash exceptions thrown in a region operation by having a "max-fails" check that can only be hit once....
Fixes #1127
2021-06-18 18:00:42 +01:00
dordsor21 256d7c4e5d Temporary fix for #1122 2021-06-14 06:34:05 +01:00
dordsor21 d015e6b270 Also synchronise when loading sections forcefully 2021-06-12 15:09:02 +01:00
dordsor21 b796106dd7 Add directionals for chests and slabs "type" block state
Fixes #987
2021-06-11 15:25:52 +01:00
dordsor21 da264b52e1 Fix #1116 2021-06-11 15:05:52 +01:00
dordsor21 f6c87b6726 Add null check to creating default NBT data 2021-06-10 19:59:17 +01:00
dordsor21 717a1b5db4 Replace ImmutableBaseBlock with BlanketBaseBlock
- ImmutableBaseBlock is no longer needed as NBT was made immutable previously
 - BlanketBaseBlock represents to masks that the block has NBT, but does not need to match a specific state
 - Allow FuzzyBlockState to create BaseBlocks without NBT data (fixed tab completion issues)
2021-06-10 19:47:34 +01:00
dordsor21 1fa5f4d725 Begin fixing layer brush
- Required new argument parser, which should ultimately be made into a singe blockstate parser for best results, and proper tab-completion
 - The layer brush itself is broken because of the changes to internal block retrieval from legacy
2021-06-10 16:19:23 +01:00
dordsor21 7ef8b2f95e Create default TileEntity data where required.
Fixes #1093
Fixes #1042
2021-06-10 13:39:36 +01:00
dordsor21 71130025e8 Allow ^ mask to be used between blocks that may have different properties, only keeping the shared properties
Fixes #1092
2021-06-10 12:46:19 +01:00
dordsor21 dd217fcb70 Don't bother trying to use a clipboard when clearing plots.
Fixes #1088
2021-06-09 17:45:57 +01:00
dordsor21andGitHub f6af9925e8 Char block null check (#1030)
**Add a null-check to CharBlocks FULL section layer-retrieval.**
 - It is possible to trim CharBlocks whilst it is attempting to read data due to the batching of chunks to help reduce memory
 - This is done when the number of chunks sitting loaded in memory with having been "submitted" to the queue for writing to disk becomes high
 - Seconday operations such as heightmap processing and lighting will quickly load chunks, meaning many chunks are submitted early
 - This leads to much higher chances of the chunk being submitted and subsequently trimmed given heightmap and light processing is done layer-by-layer over many chunks, rather than chunk-by-chunk - thus leading to NPEs.
 - By adding synchronisation to and around only the specific sections when loading/updating, and not blocking the whole chunk, many access can still be thread-safe without causing deadlocks
 - This allows removal of lots of the needless and very-slowing synchronisation on get**Block** methods

**Remove much of the synchronisation from ChunkHolder**
 - We shouldn't be synchronising with call() and safety should be added elsewhere. (plus it's making edits very very slow when queue target size is hit)
 - Also remove much of synchronisation because we've added the null-check and section-specific synchronisation to CharBlocks
 
**Some QOL/thread-safe data access changes**
- Replaces the Array#clone seen in the get blocks classes with System#arraycopy as deep cloning is not required, and is also slower than arraycopy
- Add System#arraycopy when accessing chunk section data via history to ensure it is not altered whilst being written
- Renaming EMPTY to empty means it is not implied to be a static variable

Fixes https://github.com/IntellectualSites/FastAsyncWorldEdit/issues/1028
Fixes https://github.com/IntellectualSites/FastAsyncWorldEdit/issues/1025
Fixes https://github.com/IntellectualSites/FastAsyncWorldEdit/issues/1089
Fixes https://github.com/IntellectualSites/FastAsyncWorldEdit/issues/1091
Fixes https://github.com/IntellectualSites/FastAsyncWorldEdit/issues/1097
2021-06-08 14:28:16 +00:00
dordsor21 1cd2d8d121 Send before history is acttually safer at the moment
- avoids deadlocks
2021-06-08 14:15:43 +01:00
d224d6ea32 Add synchronization to CharBlocks (#963)
similar to ChunkHolder, it represents an internal chunk for which operations should not be accepted by multiple threads at once.

Co-authored-by: NotMyFault <[email protected]>
2021-03-15 18:33:21 +00:00
7a0dc39eb7 Apply a lot of synchronization to ChunkHolder (#941)
This is basically the main "chunk" class for internal FAWE. Chunk operations should (and are) almost always single-threaded operations, however, under certain circumstances it is possible for the chunk to be "called" (flushed: written to the world and sent to the player) from a separate thread. This would specifically occur from SingleThreadQueueExtent when there are a lot of chunks being loaded in memory by FAWE (where the chunk would then be submitted to a multi-threaded queue). It would therefore be possible for a thread accessing the chunk to attempt to access it in the middle of the call, which can lead to a number of issues, and it is my opinion that the most frequent of these is the NPE seen during lighting operations, where new chunks can be accessed/loaded very quickly, increasing the likelihood for the aforementioned synchronisation issue to occur.

Co-authored-by: Matt <[email protected]>
2021-03-03 15:26:00 +01:00
dordsor21 5f83643d88 Couple of command fixes
fixes #899
2021-02-05 23:20:15 +00:00
dordsor21 2ab207cfe9 Fix occasional NPE when removing section lighting 2021-02-05 16:05:53 +00:00
dordsor21 f88432a709 Fix incorrect Collections#unmodifiableSet usage 2021-02-01 15:07:54 +00:00
dordsor21 287aa9dd8b Remove bad default copy method in AbstractMask 2021-01-28 14:23:00 +00:00
dordsor21 485781f711 Merge branch 'main' of github.com:IntellectualSites/FastAsyncWorldEdit 2021-01-28 13:13:10 +00:00