Commit Graph
100 Commits
Author SHA1 Message Date
wizjany 9a913a93f6 Fix throwing uncaught exceptions in AsyncCommandBuilder. 2019-05-13 18:49:43 -04:00
wizjany 7b170d8193 Run schematic-file I/O in a task. 2019-05-12 16:01:22 -04:00
wizjany fab21c3eea Add AsyncCommandBuilder as replacement for AsyncCommandHelper.
See full explanation at https://github.com/EngineHub/WorldGuard/pull/408
2019-05-12 14:36:57 -04:00
wizjany aed25fce7c Add license. 2019-05-11 21:36:13 -04:00
wizjany 56908a7d62 Update to final Sponge schem v2 spec.
Read lenient, write strict.
2019-05-09 16:59:06 -04:00
wizjany e2e903ca5e Pass service to brush sub-commands too. 2019-05-09 11:14:10 -04:00
wizjany c169d8f258 Re-use command manager service. 2019-05-09 10:28:08 -04:00
wizjany 31d4daf474 Don't compare null BlockStates. 2019-05-06 19:59:58 -04:00
wizjanyandGitHub db98cdad0b Update text-adapters to 3.0.1
Should fix shading issues.
2019-05-06 09:11:15 -04: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 bc8e477b1c Fix error message with invalid //expand args. 2019-05-04 22:48:49 -04:00
wizjany ac66ab66c3 Remove mentions of setupDecompWorkspace in COMPILING.md.
This task is no longer needed or used.
Fixes WORLDEDIT-3886.
2019-05-04 21:00:00 -04:00
wizjany f279907616 Create CommandManagerService directly instead of service loading it. 2019-05-04 17:06:19 -04:00
wizjany 018b6bead8 Tweak removeabove/removebelow commands.
Fix misplaced negative.
Layer 0 will always be the current layer, plus <height> layers
above/below. No longer adds 1 arbitrarily to height.
2019-05-02 19:01:28 -04:00
wizjany 57c161a602 Actually initialize GameModes and WeatherTypes. 2019-05-02 00:08:19 -04:00
wizjany 5e81dd1c4c Make registries Keyed. 2019-05-01 20:12:35 -04:00
wizjanyandGitHub b47c70025e Merge pull request #464 from EngineHub/feature/piston-commands
Piston command system.
2019-05-01 00:33:43 -04: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 8baf221c95 Hide help buttons in //sel selector box. 2019-04-29 17:38:26 -04:00
wizjany d48702aad6 Fix schematic id conversion for entities with multiple renames. 2019-04-28 10:56:34 -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
wizjany 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
wizjany 07ff4e97c1 Add logo to source. 2019-04-26 15:08:50 -04:00
wizjanyandMatthew Miller 648ecf2153 Add entity, biome, and mask flags to clipboard brush. 2019-04-26 16:41:39 +10:00
wizjanyandMatthew Miller 31a8328fb5 Add data version to BukkitImplAdapter.
Also throttle unknown-block warning when loading MCEdit schematics.
2019-04-26 16:41:39 +10:00
wizjanyandMatthew Miller f0587354be Cleanup, make copy/paste flags consistent, add status messages. 2019-04-26 16:41:39 +10:00
wizjanyandMatthew Miller 17fba54305 Update SpongeSchematic format to version 2.
Allows saving and loading entities and biomes.
2019-04-26 16:41:39 +10:00
wizjanyandMatthew Miller 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
wizjanyandMatthew Miller 26511bcc25 Add licenses. 2019-04-26 16:41:39 +10:00
wizjanyandMatthew Miller fcb42f05cf Add skull handler. 2019-04-26 16:41:39 +10:00
wizjanyandMatthew Miller 526b3366b5 Add more schematic compat, cleanup. 2019-04-26 16:41:39 +10:00
wizjany a9926328f1 Stop trying to redo when history runs out. 2019-04-20 12:14:11 -04:00
wizjany 99da55dc94 Fix building above bounds. 2019-04-15 20:44:02 -04:00
wizjany 2a1fdf470f Implement getMaxY for ForgeWorld.
Should play nicer with things like CubicChunks. Note that there is no
way to get the min point in Minecraft itself, so this only supports
going up, not down.
2019-04-14 11:16:49 -04:00
wizjany ec0422d682 Avoid atan2 in Location cinit.
@kashike
2019-04-06 21:26:52 -04:00
wizjany dcfb769d96 Fix TrueZip region stores.
I think. Someone tell me if this breaks their setup with truezip, but
it works for me now and didn't before. I'm assuming people using .zip
just used the normal zip store anyway.
2019-04-06 13:22:20 -04:00
wizjany fa8139f4b3 Transfer Request to evaluation thread for Expressions. 2019-04-05 14:46:56 -04:00
wizjany 961da1b93f Add BukkitPlayer constructor without plugin.
tbh I don't know why we even need to keep the plugin object around.
2019-03-30 17:32:10 -04:00
wizjany a80420d14b Add biome storage to BlockArrayClipboard. 2019-03-30 00:42:28 -04:00
wizjany 4e66b9a336 Revert 6b3426e1.
Empty base blocks are always immutable. Fuzzy states don't have NBT.
2019-03-30 00:41:47 -04:00
wizjany 42d0d6e79a Use getTag instead of requireTag in a few places. 2019-03-29 23:44:18 -04:00
wizjany d7d2d03ee8 Clipboard offset pattern is now #copy@[x,y,z].
Since the parsers were changed around, unescaped commas are parsed as
separate blocks now.
2019-03-27 23:36:59 -04:00
wizjany 74bff83e38 Don't let items types be null.
Better fail-fast if registry doesn't load? or why-ever else this happens
2019-03-26 22:30:46 -04:00
wizjany 6b3426e1de BaseBlock is technically mutable so that technically shouldn't use it. 2019-03-26 18:14:35 -04:00
wizjany 2a194b0434 Add pattern that randomly chooses states.
Also works with fuzzy states.

