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
This commit is contained in:
Matthew Miller
2019-08-25 19:58:28 +10:00
committed by GitHub
parent a0b9810c44
commit 0620478763
72 changed files with 2386 additions and 569 deletions

View File

@ -19,7 +19,6 @@
package com.sk89q.worldedit.fabric;
import com.sk89q.worldedit.registry.Category;
import com.sk89q.worldedit.world.block.BlockType;
import com.sk89q.worldedit.world.registry.BlockCategoryRegistry;
import net.minecraft.tag.BlockTags;
@ -38,9 +37,4 @@ public class FabricBlockCategoryRegistry implements BlockCategoryRegistry {
.map(Tag::values).orElse(Collections.emptySet())
.stream().map(FabricAdapter::adapt).collect(Collectors.toSet());
}
@Override
public Set<BlockType> getAll(Category<BlockType> category) {
return getCategorisedByName(category.getId());
}
}

View File

@ -19,7 +19,6 @@
package com.sk89q.worldedit.fabric;
import com.sk89q.worldedit.registry.Category;
import com.sk89q.worldedit.world.item.ItemType;
import com.sk89q.worldedit.world.registry.ItemCategoryRegistry;
import net.minecraft.tag.ItemTags;
@ -38,9 +37,4 @@ public class FabricItemCategoryRegistry implements ItemCategoryRegistry {
.map(Tag::values).orElse(Collections.emptySet())
.stream().map(FabricAdapter::adapt).collect(Collectors.toSet());
}
@Override
public Set<ItemType> getAll(Category<ItemType> category) {
return getCategorisedByName(category.getId());
}
}

View File

@ -100,6 +100,7 @@ import java.lang.ref.WeakReference;
import java.nio.file.Path;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.Optional;
import java.util.OptionalInt;
import java.util.Random;
@ -168,6 +169,13 @@ public class FabricWorld extends AbstractWorld {
return getWorld().getLevelProperties().getLevelName();
}
@Override
public String getId() {
return getWorld().getLevelProperties().getLevelName()
.replace(" ", "_").toLowerCase(Locale.ROOT)
+ getWorld().dimension.getType().getSuffix();
}
@Override
public Path getStoragePath() {
final World world = getWorld();