Commit Graph

124 Commits

Author SHA1 Message Date
8af68fc884 Initial watchdog setup. Bukkit needs adapters, everything needs testing. 2019-09-29 22:09:55 -07:00
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
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
e25a6d21cd Add -e/-b/-m flags to //stack and //move, to match copy and paste.
Fixes WORLDEDIT-3935.
2019-08-05 22:47:57 -04:00
4b54c32f3a Skip invalid blocks in schematics. 2019-08-04 15:56:16 -04:00
afae2b0784 Make TE tag optional for MCEdit schems too.
And name our threads here too.
2019-08-01 20:15:34 -04:00
f4c238c3da Load chunks when setting biomes too. 2019-07-28 10:21:29 -04:00
415cdc0ab2 Output to debug only if we have a valid DFU for schematics.
Warn for backwards (since we can't DFU) and info for missing DFU
(since it might still be compatible).
Under normal circumstances, a DFU should be available so we'll only
log to debug (which is generally off).
2019-07-24 19:05:39 -04:00
8545417b3a Fix error in /up when used out of bounds.
Also reduce calls to Entity#getLocation() all over since it's
more expensive than it needs to be (adapts world/vector every time).
2019-07-23 22:16:26 -04:00
edb2e919e7 Add more id conversions.
Bukkit apparently lower cases these for us, but not Forge.
(And invalid block entities are fine - invalid keys are not).
2019-07-19 21:45:25 -04:00
f75104f2ac Actually use fixed IDs in MCEdit reader.
Fixes WORLDEDIT-3947.
2019-07-16 19:45:27 -04:00
f2c47f3759 License for new class 2019-07-04 11:55:27 -07:00
99ee32fe8e Many fixes for buffered extents 2019-07-04 11:43:36 -07:00
d27daefd3e Implement getBlock for chunk batching extent
Also improve speed of comparators, by using ::comparingX and bitwise
ops.
2019-07-03 21:11:36 -07:00
79910c57d7 Add 1.14 blocks, items, entities, and tags. (#490)
Should remain backwards compatible with 1.13. Removed blocks/items will
be forwarded to the "replacement" block/item. (e.g. BlockTypes.SIGN will
find OAK_SIGN on 1.14.)
2019-06-24 23:15:07 -04:00
902754ce8a Bit more cleanup for schematic handling. 2019-06-21 11:07:03 -04:00
a3d23fdcea Fix requirements of sponge schematic spec.
Fixes WORLDEDIT-3929.
2019-06-20 18:51:29 -04:00
0aa0dbfd11 Fix BlockTransformExtent rotating directional boolean properties.
Also add support for redstone dust, which is directional non-boolean.
(It's the only block like this atm.)
2019-06-15 13:35:23 -04:00
213cadf093 Import cleanup, ensure gradle uses https for deps, bump deps. 2019-06-13 09:17:00 -04:00
38607f387a Added a permission node to set NBT data, allowing servers to disallow NBT interactions. 2019-06-01 15:53:18 +10:00
4b15439e03 Don't attempt to update empty or invalid flower pots. 2019-05-25 00:35:12 -04:00
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
56908a7d62 Update to final Sponge schem v2 spec.
Read lenient, write strict.
2019-05-09 16:59:06 -04:00
13a8c480e3 Insert Locale.ROOT into all case change methods 2019-05-01 15:24:32 -07:00
e06c8b84b4 Merge branch 'master' into feature/piston-commands 2019-04-29 22:44:15 -07:00
d48702aad6 Fix schematic id conversion for entities with multiple renames. 2019-04-28 10:56:34 -04:00
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
b7ea46db2f Re-add 1.13 entity renames.
Accidentally replaced the new ones with the old ones.
This is why we need DFUs.
2019-04-26 21:48:03 -04:00
31a8328fb5 Add data version to BukkitImplAdapter.
Also throttle unknown-block warning when loading MCEdit schematics.
2019-04-26 16:41:39 +10:00
f0587354be Cleanup, make copy/paste flags consistent, add status messages. 2019-04-26 16:41:39 +10:00
17fba54305 Update SpongeSchematic format to version 2.
Allows saving and loading entities and biomes.
2019-04-26 16:41:39 +10:00
af1af43ac1 Allow copy/pasting biomes.
Copy takes a -b flag to copy biomes.
Paste takes a -b flag to paste biomes (if available).
This allows flexibility to create/load schematics with/without biomes
(when schematic biome support is added).

Also added a -m mask flag to paste to set a source mask, and a -e flag
to skip pasting entities if they are loaded.
2019-04-26 16:41:39 +10:00
26511bcc25 Add licenses. 2019-04-26 16:41:39 +10:00
fcb42f05cf Add skull handler. 2019-04-26 16:41:39 +10:00
526b3366b5 Add more schematic compat, cleanup. 2019-04-26 16:41:39 +10:00
bfc1fd8fd0 Add licenses 2019-04-26 16:41:39 +10:00
56ef786415 Don't touch the Direction tag, as possibly only Facing changed. 2019-04-26 16:41:39 +10:00
efc4ebe309 Fix 1.13 entity direction code, port old schematics 2019-04-26 16:41:39 +10:00
a80420d14b Add biome storage to BlockArrayClipboard. 2019-03-30 00:42:28 -04:00
42d0d6e79a Use getTag instead of requireTag in a few places. 2019-03-29 23:44:18 -04:00
d6804737cf Switch to SLF4J logging. 2019-03-13 19:51:48 -07:00
7c89ece96e Few tweaks to schematic loading and error fixes.
* Not all EntityTypes in Bukkit have the correct enum name.
* Don't read entire schematic files to list. Go off file extension only.
   (Reading in files is more accurate, but slow.)
* Enforce extensions. (Due to the above, while you can technically make a
   schematic called 'test.txt', it's better that we save it as
   'test.txt.schem'.)
* Fix a few minor warnings.
2019-03-08 16:00:49 -05:00
1b101740fe Use a proper registry for biomes 2019-02-16 17:27:00 +10:00
88014b18a3 Added a few new things using block states.
* `//set ##*tag` sets all states in the tag (not just default state per type)
* `//set ^type` is a pattern changing block type but copying all valid existing states
* `//set ^[prop=val,...]` sets the property `prop` to `val` wherever the existing block has that property
* `//set ^type[prop=val,...]` does both of the above
Those work anywhere a pattern is taken, of course.

* The mask syntax `^[prop=val]` matches blocks with the property `prop` set to `val`, or blocks that don't have the property at all.
* The mask syntax `^=[prop=val]` only matches blocks that have the property.
Those work anywhere a mask is taken, of course. (`//mask`, `//gmask`, `//replace`, etc)

The `//drain` command now takes `-w` flag that removes the waterlogged state from blocks (in addition to removing water, as before).
2019-02-14 17:21:01 -05:00
2f9c7f19f5 Added support for 'rotation' BlockState values. 2019-01-22 21:59:20 +10:00
2e0fa300b7 Actually support disabling chunk loading extent 2019-01-22 21:34:37 +10:00
432a201266 Make biome changes undoable 2019-01-21 19:07:29 +01:00
871541d8c0 Tweak the last access extent cache to provide better caching 2018-12-29 19:21:45 +10:00
3fefcbf971 Remove all raw usages of BSH, improve API generics 2018-12-26 16:39:10 -08:00
c949b07df1 Added a method to teleport entities across worlds. 2018-12-21 16:56:10 +10:00