Commit Graph
100 Commits
Author SHA1 Message Date
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
dordsor21 781f39f71a Properly define /ore arguments
Fix #885
2021-01-28 12:54:55 +00:00
dordsor21 0f6b56572a Update to NMS given by 1.16.5.
Since there's no new NMS revision (we're still on R3...?!) but there were changes, it would be more difficult to maintain both 1.16.4 and 1.16.5. Therefore, let's just stop supporting 1.16.4 as 1.16.5 is a minor update regardless.
Fixes #859
2021-01-18 16:13:42 +00:00
dordsor21 3ba982927a Merge branch 'main' of github.com:IntellectualSites/FastAsyncWorldEdit 2021-01-18 15:37:43 +00:00
dordsor21 c218743fa8 Fix some coordinate errors
- Fixes WorldGuard weirdness
 - Fixes #860
2021-01-18 15:37:14 +00:00
dordsor21 798b4cdd4e Fix #806 2021-01-15 20:16:46 +00:00
dordsor21 b450a0af80 Fix confirm for some commands that give AutoValue_CommandParametersImpl from the getgo 2021-01-14 20:08:43 +00:00
dordsor21 bad3d31d90 Fix removing section lighting
- Paper and spigot differ in methods
 - Also don't clone it as we're trying to fill the actual data...
2021-01-14 17:03:32 +00:00
dordsor21 b18c646bce AbstractExtentMasks should have the correct extent.
- Fixes #843
2021-01-14 16:54:38 +00:00
dordsor21 fa69c79160 lock when editing the chunks cache in SingletThreadQueueExtent
- Long2ObjectLinkedOpenHashMap is not thread-safe and should not be used from multiple threads at once
 - Fixes #851
2021-01-14 15:42:38 +00:00
dordsor21 3034419918 Send before history is safe 2021-01-14 14:48:13 +00:00
dordsor21 3136fb460b Revert "actually delegate in AbstractDelegateExtent"
This reverts commit 761d05ac19.
2021-01-14 14:39:50 +00:00
dordsor21 761d05ac19 actually delegate in AbstractDelegateExtent
fixes #843
2021-01-14 14:38:37 +00:00
dordsor21 af34bd4e57 the material seems to hold state data for some reason.
- This requires a more complicated fix. Reverting this change for now
2021-01-14 13:42:37 +00:00
dordsor21 54712e268a Synchronize access to Bukkit#createBlockData to prevent occasional ConcurrentModification exceptions
- This isn't actually used anymore given the previous commit, however it's still best to keep it safe.
2021-01-14 12:47:02 +00:00
dordsor21 5e1289494e Delegate to blocktype for obtaining a BlockState's material 2021-01-14 12:45:11 +00:00
dordsor21 ac73478827 Fix bad/needless code
- Fixes #852
2021-01-14 12:39:57 +00:00
dordsor21 fd1ed63703 Don't confirm twice every time
- I channelled my inner Jesse on this one.
2021-01-13 23:50:29 +00:00
dordsor21 05d7558873 Don't print stack trace of FaweExceptions from submitted chunks
Addresses #353
2021-01-13 20:30:22 +00:00
dordsor21 be9866ddb3 Fix a lot of FAWE-freezing properly
- Add a "loadPrivately" method to be used when GetChunks are called to avoid synchronocity issues with super classes being used on different threads
 - Synchronise the call method so we're not attempting to call whilst also loading/updating
2021-01-13 19:02:51 +00:00
dordsor21 e94e3b7b05 Only forcefully submit a chunk if we hold the monitor.
- Properly ensures we don't try to submit chunks that already have a monitor (prevent the FAWE-freezing)
 - We can't detect if "no" threads hold the chunk's monitor, but equally that would also be kinda very bad practice.
