Commit Graph

332 Commits

Author SHA1 Message Date
dordsor21
c4abc9a247 Allow regeneration to accept Extents instead of EditSessions.
Allows for custom Extents to be parsed to regen, and for clipboard regeneration, etc whilst still allowing EditSessions
2020-07-26 13:22:26 +10:00
Octavia Togami
213239ee94
Restore overworld check for bukkit 2020-07-15 20:12:33 -07:00
wizjany
9aea9f2b9c Add updated bukkit adapter. 2020-07-15 20:10:25 -07:00
Octavia Togami
5803cb10b5 Fix 3D biome support testing
3D biomes always work on dedicated servers, at least as far as the
client knows. This is so terrible though. Mojang why.
2020-07-15 20:10:25 -07:00
Octavia Togami
7134ff4494
Remove all compile deps, use api/impl as appropriate 2020-07-15 18:48:47 -07:00
wizjany
9d9aaac15a Add fungi and chorus plant tree types.
Closes #1411.
2020-07-12 14:34:48 -04:00
Octavia Togami
22acd2b486
Error if loaded in even OLDER versions of Bukkit
Take that, 1.8 servers.
2020-07-11 19:29:50 -07:00
Octavia Togami
f023b46fae
Error + disable if loaded in old MC versions on Bukkit 2020-07-11 19:20:09 -07:00
wizjany
373f86953b Update adapter jar for file deletion fix.
Fixes #1427.
2020-07-09 23:54:33 -04:00
Octavia Togami
81f6e3e7cf Cleanup some javac warnings 2020-07-07 20:38:57 -07:00
Octavia Togami
eb52afa296 Create a brand new checkstyle config
And also apply it!
2020-07-07 20:38:57 -07:00
Octavia Togami
781abd511d Add final to many fields 2020-07-07 20:38:57 -07:00
Matthew Miller
9b4bfbed2d
Localise WorldEditException and error handling (#1393)
* Localise the ExceptionConverter

* Further work on localising exceptions

* Everything but input parsing is now localised

* Finish making errors localisable

* Fixed a few notes from review

* Fixed another spot

* More changes

* Specialise parser errors
2020-07-05 14:57:13 +10:00
Octavia Togami
bf6cd1ea08
Regeneration Options (#1415)
* Add RegenOptions to the API

* Integerate regen options into //regen

* Rename isRegenBiomes to shouldRegenBiomes

* Go through the EditSession for setting biomes

* Respect 3D biome support in regen

* Add RegenOptions implementation for 1.16 Bukkit adapter.

Co-authored-by: wizjany <wizjany@gmail.com>
2020-07-03 22:17:34 -07:00
Octavia Togami
71e104bcb1
Replace setPosition with trySetPosition (#1403)
Allows cancellation information to be fed back into the ascend/descend
algorithms.
2020-07-01 08:24:58 -07:00
Octavia Togami
8aa034c78f
Fix or suppress deprecation warnings in most code (#1404)
Didn't touch commands or some of Sponge
2020-07-01 08:24:42 -07:00
wizjany
410d4c5eee Return correct world folders on Bukkit, used in /delchunks.
Fixes #1365.
2020-06-24 23:56:48 -04:00
wizjany
9e186225bd Update adapter jar. 2020-06-24 23:30:55 -04:00
Octavia Togami
6513513b3e
Mojang AB and the Column Biome Fuzzer (#1376)
* Allow API detection of the biome fuzzer in use

This allows us to warn, fix, or optimize biome edits to the overworld.

* Drop edits to Y = 0 for biomes in overworld

* Re-work ArbitraryBiomeShape to simplify logic

Also fixes not being able to use THE_VOID with it
2020-06-23 23:33:20 -07:00
Matthew Miller
f5e36ed8a8
Add 3D biomes support (Adds #1358) (#1361)
* Initial work on 3D biomes. Not implemented for Bukkit, and history is unfinished

* Further implement 3D Biomes. It's now usable on Forge/Fabric

* Fix a few cases of apply. Gotta fix the deprecated methods at some point

* Add Bukkit support

* Add clipboard support. Schematics are still not great, but the Sponge schem format doesn't support this yet.

* Fix the last of the issues

* Fixed up review comments

* Fixed review notes

* Simplify

* max is inclusive

* Standardize non-abstract compatibility handling

Co-authored-by: Octavia Togami <octavia.togami@gmail.com>
2020-06-22 09:25:49 +10:00
wizjany
57d62b0bf5
Count wandering traders as NPCs for /butcher. (#1359)
* Count wandering traders as NPCs for /butcher.

Fixes #1347.

* Change variable case.
2020-06-14 13:55:14 +10:00
Matthew Miller
495ac44f5c
feat(tool): added stack tool (#1338)
* feat(tool): added stack tool

* Implement review comments

* Don't register an alias for stacker

* Apply suggestions

* Fixed /stacker alias

* Indent

* Update worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java

Co-authored-by: Octavia Togami <octavia.togami@gmail.com>

* Update worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java

Co-authored-by: Octavia Togami <octavia.togami@gmail.com>

* Remove unused imports

Co-authored-by: Octavia Togami <octavia.togami@gmail.com>
2020-06-13 14:25:37 +10:00
Matthew Miller
267fe1ffe0
feat(i18n): use a translation loader to allow CB/WG to use WorldEdit's TranslationManager (#1327)
* feat(i18n): use a translation loader to allow CB/WG to use WorldEdit's TranslationManager

* Replace the old ResourceLoader with the new one

* Make ResourceLoader per-platform

* Update worldedit-core/src/main/java/com/sk89q/worldedit/util/io/WorldEditResourceLoader.java

* Improve the impl to allow a default

* Update based on review suggestions

* Local resource should be pathName too

* Delegate to getRootResource, and prevent pathName from starting with /

* HTML

* Format javadoc a little better

Co-authored-by: Octavia Togami <octavia.togami@gmail.com>
2020-05-14 17:40:11 +10:00
Matthew Miller
7a8c512916 Fixed typo in default disallowed blocks on Bukkit 2020-05-11 20:57:42 +10:00
Octavia Togami
3fdb10ad15
Delay command block active update if needed (#1285)
* Delay command block active update if needed

If we are checking if a command block session is active, and we are not
on the main thread, schedule a task instead to update the active status
eventually, rather than waiting on the main thread.

Fixes #1284.

* What's that? Non-static state, you say?

Just saw we have a field for the plugin here. Might as well use it.

* Check if chunk is loaded for sender before type
2020-04-19 13:08:44 -07:00
Octavia Togami
5ab71109b5
De-dup Bukkit argument rebuilding code 2020-04-04 11:30:22 -07:00
Octavia Togami
7d4563a3ab
Fix onAsyncTabComplete handling of invalid values
This fixes #1281, by just ignoring weird tab completion requests.
2020-04-04 11:05:58 -07:00
Octavia Togami
cfd26253b6
Names via Translation (#1268)
* Deprecate BiomeRegistry, etc.

* Update some libraries, e.g. text

* Move to new translation renderer

* Revert "Deprecate BiomeRegistry, etc."

This reverts commit 59a5d6c92aec52739a8dc68ac3d23898af7593dd.

This was not a good idea for potential mod shenanigans.

* Move BiomeData#getName to BiomeRegistry, use i18n

* Use getRichName instead of getName

* Implement getRichName for NullBiomeRegistry

* Add getRichName for blocks

* Relocate net.kyori.minecraft

* Update adapters for getRichBlockName

* Add getRichName for items

* Update adapters for getRichItemName

* Update adapters JAR for merge
2020-03-23 15:47:27 -07:00
Octavia Togami
2f4c44f80c
Validate placed blocks / WNA (#1263)
* Optionally validate placed blocks

This allows re-connection of fences, chests, panes, etc.; removal of
blocks in invalid states; and more!

The Connections side-effect already did this for neighbors, so this is
now renamed to Validation for accuracy, and left on by default.

This also fixes some inconsistencies between the Fabric & Forge
markAndNotifyBlock function.

* Add forge comment to fabric world

* Add WorldNativeAccess common logic

* Add Fabric WNA

* Add Bukkit WNA for adapters

* Fix imports for new Fabric mappings

* Pass raw world ref to Bukkit adapters

* Remove client-only block update call

We always assume a server world.

* Allow WNA impls to inspect side-effects

* Update adapters for WNA

* Licenses

* Fix adapter JAR

* Generify EVENTS side effect

* Update adapters for EVENTS change
2020-03-22 21:02:04 -07:00
Octavia Togami
1c6b1b3848
Merge master 2020-03-22 20:41:03 -07:00
Octavia Togami
20d630ce5b
Only add adapters to dist jar 2020-03-22 15:00:02 -07:00
ㄗㄠˋ ㄑㄧˊ
47db40f957
use JavaPlugin.getResource() instead of JarFile.getEntry() (#566)
* use JavaPlugin.getResource() instead of JarFile.getEntry()

* use try-with-resources

* fix typo
2020-03-19 13:39:21 -04:00
wizjany
25ec78f355 Update adapters. 2020-03-16 16:31:29 -04:00
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