Syntax is `*type`, e.g. `//set *stone_slab` or with states,
`//set *oak_fence[waterlogged=false]`
2019-03-26 18:11:32 -04:00
wizjany 8eccdc7444 Add -f flag to //count to allow fuzzy inputs.
Also re-implement //distr -c. And remove outdated help text on //copy.
2019-03-25 22:38:51 -04:00
wizjany 692ba6fda3 Checkstyle. 2019-03-22 14:03:43 -04:00
wizjany 9b473cecbd Fixes and changes to forest/forestgen.
* Sync up implementations of the two commands.
* Fix generating trees in spots with replaceable blocks.
* Make message when you mistype tree-type arg more correct.

Fixes WORLDEDIT-3869.
2019-03-20 21:05:11 -04:00
wizjany 1934006d14 Better enforce the Request lifetime.
Previously, the current request would just get a new EditSession when
one was created. Now, a Request is reset before and after:
 - a command is used and
 - an interact is fired with the platform
This means each action taken will get a single, non-reusable Request.

Note that this only applies to actions taken through the platform.
API users will not be using requests anyway, since things like Masks,
etc. will be constructed directly instead of being passed through the
platform's parsers and so on. (e.g. if a plugin loads a schematic into
the world with a mask, they should create the EditSession and mask it
directly, and not use that Mask again for another EditSession in another
World).

Also, get rid of a bunch of (some now-)unnecessary EditSession creation
during command dispatching.

Note that this also fixed the dynamic selection mask, which apparently
has been broken for some unknown amount of time.
2019-03-20 19:13:54 -04:00
wizjany 25631af31c Add RequestExtent to be used when a delayed EditSession is needed.
For example, if you set a mask that takes an extent (many of them),
and then move to another world, the mask will test blocks in the old
world and return bad results.
2019-03-20 19:13:54 -04:00
wizjany d1c2a029bf Move some platform stuff to load, put enable back to postworld. 2019-03-15 23:43:57 -04:00
wizjany 678a78a982 Update adapters.
Don't update unchanged blocks, do change NBT, no need to light.

