Commit Graph

299 Commits

Author SHA1 Message Date
Matthew Miller
865c3a24d2
Replace fast mode with a side effect system, with fine-grained control (#547)
* Speed up initial change buffering by removing streams and optional wrapping

* Bump the adapters for an experimental performance boost (Purely Bukkit 1.15.2)

* Bump adapters for fixes

* Bump adapters for further performance boosts

* Migrate fast mode to a BlockUpdates section, allowing fine-grained control

* Rename to SideEffect and clean up usage of the set

* Implement a 'usable' state

* Add a test command to demonstrate SideEffects. This is non-final

* Move //sideeffect into //fast

* Improve the box for //fast

* Switch to a system that includes "delayed" as a mode

* Remove the concept of configurable side effects, all are configurable. And each platform specifies what it supports.

* Implement side effects on other platforms (and spigot versions)

* Only use the side effects from the world editing platform

* Update from review

* Rename WorldApplyingExtent to SideEffectExtent

* More review fixes

* Update the World#applySideEffects return type to return the applied side effects

* Fixed requested changes

* Fixed checkstyle

* Improve setBlock javadocs

* Further improve

* Switch parameter name

* Fixed typo in translation key

* Temporarily remove DELAYED

* static final

* Side Effects = 7.2.0 snapshot
2020-03-08 16:09:36 +10:00
TheMolkaPL
a06b8342d3 Remove no-double-slash option from configs 2020-03-03 09:06:51 -05:00
Octavia Togami
947775b5e5
Read WE version from manifest ourselves 2020-02-10 17:11:08 -08:00
Matthew Miller
f111f6bfce
Significantly improve performance in ChunkBatchingExtent and other buffering extents (#550)
* Re-apply non-adapter performance boosts in separate PR

* Improved deprecation handling

* Move TODO
2020-02-07 20:28:14 +10:00
wizjany
68d48148d3 Revert "Revert "Add Vault as a softdepend to the Bukkit variant to prevent a warning from Spigot""
This reverts commit 376f241b7d.

Spigot bad. Also LP bad. This really shouldn't be necessary but it's
probably safer due to all the weird shit spigot and LP do.
2020-01-31 10:43:40 -05:00
Matthew Miller
0641409830 Bump adapters to fix errors 2020-01-30 20:51:44 +10:00
Matthew Miller
376f241b7d Revert "Add Vault as a softdepend to the Bukkit variant to prevent a warning from Spigot"
This reverts commit 33cf4c080b.
2020-01-30 20:40:20 +10:00
Octavia Togami
202f98699b
Improve speed of BSIA, clean up Int2BaseBlockMap (#548)
* Improve speed of BSIA, clean up Int2BaseBlock

* Fix some compile errors / bugs
2020-01-30 20:36:49 +10:00
Matthew Miller
33cf4c080b Add Vault as a softdepend to the Bukkit variant to prevent a warning from Spigot 2020-01-27 17:55:11 +10:00
Matthew Miller
8e55131a2f Bump bStats version and update 7.1.0 changelog 2020-01-24 22:38:52 +10:00
wizjany
a27ade54fc Add adapters for 1.15.2. 2020-01-21 18:13:37 -05:00
wizjany
05cc7aa021 Don't send bad packets to the client.
The adapter only can send a structure block change ID, so we shouldn't
attempt to send nbt for other block entities.
2020-01-09 21:16:30 -05:00
wizjany
a398c86d98 Make missing Bukkit impl adapter more user-friendly.
* 100s of "Unknown property" warnings in log aren't useful, only drown
  out the actual adapter warning
* Most people aren't looking at their console anyway, so hijack the old
  Actor#tellVersion to warn of missing adapters.
2020-01-07 18:05:52 -05:00
Matthew Miller
e198718a1e Fixed the adapt function for Actor -> Bukkit not working for players or command blocks 2020-01-04 16:29:32 +10:00
JOO200
3ed02aa1a8 BukkitAdapter: Add Bukkit CommandSender --> WorldEdit Actor (#539)
* BukkitAdapter: Added Bukkit CommandSender --> WorldEdit Actor

* Add a reverse adapter

Co-authored-by: Matthew Miller <mnmiller1@me.com>
2020-01-04 16:23:59 +10:00
wizjany
79c11c5ee9 Fix GC shenanigans in regen. 2019-12-21 00:20:48 -05:00
wizjany
2ce345b473 Update Bukkit adapter jar.
Fixes world-name shenanigans.
2019-12-20 20:04:05 -05:00
wizjany
07dc63eed3 Finalize adapters for 1.15.1.
No actual mapping changes, just setting the data versions.
2019-12-17 17:36:07 -05:00
Octavia Togami
18a55bc14e Add new experimental snapshot API (#524)
* Add new experimental snapshot API

This API intends to replace the existing snapshot API in WorldEdit 8.

It is currently experimental, and the old API is soft-deprecated. Once
it is determined to be stable, the old API will be removed and replaced
with this new one.

It uses TrueVFS instead of TrueZIP, due to the latter's status as
matinence-only, and the face that TrueVFS is NIO-FileSystem compatible,
allowing us to integrate it with NIO's native zipfs. The TrueVFS system
does encompass multiple modules, but users and download + install
truevfs-profile-default as a fatjar. We depend on that profile to show
this as the intended solution.

* Port commands to experimental snapshots. Legacy ones are in sibling classes.

* Add many tests, fix bugs

* Clean up imports

* Verify sorting behaviors, fix bugs

* Add license to test

* Add support for DIM region folders

* Fix tests for Windows paths

* Rewrite tests for even more coverage, fix bugs

* Clean up naming on tests

* Add test for legacy format

* Stop trying to abuse `file://`, use `snapfs:` instead

* Simplify iterPaths

* Use File.separator in FS snap tests

* Fix some bugs from T9N PR (#538)

* Use printInfo/printError to keep colors right

* Escape quotes before they go in the map

* I18N-ify new snapshot code
2019-12-16 21:00:12 +10:00
wizjany
47736abbdf Add Bukkit 1.15 adapters. 2019-12-10 20:20:11 -05:00
wizjany
28dbf19182 Bypass bukkit api for regeneration.
Done in impl adapter now.
2019-12-10 18:21:27 -05:00
Octavia Togami
05db204679
Merge master 2019-12-09 12:13:25 -08:00
Matthew Miller
679b00bde6
feat(i18n): add support for translatable text replacement (#478)
* Rebase translation work for easier rebasing

* Fixed gradle setup

* Further translations

* Add a few more strings

* Remove support for pluralisation to match Minecraft and alleviate issues with over-complexity

* Further translations

* Added a tonne more translations

* Added the remaining translation nodes

* When custom files are found, use the base files for default values.

* Only download translations if a key is provided

* Fixed typo in brush radius too large

* Allow translation files to be missing entries, and use the english version in place.

* Fixed issues brought up in review

* Reverse translation order (#533)

* Fix a lot of PR comments

* Add JD to the Operation warned field due to no private fields in J8

* Only warn when there are messages
2019-12-09 12:46:18 +10:00
wizjany
da2ab0293f Fix commands.
*cough*
2019-12-07 14:36:51 -05:00
wizjany
fcc048f8e1 Fix command labels, extra slashes. 2019-12-07 04:40:17 -05:00
wizjany
dd5b8b1a37 Fix /worldedit:xyz commands on Bukkit. (execution and completions) 2019-12-07 02:47:23 -05:00
wizjany
d81fd99340 Ensure we own commands before completing them. 2019-12-07 02:47:23 -05:00
Matthew Miller
0354edc145
Use commandblock name as session key (#535)
* Use commandblock name as session key

* Use a UUIDv3 with a given session prefix

* Use a UUIDv3

* Prefix the UUID and use a charset

* Fixed a few issues with using CommandBlocks

* Remove /worldedit:/ workaround
2019-12-07 16:27:04 +10:00
Matthew Miller
77ef0ae417
Bypass Bukkit in more situations (#532)
* Bypass Bukkit in more situations

* Use orElseGet

* Apply the same optimisation in the reverse BlockData adapter, and use lambdas instead of AIC

* Remove bukkit type checks

* Improve reliability of fallbacks
2019-11-15 12:02:46 +10:00
Kenzie Togami
91a78f725a
Some shading fixes 2019-10-19 00:48:49 -07:00
Kenzie Togami
03c0cce53e Update to Piston 0.5.2 + Doctools/Deprecation improvements (#523)
* Update to Piston 0.5.2

* [Doctools] Fix output, be verbose about deprecations

* Improve deprecation system, doctools output
2019-10-05 19:06:18 +10:00
wizjany
da0ef12239 Add Bukkit watchdog implementation. 2019-09-30 16:47:24 -04:00
Kenzie Togami
8af68fc884
Initial watchdog setup. Bukkit needs adapters, everything needs testing. 2019-09-29 22:09:55 -07:00
Kenzie Togami
0898adac99
Add defaultVerticalHeight to other configurations 2019-09-09 03:47:32 -07:00
Matthew Miller
0620478763
feature(cli): Added a CLI version of WorldEdit, and allowed most commands to be run from console (#508)
* Re-do commits to avoid awful rebase

* You can load and save a schematic file now. Still gotta setup ability to use commands as a console actor.

* Add a world override concept to LocalSession, and allow a lot more commands to be performed by actors.

* Fixed commands, and set the loaded schematic as the world override in CLI

* Properly load tags

* Added 1.14.4 data values

* Allow a majority of commands to be performed by the console.

* Fixed a lot of PR requested changes

* Added a Locatable interface and use that for getting the location of the player in commands.

* Added script support. Currently requires a newline at the end of the script.

* Shade everything to allow this to run locally - should probably minimize this to an extent later.

* Actually hook up the version

* Added a //world command to set the override

* Fixed a missed checkstyle issue

* Added CommandBlock support to Bukkit

* Make command block support configurable

* Minor cleanup and implementing a few of the final functions

* Fixed most issues from PR

* Improve UX, saving is now automatic and unknown command messages show

* Better save docs and support any clipboard format

* Include the entire formats list

* Arrays.copyOf

* Clear the world override if the selector is called on another world.

* Update logging extent to allow basic logging with non-player actors
2019-08-25 19:58:28 +10:00
Kenzie Togami
f472c20bfb Memory optimizations (#505)
* Remove LocatedBlock overhead in LBL map

* Add new space-efficient block map, with thourough testing

* Drop ordering property, add full insertion test

* Add licenses

* Fix mocked platform conflicts

* Disable full block map testing for faster builds

* Re-implement BlockMap with fastutil maps

* Re-write chunk batching to be memory efficient

* Make MultiStageReorder use BlockMap

* Increase LBL load factor, fix long-pack limit detection

* Fix infinite loop in chunk batching

* Save memory in history by cleaning up MSR

* Re-implement LocatedBlockList in BlockMap

* Fix data race with BlockType lazy fields

* Make IDs ALWAYS present, only runtime-consistent. Use for memory efficiency in BlockMap

* Remap inner structure of BlockMap for smaller maps

* Remove containedBlocks fields, not very efficient

* Fix minor de-optimizing bug in stage reorder

* Make long packed y signed

* Add extended Y limit configuration option

* Add licenses

* Store 3 ints for unoptimized BV list

* Add final to BitMath

* Correct int-cast for long-packing
2019-08-12 22:06:40 +10:00
wizjany
17cfdee347 Update/remove more dead links. 2019-08-06 23:07:26 -04:00
wizjany
95d5adb30c Update docs links to point to enginehub. 2019-08-06 21:49:43 -04:00
Kenzie Togami
76b608f90b
Fix suggestions on Bukkit for good 2019-07-27 23:31:38 -07:00
wizjany
0f420f02ff Fix some load-order issues probably.
Edge cases might still exist around plugins which use WE for initial
world-gen, or in general plugins that try to access the platform
before it's ready.
2019-07-27 11:45:21 -04:00
wizjany
2cc6a367c6 Move floatAt logic to AbstractPlayer, add isAllowedToFly and setFlying. 2019-07-23 22:16:26 -04:00
wizjany
e504c29df6 Fix potential race condition.
I guess.
2019-07-23 21:41:39 -04:00
wizjany
a65351e43e Don't load old adapters. 2019-07-19 21:19:09 -04:00
wizjany
7c41949f40 Update bukkit adapters for 1.14.4. 2019-07-19 20:44:39 -04:00
Kenzie Togami
3b157b67c3
Move Bukkit to JUnit 5 2019-07-15 16:38:33 -07:00
Kenzie Togami
429d022752
Move Core to JUnit 5 2019-07-15 16:38:33 -07:00
Kenzie Togami
ab8397e517
Migrate Bukkit to Kotlin DSL 2019-07-12 13:49:45 -07:00
Kenzie Togami
19802e478c
Re-write root and libs to Kotlin DSL 2019-07-12 13:49:45 -07:00
wizjany
a18f26f8af Play nicer with naughty plugins. 2019-07-06 09:44:53 -04:00
wizjany
625cbe5e3d Make //count take a mask. Also doc updates, perm fixes. 2019-06-30 00:38:17 -04:00
wizjany
d763ab374c
Re-add delchunks command (#481)
The new command now writes a json file to WorldEdit's working directory with instructions on which chunks to delete, which is read by the plugin/mod at startup and calls the ChunkDeleter.
The chunk deleter parses the json and iterates the instructions, backing up .mca files as it goes and overwriting the offset headers with 0 wherever a chunk needs to be deleted.
This allows Minecraft to reclaim the space used for that chunk, as well as forcing it to be generated from scratch next time the area is loaded.
2019-06-22 14:20:14 -04:00
wizjany
0088fe79b3 Cleanup Bukkit internal id usage. 2019-06-15 17:33:17 +10:00
Kenzie Togami
27c7d488a2 Add perf. improvments for Forge 2019-06-15 17:33:17 +10:00
Kenzie Togami
8c17aab9c5 Clean-up some misc. parts of the code 2019-06-15 17:33:17 +10:00
wizjany
dc21b4df58 This does something idk. 2019-06-15 17:33:17 +10:00
Kenzie Togami
a3a175ab8c Initial attempt at binding state IDs 2019-06-15 17:33:17 +10:00
wizjany
e1c191599c Implement item brushes and item NBT for bukkit.
This allows usage of `/br <apply|paint> <shape> item` and the `offhand`
syntax for item parser to use NBT.
2019-06-14 16:37:23 -04:00
wizjany
213cadf093 Import cleanup, ensure gradle uses https for deps, bump deps. 2019-06-13 09:17:00 -04:00
wizjany
efb7650d6f Fix some reload issues.
And some unload issues.
2019-06-11 18:02:24 -04:00
wizjany
3fd661c513 Don't attempt to check unloaded world refs. 2019-06-08 11:25:36 -04:00
wizjany
e3097dd0fc Use java-library to exclude some deps. 2019-06-03 23:56:34 -04:00
wizjany
3df2410254 Change chunk loading method.
Behavior of loadChunk changed a lot for the worse in CB 1.14.
2019-06-02 21:56:29 -04:00
wizjany
1e7c074217 Few misc command fixes. 2019-06-01 09:35:27 -04:00
wizjany
59447c6ee3
Gradle sucks. 2019-05-31 13:53:28 -04:00
wizjany
44ee1546b7
Apparently CB uses this. 2019-05-31 11:48:08 -04:00
wizjany
4e43595c99
Fix builds maybe. 2019-05-31 11:24:38 -04:00
wizjany
6ad274677f Don't require command for CUI init. 2019-05-29 23:15:06 -04:00
wizjany
ec3648e521 Wrap and unwrap.
Exceptions are fun.
2019-05-29 23:15:05 -04:00
wizjany
6962b2e7b6 Add comprehensive suggestions to many commands.
All patterns now have suggestions, including recursive patterns.
Suggestions will suggest blocks and block states.
All masks now have suggestions, though mask intersections are not
yet supported due to issues with quotes strings.
EntityRemover and ItemFactory now also have completions, as well
as all RegistryConverters (though I am unsure how many are actually
used).

Also use paper's AsyncTabComplete event, if available.
2019-05-28 22:55:20 -04:00
wizjany
871c25e1cd Initial support for 1.14.2. 2019-05-27 19:52:58 -04:00
wizjany
48fb669119 Guard against reloads breaking too much. 2019-05-25 18:11:23 -04:00
wizjany
7b47d9a945
Add /tracemask. (#474)
Allows setting a mask used for block traces. This allows brush tools to
pass through various materials, such as water (e.g. `/tracemask #solid`
or `/tracemask !air,water`) before starting to build.
By default, a null mask is equivalent to #existing (original behavior).

https://gfycat.com/ImmaculateFrayedCockatiel
2019-05-23 21:12:31 -04:00
wizjany
b0777f6b06 Use DFUs for some additional data fixing.
Legacy mapper now uses the data fixers to upgrade blocks and item types
(e.g. signs, dyes that changed names in 1.14).
The sponge schematic reader can now attempt to use the data fixers to
upgrade blocks, block entities, biomes and entities. This has been
tested with the 1.13 -> 1.14 changes. It is yet to be seen if it will
continue to work because...
The mc edit schematic reader has code for using data fixers, but it is
currently disabled as there seem to be some issues with fixing up older
block entities.
2019-05-20 16:39:58 -04:00
wizjany
334d5cfaab The "spawner|mobType" syntax once again makes functional mob spawners.
Also fix block parser context not being restricted.
2019-05-18 10:16:08 -04:00
wizjany
41cfcb6d55 Use a jar for bukkit impl adapters.
120 class files is a bit much.
2019-05-14 18:34:53 -04:00
wizjany
931b7ee694 Update for 1.14.1 2019-05-14 00:09:21 -04:00
wizjany
f9d0d340e7 Add DFUs. Currently used by //restore. 2019-05-13 23:07:53 -04:00
wizjany
5c97418cca Fix NBT list conversion in 1.14. 2019-05-13 18:49:43 -04:00
Kenzie Togami
8a3e6a12b9 Implement suggestions for Bukkit + Sponge 2019-05-05 23:06:20 -07:00
Kenzie Togami
acc0e7d09c Fix logging on Bukkit, align adapter versions 2019-05-05 23:06:20 -07:00
wizjany
ceff17c4f7 Misc fixes.
Closes a few old youtrack issues which I don't remember because I had
like 30 tabs open, and a few other issues which I found while testing
some of those.
2019-05-05 15:15:03 -04:00
wizjany
57c161a602 Actually initialize GameModes and WeatherTypes. 2019-05-02 00:08:19 -04:00
Kenzie Togami
13a8c480e3 Insert Locale.ROOT into all case change methods 2019-05-01 15:24:32 -07:00
Kenzie Togami
7c1764548d
Deprecate old system, still in use by WG/CB 2019-04-30 13:53:14 -07:00
wizjany
3c04a83852 Add nicer error when using player commands as console.
Also fix slash counts for Bukkit.
2019-04-29 17:39:30 -04:00
wizjany
b3053f19ce Pagination changes and cleanup.
Refactored PaginationBox to be abstract. Implementations can generate individual components as needed now.
Add lots of Component usage to schematic list, help listings, etc.
Fix a few schematic and file resolution issues.
2019-04-28 01:12:05 -04:00
Matthew Miller
62353a46db Added a pagination box and use it in Biome List and Chunk List 2019-04-27 21:57:45 +10:00
Kenzie Togami
7ff537138a
Merge master again 2019-04-26 01:25:42 -07:00
Kenzie Togami
b8c120e0c4
Finish porting commands 2019-04-26 01:18:02 -07:00
wizjany
31a8328fb5 Add data version to BukkitImplAdapter.
Also throttle unknown-block warning when loading MCEdit schematics.
2019-04-26 16:41:39 +10:00
wizjany
17fba54305 Update SpongeSchematic format to version 2.
Allows saving and loading entities and biomes.
2019-04-26 16:41:39 +10:00
Kenzie Togami
853bfab022
Merge master, update to texts 2019-04-25 22:11:46 -07:00
Matthew Miller
c325b789b2 Revert lighting changes and add a 1.14 adapter 2019-04-25 23:15:09 +10:00
Matthew Miller
f70557e3da Provide a warning when an invalid property is entered rather than failing. Fixes WorldEdit entirely failing on new MC versions. 2019-04-25 22:48:15 +10:00
Matthew Miller
c52eb59d7f Get it all working 2019-04-22 22:05:20 +10:00
Kenzie Togami
5c19866809
Some fixes for new libs shading 2019-04-20 23:33:54 -07:00
Kenzie Togami
1e7b4fc835
Move shaded libraries to their own artifacts 2019-04-20 23:11:39 -07:00
Matthew Miller
5b1573a24e Replace the message system 2019-04-19 23:06:00 +10:00
Matthew Miller
55348346e9 Shade in Kashike's lib 2019-04-19 14:49:29 +10:00
Kenzie Togami
ac03de89cc
Work on adding converters for some arguments 2019-04-18 19:11:57 -07:00