Commit Graph
100 Commits
Author SHA1 Message Date
JordanandGitHub d498996cbd Use Material rather than legacy int/data when specifying block break effect type (#1829) 2022-06-22 12:50:09 +01:00
968799503f Re-implement full Entity support in history, entity removal, entity creation, etc. (#1812)
Co-authored-by: Alexander Brandes <[email protected]>
2022-06-21 14:52:02 +01:00
dordsor21 d62c88a2ca Remove unused import 2022-06-21 13:00:19 +01:00
dordsor21 8b05738929 Remove P2 apidescription annotation 2022-06-21 12:58:21 +01:00
JordanandGitHub c5073d79e7 Account for use of MutableBlockVector3 in Spline Brush (#1831) 2022-06-21 12:56:02 +01:00
JordanandGitHub 3f103eea9b Set the correct delegate to the ChunkHolder when using get or set in NULL delegate (#1830) 2022-06-21 12:55:51 +01:00
dacb89a480 Bring stack in line with upstream using offset rather than direction (#1822)
Co-authored-by: Alexander Brandes <[email protected]>
2022-06-20 10:46:19 +02:00
JordanandGitHub 396faf6732 Support using //distr on console properly (#1827) 2022-06-19 22:35:36 +01:00
JordanandGitHub dac3610bcf Implement generation of biome decorations to //regen <biome> and add option for a random seed to be used (#1819) 2022-06-19 22:33:16 +01:00
JordanandGitHub 692a010c39 Actually apply source mask when using //paste -m <mask> (#1810) 2022-06-19 22:33:01 +01:00
JordanandGitHub 84f6039f41 Fix #fullcopy -r (#1816) 2022-06-19 00:59:11 +01:00
JordanandGitHub aadd35c0c4 Don't limit split size for extra block data (signs, spawner, etc.) (#1818) 2022-06-19 00:58:59 +01:00
JordanandGitHub 8e5204c311 Allow editing solely of tiles/entities/heightmaps (#1817) 2022-06-19 00:58:54 +01:00
JordanandGitHub 003cec30be Fix saving entities in DiskOptimizedClipboard when no tiles are present (#1815) 2022-06-19 00:58:47 +01:00
JordanandGitHub 907ad8528e Don't do the unbelievable bad use of a MutableBlockVector2 in the creation of a set (#1825)
* Don't do the unbelievable bad use of a MutableBlockVector2 in the creation of a set
 - Fixes IntellectualSites/PlotSquared#3683

* Clean up remnants of the use of MutableBlockVector2
2022-06-17 23:41:25 +02:00
JordanandGitHub d2b4154cc0 Properly support extended world heights (y > 255) in tripleBlockCoord (#1805) 2022-06-17 15:39:27 +01:00
JordanandGitHub fd00635533 Fixes to BlockMask and "char" masks (#1787)
* If a char mask  is successfully created from the full input, return it

* Don't double-up adding a block to a BlockMaskBuilder (if adding by regex is successful)
 - InputParseException is thrown if unsuccessful

* Fix optimisation of BlockMask for negation of a single block type
 - Fixes #1755

* Allow early returning of an optimized MaskIntersection to avoid unnecessary work

* Actually allow underscore in isAlphanumericUnd
 - Fixes #1626

* Replace a few more hard-coded air internal IDs

* Don't fail silently if BlockMaskBuilder#addRegex doesn't work when testing all block types

* Remove unused import
2022-06-16 16:24:48 +02:00
JordanandGitHub f2bab901f4 The extent minY check in clipboard paste is un-needed as it is handled gracefully by FAWE (#1806)
- Fixes #1771
2022-06-16 16:24:00 +02:00
JordanandGitHub 1da987d594 Fix PNGWriter exporting blank PNGs (#1807)
* Fix horrendous variable assignment in PNGWriter
 - Fixes #1679

* More detailed information on PNG format

* Avoid a larger number of blocks that do nto have a color assigned in TextureUtil

* Don't error in PNGWriter if biomes aren't saved to clipboard and grass is present
2022-06-16 16:23:52 +02:00
JordanandGitHub ac11da855a Processor should be added to queue, not extent (#1809)
- Fixes #1559 root cause
2022-06-16 16:23:45 +02:00
JordanandGitHub 9395b3c575 Prevent unhinged tree generation by doing a sanity check on the block below/block of the tree placement (#1811) 2022-06-16 16:23:37 +02:00
dordsor21 462bba4f87 Fix biome history on 1.19 2022-06-15 18:52:49 +01:00
JordanandGitHub cb6e200ca6 Use the correct CuboidRegion constructor to prevent clipboard height being limited when loading schematics (#1798)
Use the correct CuboidRegion constructor to prevent clipboard height being limited when loading schematicsd
 - Fixes #1757
2022-06-15 13:37:32 +02:00
JordanandGitHub ea434163c4 Only create entities during a restore if they are contained by the region and the editsession's mask (#1800) 2022-06-15 13:37:20 +02:00
dordsor21 111d604075 Follow up to 39e1a811f7 to fix DOC loading 2022-06-14 17:20:59 +01:00
JordanandGitHub b797655d0c Only implement cache to MaskingExtent when off main thread (#1789)
* Only implement cache to MaskingExtent when off main thread
 - It's possible for a [Chunk/Char]FilterBlock to be used multiple times in the same "tree" of method calls meaning the mutable paramets (particularly index) get increased within a loop, causing AIOOBs and other issues
 - This is only possible on the main thread due to the handling of submissions in SingleThreadQueueExtent, as it ensures all operation remains on the main thread to prevent deadlocks
 - Therefore safe usage of FilterBlocks requires that main-threaded operation create a new [Chunk/Char]FilterBlock instance each time
 - Further fixes #1681

* Fix typos

* Switch to LongFunction
2022-06-13 23:42:40 +02:00
JordanandGitHub 97ab47c90b Command block messages should be sent on the main thread as it causes a block update (#1796)
- Fixes #1786
2022-06-13 23:42:26 +02:00
dordsor21 f8583fb7cb Remove erroneous world height 256 limit 2022-06-13 15:11:39 +01:00
JordanandGitHub 63f031b01a Only synchronise tree generation at the very lowest level (#1788)
* Only synchronise tree generation at the very lowest level
 - Fixes #1681

* Perform the generate inside try-finally and actually use the resultant copied map to place blocks to the editsession

* Check result of generateTree and return null if failed
2022-06-13 09:05:18 +02:00
JordanandGitHub 02a6bb9b27 Implement limits to image size and load times (#1790)
* Implement limits to image size and load times
 - Prevents issues caused by users attempting to load large images
 - Implements #1729

* Check dimensions given before attempting to load image
2022-06-13 09:04:59 +02:00
JordanandGitHub da3fc2e6ea Fix DelegateSemaphore synchronisation issues on Spigot (#1781)
* Fix DelegateSemaphore synchronisation issues on Spigot
 - Also effectively nullify it on paper - the synchronisation on the object is enough

* Remove unneeded imports
2022-06-10 19:50:16 +02:00
JordanandGitHub 0b33fa8757 Allow NBT stored in DiskOptimizedClipboards to be written to disk as a compressed byte array at the end of the file (#1745)
* Allow NBT stored in DiskOptimizedClipboards to be written to disk as a compressed byte array at the end of the file

* Add some deprecations/javadocs and provide the expected clipboard version on error

* Javadoc since tags and add location of clipboard folder to error

* Refactor load-from-file method into DOC class

* Refactor nbt loading code into separate method in DOC
2022-06-09 12:48:35 +02:00
JordanandGitHub 32231b48fe Avoid int overflow when using fillr in negative coords (#1711)
Fix int overflow when using fill and fillr in negative y-coordinates
2022-06-05 20:52:36 +02:00
JordanandGitHub 198c6b7800 Some fixes and improvements to internal queuing (#1715)
* the set array given in NMSAdapter should have get data written to it
 - Fixes #1664
 - May fix #1700

* Having target size >= 2* parallel threads allows for adjacent chunks to be loaded with issues

* "empty" chunk section doesn't need to be localised to the chunk and may be static

* Switch to slightly more performant stream method for testing for non-empty sections

* Implement lock into ChunkHolder preventing any modification to occur whilst the edit is being applied to the world
 (when ChunkHolder is called)

* Add config note about target-size

* set ordinal equal to air if both set and get are `__reserved__`

* Add note to checkAndWaitOnCalledLock method of its use

* Don't print exception and throw

* Switch to a wrapped StampedLock allowing reentrant behaviour
 - StampedLock is not reentrent
 - Allow unlock from a different thread only if it provides the correct stamp
 - This stamp can only be retrieved by the thread owning the lock

* Avoid some "doubling-up" of using checkAndWaitOnCalledLock

* Unbloat `checkAndWaitOnCalledLock`

* Add since tags
2022-06-05 20:52:28 +02:00
JordanandGitHub 8228b798e5 Implement biomes to filter blocks and use in Clipboard pasting (#1743)
- Fixes #1741
2022-06-05 20:52:14 +02:00
JordanandGitHub 84f975559c [ci skip] Add jenkins to downloads list (#1750) 2022-05-18 17:20:41 +02:00
JordanandGitHub deaf5ad2d6 Respect clipboard settings (disk vs memory) when loading a schematic (#1742) 2022-05-14 21:10:13 +01:00
JordanandGitHub 1c7643bb58 Allow use of BlockVectorSet for large //line selections instead of LocalBlockVectorSet (#1713) 2022-05-11 13:22:10 +01:00
dordsor21 059c5f046d "Empty" side effects is default, and default does "apply" side effects 2022-05-10 17:28:09 +01:00
b237ddf076 Cherry pick upstream commits to fix SideEffectSet (#1737)
* Fix SideEffectSet.none() being the default set (#1620)

* Fix SideEffectSet.none() being the default set

* Remove the unnecessary private empty constructor for SideEffectSet

* Back to ImmutableMap.of

* Speed up Fast Reorder Mode and make it default (#1653)

* Speed up Fast Reorder Mode and make it default

* Make non-exposed side effects internal

* Docs on isExposed

Co-authored-by: Matthew Miller <[email protected]>
2022-05-10 10:11:12 +02:00
JordanandGitHub d7543884a5 Check cached bukkit player is the same as the current player online (#1732)
* Check cached bukkit player is the same as the current player online
 - If plugins do silly things like teleport, deop (anything that requires a perm-recheck) (anything that ultimately requires a BukkitPlayer at some point) then the retention of metadata by the server (as it's stored based on a string value indescriminate of player a player relogging) means that a BukkitPlayer caching an old player object will be kept, cached and retrieved by FAWE. Adding a simple memory-based equality check when the player rejoins, and then "invaliding" (redoing) the cache if the players are not equal, fixes this.
 - Fixes #1730

* Address comments

* Add comment explaining reference equality check to code
2022-05-10 10:10:59 +02:00
JordanandGitHub 267dc153f0 Don't initialise a DiskOptimisedClipboard before checking for an existing one in the LocalSession when using loadClipboardFromDisk (#1731) 2022-05-09 12:50:19 +01:00
210ee9f2ef Implement getNameUnsafe method to allow an unloaded world's name to be accessed (#1712)
* Implement getNameUnsafe method to allow an unloaded world's name to be accessed
 - Fixes #1671 and #504

* Add javadoc since tag

Co-authored-by: Alexander Brandes <[email protected]>

Co-authored-by: Alexander Brandes <[email protected]>
2022-05-05 21:39:45 +02:00
JordanandGitHub e294245ec4 Fix some horrendous code where methods supposed to return a boolean only ever return true (#1718) 2022-04-24 18:03:40 +02:00
dordsor21 82ba96bf71 Add constraints to //asc and //desc 2022-04-24 00:11:57 +01:00
JordanandGitHub 65349392a6 Set empty block count when using fastmode on 1.17 (#1710)
* Set empty block count when using fastmode on 1.17
Fixes #1666

* Update legacy adapters
2022-04-21 13:11:23 +02:00
dordsor21 f5ef0cadb6 Clean up remaining byte casts from 39081e62c9 2022-04-20 23:47:09 +01:00
JordanandGitHub 465c81d193 Remove hardcoding of heightmap compressed long size (#1668) 2022-03-18 21:28:25 +00:00
JordanandGitHub 1708584e8d Don't call ticking_list on Spigot (#1655)
* ticking_list is paper only

* Update adapters
2022-03-14 11:08:10 +01:00
JordanandGitHub 5a97b23347 Don't error when adding processors to NullExtent, simply do nothing (#1654) 2022-03-13 18:35:27 +01:00
dordsor21 d8c0f8e3b1 Make sure thread-cached arrays are reset 2022-03-13 01:44:59 +00:00
e9db749e2f Add fluid ticking and refactor post-processing a bit (#1554)
* Make postProcessSet a default method and change to void

* Throwable#getMessage is nullable

* Move (re-)ticking to a post-processor per "platform"
 - Add fluid ticking

* chore: Ignore (for us) irrelevant rules

* chore: Fix correct toml syntax?

* Re-add removed method for API-compliance and refactor it to have a use

* Switch to javax annotations

* Switch to recalcBlockCounts for ticking blocks.

* No need to set air count anymore either

* We can still "not tick" in fast mode in 1.17.2

* update adapters

* Let paper create the chunk section if biomes are null

* Adjust notes to settings

* 1.17.2 didn't exist

* Add 1.18.2

* Don't attempt to cache plains biome ID

* Use correct annotation

Co-authored-by: NotMyFault <[email protected]>
2022-03-10 15:27:25 +01:00
JordanandGitHub f59353006a Update to P2 extended heights (#1581) 2022-03-09 14:21:58 +01:00
JordanandGitHub dec0373081 Fix 1.17 snapshot restoration (#1632) 2022-02-27 21:20:16 +00:00
b8ab2a5204 Don't allow heightmap-based brushes to edit the entire world "depth" (#1617)
Fixes #1614

Co-authored-by: Alex <[email protected]>
2022-02-24 10:33:37 +01:00
fc2662e51e Fix //snapshot in 1.18 and re-implement biome/entity restoration (#1620)
* Re-add "//snap" and "//snapshot"

* Place code in correct method

* Use CompoundBinaryTags in AnvilChunk18 and implement biome/entity restoration

* Address comments

* Fix biome reading

* Fix retrieval of entities from zipped snapshot world

Co-authored-by: Alex <[email protected]>
2022-02-24 10:33:25 +01:00
49d5183685 Load legacy config file before firing PlatformsRegisteredEvent (#1623)
Fixes #1622

Co-authored-by: Alex <[email protected]>
2022-02-24 10:33:06 +01:00
28a0239437 Fix clipboards to allow proper heights by allowing extended CuboidRegion heights (#1624)
* Fix clipboards to allow proper heights by allowing extended CuboidRegion heights
Fixes #1534

* Add @since

* Fix javadoc comment

Co-authored-by: Alex <[email protected]>
2022-02-24 10:32:45 +01:00
JordanandGitHub 39081e62c9 byte cannot be used to represent height anymore (#1618)
Fixes #1593
2022-02-17 19:34:25 +01:00
JordanandGitHub f7a0c14a1b Correctly use getNearestSurfaceTerrainBlock in SurfaceSpline and SchemGen (#1616)
Fixes #1609
2022-02-17 19:34:07 +01:00
dordsor21 3f28a5759d Make slope method slightly more readable in AngleMask 2022-02-16 18:18:58 +00:00
dordsor21 a40d1ccf51 Better naming for min position in HeightMap 2022-02-16 18:13:04 +00:00
dordsor21 fbe0c08c26 FAWE HeightMap constructor shouldn't be deprecated 2022-02-16 18:02:20 +00:00
dordsor21 05bd84b504 Don't crazily initialise HeightMapFilter...?? 2022-02-16 17:47:43 +00:00
dordsor21 3e85369765 Make angle pattern slope a little more readable 2022-02-16 17:42:22 +00:00
dordsor21 de4f73997e Implement missing methods in tests 2022-02-12 13:38:04 +00:00
JordanandGitHub 178604bbb7 Only call org.bukkit.World height methods if they're present (1.17+) (#1551)
* Only call org.bukkit.World height methods if they're present (1.17+)

* Switch to WorldEdit get height methods in GPFeature
2022-01-29 13:12:16 +01:00
dordsor21 d3696f91d4 Synchronise access to the PriorityQueue used for effect queuing in AbstractWorld
- Makes it thread-safe
2022-01-15 17:09:49 +00:00
JordanandGitHub 6a972e7b99 Heightmaps used for brushes etc. should be normalised to zero. (#1522)
* Heightmaps used for brushes etc. should be normalised to zero.
Fixes #1508

* chars are unsigned

* Add scale paramer to javadoc
2022-01-14 10:49:23 +01:00
dordsor21 c2f3c13a09 Fix #1510 2022-01-08 18:10:14 +00:00
dordsor21 4754f660c7 Fix #1524
Also brings in line with upstream
2022-01-08 17:46:28 +00:00
dordsor21 59d4247ddb Update legacy adapters 2022-01-05 23:53:02 +00:00
dordsor21 867d4c05cb Merge branch 'main' of github.com:IntellectualSites/FastAsyncWorldEdit into main 2022-01-05 23:43:31 +00:00
dordsor21 d6695d23f0 Replace remaining instances of worldeditregentempworld 2022-01-05 23:42:57 +00:00
dordsor21 722c411219 Add workaround for when expressions are parsed in masks/patterns where '&&' is used
Fixes #1517
2022-01-05 17:46:18 +00:00
dordsor21 42dacfc7ef Fix incorrect toNative method in 1.17 adapter 2022-01-04 13:28:29 +00:00
dordsor21 0994ea1e67 Fix issue with offset/origin when pasting a clipboard via API without wrapping into a BlockArrayClipboard 2021-12-30 16:05:16 +00:00
dordsor21 f30ea96268 Refactor: add javadoc to Clipboard#create and improve variables when delegating to another paste method 2021-12-30 16:04:38 +00:00
dordsor21 9faacb38ef Warn user if using small-edit history setting with extended world heights 2021-12-30 16:01:23 +00:00
dordsor21 235d0360da Don't wrap Exception thrown upon invalid schematic path inside a RuntimeException
Fixes #1506
2021-12-29 16:55:32 +00:00
dordsor21 52fa44516e Throw, catch, and rethrow our own exception to make sure we're finding the culprit to a possible shaded-FAWE. 2021-12-29 16:47:34 +00:00
dordsor21 9e8f0e7325 Refactor: getVersionMin/MaxY -> versionMin/MaxY 2021-12-29 16:44:41 +00:00
dordsor21 f505828af1 More enhanced switches 2021-12-29 16:44:18 +00:00
dordsor21 8d565b93f7 Compress switch statements a bit using enhanced 2021-12-29 16:39:44 +00:00
dordsor21 867b28d439 Remove remaining keywords frm CachedChanged. IJ doesn't warn? 2021-12-29 16:37:21 +00:00
dordsor21 fd3619f7b5 Merge branch 'major/2.0.0/1.18' of github.com:IntellectualSites/FastAsyncWorldEdit into major/2.0.0/1.18 2021-12-29 16:30:12 +00:00
dordsor21 3a3143065d Remove/add some more comments 2021-12-29 16:29:55 +00:00
dordsor21 ca5640e89e Replace CachedChange class with record 2021-12-29 16:16:23 +00:00
dordsor21 e5cbdec67e Remove unneeded comments 2021-12-29 16:14:13 +00:00
dordsor21 e2a1721a5c Use new language features 2021-12-29 16:12:43 +00:00
dordsor21 0d79d084a5 Rename worldedit to fawe where appropriate 2021-12-29 16:12:16 +00:00
dordsor21 3c2394afa4 Add comments to changed code 2021-12-29 16:06:49 +00:00
dordsor21 f38859237a Move to BinaryTags where appropriate in adapters 2021-12-29 16:00:49 +00:00
dordsor21 48e2953910 Update log4j version, update jd links to use "latest" 2021-12-29 15:30:25 +00:00
dordsor21 1a281badc2 Remove mentions of NMS from compilation instruction 2021-12-29 15:30:12 +00:00
JordanandGitHub 177d731957 Add back statically-set reserved IDs for air blocks only, make it clear they're "reserved" (#1502)
* Add back statically-set reserved IDs for air blocks only, make it clear they're "reserved"
Also:
 - Ensure that reserved is never returned in GET block operations
 - "empty" thus doesn't exist in the GET update methods; remove the needless checks
 - Allow GET/SET chunks to determine their own default values for non-present blocks/sections

* Add comments
2021-12-29 16:17:20 +01:00
dordsor21 bca3a1b04d More precise method names in MinecraftVersion
- Also ensure correct comparisons are made in FaweBukkit and BukkitServerInterface
 - Fixes #1504
2021-12-29 14:46:30 +00:00
dordsor21 c28a5ee66e Merge branch 'main' into major/2.0.0/1.18 2021-12-29 00:19:25 +00:00
dordsor21 d19369401f Don't force tick limiter enable/disable 2021-12-29 00:18:12 +00:00
dordsor21 3ec1912046 Fix tests 2021-12-28 23:22:59 +00:00