Also clean up the forge side a bit.
2019-03-15 20:56:49 -04:00
wizjany c885f70c7b Load Bukkit plugin at startup.
This should allow plugins that use WorldEdit to do things on world load.
2019-03-15 18:38:06 -04:00
wizjany 9d2d43f0db Add -f to //schem save to confirm overwriting.
Overwriting existing schematics now checks delete perm.
Also allow delete to be run from console.

Fixes WORLDEDIT-3868.
2019-03-15 17:08:11 -04:00
wizjany 18414fe3b5 Fix symlink detection. 2019-03-15 09:10:51 -04:00
wizjany 4f0506ec8b Fix versions in toml. Use internalversion (with git hash). 2019-03-12 17:30:45 -04:00
wizjany 1c5d3368a0 Defer permissions check when making LocalSession.
Also use Java7 Paths to get rid of some funky logic.
2019-03-11 21:31:43 -04:00
wizjany a59d994d84 Hook up the biome registry. 2019-03-11 00:15:21 -04:00
wizjany 6192ba8dc1 Checkstyle fixes and warnings.
Should get 'working' builds now.
2019-03-11 00:02:51 -04:00
wizjany 6937cfc9a9 Need internal ID for EntityType here too. 2019-03-09 10:46:40 -05:00
wizjany a22b5535fe Shh checkstyle, I'm a C# dev now. 2019-03-08 16:14:16 -05:00
wizjany 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
wizjany eebba8e324 Move vault to permscompat. 2019-03-07 23:55:58 -05:00
wizjanyandGitHub de08c8b8c7 Add better control over expression timeouts. (#451)
Add better control over expression timeouts.
* //timeout command can be used to change player's current timeout.
* Config now also has a max timeout, can be bypassed with permission
* Timeout of < 0 will let expressions run indefinitely.
* Said expressions won't run on a separate thread, slightly reducing the
  overhead from context switching. For large //gen commands, for example,
  this can actually increase speed.
2019-03-06 19:58:32 -05:00
wizjany f84f3c6f85 Fix error when parsing hand/offhand/pos1 as blocks. 2019-03-03 19:51:49 -05:00
wizjany aafb854e4f More useful names for block ItemTypes. 2019-03-02 12:26:26 -05:00
wizjany c3ee926a2e Correctness improvement for legacy data in expression generation. 2019-03-02 11:55:03 -05:00
wizjany e53962dadd Apply source function after source mask in ForwardExtentCopy.
The source function should only get applied to actually copied blocks.
2019-03-01 21:15:21 -05:00
wizjany f46c70093c Fix the long-range build tool's ability to build mid-air. 2019-03-01 20:10:46 -05:00
wizjany 0656ef1920 Fix LayerVisitor stopping early instead of skipping covered columns. 2019-03-01 19:25:10 -05:00
wizjany 4bd6d73085 Fix some bad copy-pasta in expression environment queries. 2019-02-28 01:03:02 -05:00
wizjany 243d6476ac Re-add smooth filtering via a mask.
Instead of trying to maintain a list of "natural terrain blocks", just
let the user specify a mask of blocks to use for the height map filter.

https://gfycat.com/severaljauntycondor
2019-02-26 23:54:53 -05:00
wizjany 9eeb0acffe Add radius checks to a few more utility commands. 2019-02-25 18:41:20 -05:00
wizjany 90797d12f4 Skip legacy materials when setting up registries.
Doesn't make a difference normally, but avoids errors in special envs.
2019-02-25 18:41:20 -05:00
wizjany 2f734d4570 Check radius instead of diameter for clipboard brush.
This brings it more in line with other brushes in terms of allowable size.
2019-02-25 18:41:19 -05:00
wizjanyandGitHub de9d202681 Clear shaped brush material on command.
The initial material is held in the factory, but if a brush was previously bound, that pattern is used.
Now, using `//br set` will clear the previous material, allowing the OperationFactory's material to work.
This can be changed later with `/mat`, which will once again set the fill on the tool, overriding the factory's context.
2019-02-15 14:51:26 -05:00
wizjany 319f2efe43 Ignore synthetic classes when loading BukkitImplAdapter. 2019-02-14 18:07:07 -05:00
wizjany 39131eb1e5 Revert "Remove synthetic classes from adapters."
This reverts commit 1ae0e88b
2019-02-14 17:56:48 -05:00
wizjany 313cd20b14 Make legacy compat layer return straight stairs. 2019-02-14 17:53:30 -05:00
wizjany 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
wizjanyandWizjany 287be0209c Slight readability and usability improvements.
Also no longer allows trailing strings (e.g. //set #clipboardasdf).
2019-02-12 17:11:57 -05:00
wizjanyandWizjany 19796aa3be Added offset to ClipboardPattern.
Takes input like '//set #clipboard@-1,0,1' which shifts the pattern over.
It also now extends RepeatingExtentPattern, which was previously unused.
2019-02-12 17:11:57 -05:00
wizjany 6708e8292f Restore generation of hollow shapes.
Unfortunately this is a bit slower than before since we can't cache block
id & data values. However, applying patterns generally isn't too expensive,
and hollow regions were entirely broken before.
2019-02-09 20:30:57 -05:00
wizjany cdd71178f5 Ensure BlockCategories are initialized.
We should probably have a way to initialize all these catalog classes ahead of time.
2019-02-04 22:34:25 -05:00
wizjany dddf2b963a Fix long-range build tool.
Blocks were always placed around 0,0,0 since the trace direction was being used as a position.
Also the message was backwards.
2019-02-03 19:27:30 -05:00
wizjany e6c6a2cfea Set version to next snapshot, even though this is about to get clobbered by 7.0 snapshot. 2018-08-03 21:40:04 -04:00
wizjany 08fc855c0f Release 6.1.9 for Bukkit 1.12.x 2018-08-03 21:39:18 -04:00
wizjany 437ad00658 Move asm dep to buildscript section. 2017-10-19 20:06:01 -04:00
wizjany 21d89311c9 Update asm dep for ForgeGradle. 2017-10-16 18:08:41 -04:00
wizjany d1c2b8c3e5 Downgrade sponge target to fix compilation issues. 2017-08-05 12:55:35 -04:00
wizjany f34bc7aca5 Updated Bukkit to 6.1.7.3 for MC 1.12.1 and Forge to 6.1.8 for MC 1.12. 2017-08-05 12:18:52 -04:00
wizjany b557b2b71d Revert "Some command fixes" aka "Some command breaks"
This reverts commit 4a8bba7a54.
Fixes WORLDEDIT-3574.
2017-06-09 12:46:26 -04:00
wizjany 9cf8847e0e [Bukkit] Push 6.1.7 and bump.
Forge will take the next number when it gets released.
2017-06-08 10:41:27 -04:00
wizjany b2fb73582f Fixed //center not working in some cases.
Due to odd rounding and math issues, using //center on a region with an edge of even
length in quadrants with negative coordinates would only fill one of the two center blocks.

Thanks to Griffrez and up201406036 for the original PR.

Fixes WORDLEDIT-2986.
2017-06-08 10:01:23 -04:00
wizjany a4f1f57c9d Add Bukkit adapter for 1.12.
Fixes WORLDEDIT-3567.
2017-06-08 10:01:23 -04:00
wizjany a03b9cbe4c Add blocks and items for MC 1.12.
And some forgotten before...
2017-06-08 10:01:23 -04:00
wizjany 46dff16a97 Use our own firstNonNull to maintain back-compat.
Fixes WORLDEDIT-3567.
2017-06-08 10:01:23 -04:00
wizjany 41de204186 Allow copyEntities to be used in ForwardExtentCopy again.
The -e flag should now work for //copy and //cut as it used to.

Fixes WORLDEDIT-3557.
2017-03-19 11:56:04 -04:00
wizjany e511758d99 Add rotations to various blocks that were missing them.
Up/down levers still broken.

Fixes WORLDEDIT-3490.
2017-02-26 18:56:38 -05:00
wizjany 9f24f84c2b Issue tracker is back. 2017-01-08 00:53:36 -05:00