2021-01-13 18:18:25 +00:00
dordsor21 eaa9872294 Revert this for now as it had unintended consquences 2021-01-13 17:36:50 +00:00
dordsor21 97209d5680 better locking of lighting and use correct method for relight without removing first
Fixes #847
2021-01-13 17:24:14 +00:00
dordsor21 b066ca8349 only relight blocks that have light 2021-01-13 17:10:08 +00:00
dordsor21 b1e8c6c3ba Synchronizing on accessing a lock is pointless. 2021-01-13 17:09:44 +00:00
dordsor21 f69b1bfb21 properly load nms chunk for lighting operations 2021-01-13 17:09:18 +00:00
dordsor21andGitHub b4d7562b87 Looks like automagical relighting (#838)
Fixes #686
2021-01-11 19:29:16 +00:00
dordsor21 74a2f02003 put MCEdit before sponge and query by file extension.
Massively reduces loading time a few addon plugins that are literally only trying to get the format of a schematic
2021-01-11 16:02:50 +00:00
dordsor21 ddb41a9669 With "queueing" enabled, FAWE may start attempting to place chunks before the operation is finished.
This is unnacceptable for recursive operations, thus the queue should be disable in these cases
Fixes #842
2021-01-11 15:06:55 +00:00
dordsor21 fa8660c7a9 More verbosely check for "scaled" in AffineTransform and override all required methods in BlockTransformExtent
- fixes #462
2021-01-11 14:21:56 +00:00
dordsor21 5903178c53 Fix rotate/flip applying in the wrong order
- pretty cheat fix, but it reverts to legacy FAWE behaviour
2021-01-11 13:18:24 +00:00
dordsor21 ae6a1f1be4 Correct rounding bevhaviour for Vector3 -> BlockVector3
- fixes #512
2021-01-10 20:49:38 +00:00
dordsor21 0b727d9760 Fix for OPs when "not in a region" 2021-01-10 18:51:07 +00:00
dordsor21 831c6f6854 fix NPE with null sourcemask on move 2021-01-10 17:36:41 +00:00
dordsor21 846443291f allowed regions can be null 2021-01-10 17:14:40 +00:00
dordsor21 febf5b0175 Slight change to wna caching
- We don't want to flush if we're setting from the main thread, as that's going to be another plugin doing it
 - It's better to have a concurrent error thrown than use a concurrent set, so concurrency issues can actually be fixed rather than handled unsafely
 - Only send chunk packets up to once a tick (it really doesn't use any memory to cache IntPairs).
2021-01-10 17:11:55 +00:00
dordsor21 278e9d5991 Set source masks that include the editsession's allowed regions to ForwardExtentCopies
Fixes #710
2021-01-10 14:59:21 +00:00
dordsor21 edc7e9028b disableQueue stops buffering, switch to enableQueue to buffer when "//move"ing
fixes #738
2021-01-10 13:22:47 +00:00
dordsor21 bd079421a3 fix wna/loading on non-paper servers 2021-01-10 12:37:41 +00:00
dordsor21 aab9958932 Fixes #221
If WE wants to add it as well, it's up to them. I asked but wiz was hostile about it.
2021-01-09 21:52:50 +00:00
dordsor21 6bc3dd2293 Fix wna when used internally 2021-01-09 21:27:55 +00:00
dordsor21 6f0180447f Don't ParallelQueueExtent if the editsession is created on the main thread. 2021-01-09 17:48:57 +00:00
dordsor21 31542ed4fa Add 3D biomes to clipboards properly
- Also fix disk clipboard's size check, allowing for larger clipboards but with disabled biomes
2021-01-09 16:40:41 +00:00
dordsor21 3accbb84dd Don't talk about CP 2021-01-08 14:38:41 +00:00
dordsor21 febcf5f76f display potentially unsafe extent message in console if no Actor 2021-01-08 14:28:09 +00:00
dordsor21 6b3fe20c61 revert to upstream slf4j so it's present in IDE 2021-01-08 14:24:58 +00:00
dordsor21 9d2c631035 **BaseBlocks are immutable 2021-01-06 21:13:32 +00:00
dordsor21 8f74186e14 *BaseBlocks are immutable 2021-01-06 18:15:59 +00:00
dordsor21 7afddcc411 Fix more NBT mutability issues 2021-01-06 18:00:40 +00:00
dordsor21 e40e86df5f Add some more __internal__ <-> air logi
Fixes #831
2021-01-06 16:40:28 +00:00
dordsor21 336b90be15 Also fix CPUOptimizedClipboard 2021-01-06 13:39:25 +00:00
dordsor21 280ade9994 fix NBT in memory optimized clipboard 2021-01-06 13:29:52 +00:00
dordsor21 91de441403 No need to check WorldEdit schematics for bad entities 2021-01-05 17:21:35 +00:00
dordsor21 6db588a19f Don't allow FAWE to "deadlock" itself when post-processing history by switching to the primary ForkJoinPool
- With enough chunks waiting to write to history, it's possible to fill the secondary fork pool up with locked threads, and thus prevent any threads from actually writing their history.
2021-01-05 16:42:53 +00:00
dordsor21 89cc2f9d9f Large memory use reduction when PostProcessing history 2021-01-05 15:03:47 +00:00
dordsor21 7c174ee6b3 Return to static "sections" in CharBlocks.
- Synchronise (lock) outside the static object
 - Reduces object creation
2021-01-05 13:51:26 +00:00
dordsor21 bfd04e4155 Revert "~1/3 faster history writing with small caching"
This reverts commit 836b7a9750.
2021-01-05 00:50:26 +00:00
dordsor21 836b7a9750 ~1/3 faster history writing with small caching 2021-01-04 21:25:29 +00:00
dordsor21 916c080310 5000th commit: Fix //download 2021-01-04 19:10:10 +00:00
dordsor21 efcca5b66f it's better not to bother with tickets to avoid tickets not being removed all the time 2021-01-01 19:49:11 +00:00
dordsor21 580cb4a91e add chunk tickets and don't force sync sending chunk packets 2021-01-01 18:04:30 +00:00
dordsor21 39b0da2b99 we do want to synchronise across the chunk when loading sections 2021-01-01 17:19:14 +00:00
dordsor21 42346b429b Don't synchronise across the entire edit for a single ChunkSection load (speed boost) 2021-01-01 16:48:17 +00:00
dordsor21 606cfa5cbc we don't need to "update" when copying sections 2021-01-01 16:07:57 +00:00
dordsor21 fbfe3221d7 Fix fast schematic reader/writer
- Have both sponge and fast r/w available but default to "fast"
 - Correctly "offset" entities in the schematic, and add a legacy mode for loading old FAWE schematics with entities required.
 - Lazily reading means it's read in order of appearance in the inputstream so we need to read schematic version first (skip past everything) and then reset the stream. Fixes #740
 - Add an FAWEVersion to the metadata
 - Correctly actually return a BlockArrayClipboard when required. Fixes #454
2021-01-01 15:01:35 +00:00
dordsor21 82f640d132 fix loading Fawe.properties 2020-12-31 17:45:07 +00:00
dordsor21 59c227b49a actually fix AsyncBlock 2020-12-31 15:32:00 +00:00
dordsor21 935130aa0e Fix AsyncBlock 2020-12-31 15:22:29 +00:00
dordsor21 df48b7e81d stop bottling clipboard sizes for no reason 2020-12-31 15:01:54 +00:00