Giter Site home page Giter Site logo

worldedit's Introduction

This plugin allows you to easily manage the world, edit the world, navigate around or get information. It bears similarity to the Bukkit's WorldEdit plugin and aims to have the same set of commands,however, it has no affiliation to that plugin.

Saving to Cubeset files

Cuberite can generate single structures using its SinglePieceStructures generator. This generator uses preset areas which are saved in the Prefab/SinglePieceStructures folder. The files in this folder are Cubeset files which is a custom file format made by Cuberite's developers which stores the blocks, but also additional information like how spread out each structure has to be and in which biome(s) they can spawn. WorldEdit is able to generate these files though while Cubeset files can contain more than one structure WorldEdit only generates one per file. If you want more advanced cubeset files or create multi-piece structures you will have to use the Gallery and GalExport plugin. These plugins were used for example to create the cubeset files for villages and (nether) fortresses.

WorldEdit generates schematic files using the '//schematic save [format] [options...]' command. This command takes your current clipboard and saves it as the requested format in the "schematics" folder. By default this command uses the mcedit format with the ".schematic" extension. This is the default because most external programs use this format. In order to generate cubeset files you have to explicitly specify that you want the cubeset format. A valid command would look like this: "//schematic save cubeset myfile".

There are numerous adittional options which can be changed to modify how Cuberite's SinglePieceStructures generator handles the structure. The most important of these are:

  • AllowedBiomes In which biomes can the structure generate. If not specified it can generate in every biome.
  • GridSize What is the space between structures on the grid.
  • MaxOffset Used to make the placement less predictable. What is the maximum distance a structure can deviate from the grid.
  • piece.VerticalStrategy How should the generator determine the Y (vertical) coordinate. The choices for this option are listed below.
  • piece.ExpandFloorStrategy What should the generator do with the lowest layer once the piece is placed. The choices for this option are listed below.

piece.VerticalStrategy

How should the generator determine the Y (vertical) coordinate. Sometimes a the options require one or more extra parameters. These parameters are added and then separated using a pipe character "|"

  • Range|Min|Max Places the structure between the provided min and max parameters. Requires two parameters.
  • TerrainOrOceanTop|Offset Places the structure on the highest terrain or on ocean level. Requires one extra parameter with an offset.
  • TerrainTop|Offset Places the structure on the highest terrain. This can also be underwater. Requires one extra parameter with an offset.
  • Fixed|Height Always places the structure at the exact height.

piece.ExpandFloorStrategy

What should the generator do with the lowest layer once the piece is placed.

  • RepeatBottomTillNonAir Repeats every block of the lowest layer downwards until a non-air block is reached.
  • RepeatBottomTillNonSolid Repeats every block of the lowest layer downwards until a non-solid block is reached. This will make it go through water and foliage.
  • None Don't repeat the lowest layer at all.

Loading Cubeset files to clipboard

WorldEdit can also load cubeset files back into the users clipboard. This is done using the "//schematic load [options...]". If there are multiple structures in the cubeset file then it's possible to specify which one using "pieceIdx=". Do note though that WorldEdit will only look in the "schematics" folder.

Loading cubeset file in Cuberite's world generator

After saving your clipboard to a cubeset file it's possible to load it in the world generator. First you have to copy your file from the "schematics" folder into "Prefabs/SinglePieceStructures" and then enabling it in your world's world.ini file. This is done by adding SinglePieceStructures: into your world.ini's Finishers list.

Commands

Biome

Any biome specific commands.

Command Permission Description
//setbiome worldedit.biome.set Set the biome of the region
/biomeinfo worldedit.biome.info Get the biome of the targeted block(s)
/biomelist worldedit.biomelist Gets all biomes available

Brush

Command Permission Description
/brush Brush commands
/brush cylinder worldedit.brush.cylinder Switch to the cylinder brush tool
/brush sphere worldedit.brush.sphere Switch to the sphere brush tool
/mask worldedit.brush.options.mask Set the brush mask

Clipboard

All the commands that have anything todo with a players clipboard.

Command Permission Description
//copy worldedit.clipboard.copy Copy the selection to the clipboard
//cut worldedit.clipboard.cut Cut the selection to the clipboard
//paste worldedit.clipboard.paste Pastes the clipboard's contents
//rotate worldedit.clipboard.rotate Rotates the contents of the clipboard

Entities

Command Permission Description
/butcher worldedit.butcher Kills nearby mobs based on the given radius, if no radius is given it uses the default in configuration
/remove worldedit.remove Removes all entities of a type

Generation

Commands that generates structures.

Command Permission Description
//cyl worldedit.generation.cylinder Generates a cylinder
//generate worldedit.generation.shape Generates a shape according to a formula
//hcyl worldedit.selection.cylinder Generates a hollow cylinder
//hpyramid worldedit.generation.pyramid Generate a hollow pyramid
//hsphere worldedit.generation.hsphere Generates a hollow sphere
//pyramid worldedit.generation.pyramid Generate a filled pyramid
//sphere worldedit.generation.sphere Generates a filled sphere

History

Commands that can undo/redo past WorldEdit actions.

Command Permission Description
//redo worldedit.history.redo Redoes the last action (from history)
//undo worldedit.history.undo Undoes the last action

Navigation

Commands that helps the player moving to locations.

Command Permission Description
/ascend worldedit.navigation.ascend Go up a floor
/ceil worldedit.navigation.ceiling Go to the celing
/descend worldedit.navigation.descend Go down a floor
/jumpto worldedit.navigation.jumpto.command Teleport to a location
/thru worldedit.navigation.thru.command Passthrough walls
/up worldedit.navigation.up Go upwards some distance

Region

Commands in this category will allow the player to edit the region he/she has selected using //pos[1/2] or using the wand item.

Command Permission Description
//addleaves worldedit.region.addleaves Adds leaves next to log blocks
//ellipsoid worldedit.region.ellipsoid Creates an ellipsoid in the selected region
//faces worldedit.region.faces Build the walls, ceiling, and floor of a selection
//leafdecay worldedit.region.leafdecay Removes all the leaves in the selection that would decay
//mirror worldedit.region.mirror Mirrors the selection by the specified plane
//replace worldedit.region.replace Replace all the blocks in the selection with another
//set worldedit.region.set Set all the blocks inside the selection to a block
//stack worldedit.region.stack Repeat the contents of the selection
//vmirror worldedit.region.vmirror Mirrors the selection vertically
//walls worldedit.region.walls Build the four sides of the selection

Schematic

Commands that load or save schematic's

Command Permission Description
//schematic formats worldedit.schematic.list List available schematic formats
//schematic list worldedit.schematic.list List available schematics
//schematic load worldedit.schematic.load Loads the given schematic file
//schematic save worldedit.schematic.save Saves the current clipboard to a file with the given filename

Scripting

Command Permission Description
/.s worldedit.scripting.execute Execute last CraftScript
/cs worldedit.scripting.execute Execute a CraftScript

Selection

Commands that give info/help setting the region you have selected.

Command Permission Description
//chunk worldedit.selection.chunk Select the chunk you are currently in
//contract worldedit.selection.contract Contract the selection area
//count worldedit.selection.count Count the number of blocks in the region
//deselect worldedit.selection.deselect Deselect the current selection
//distr worldedit.selection.distr Inspect the block distribution of the current selection
//expand worldedit.selection.expand Expand the selection area
//hpos1 worldedit.selection.pos Set position 1 to the position you are looking at
//hpos2 worldedit.selection.pos Set position 2 to the position you are looking at
//loadsel worldedit.selection.loadselection Loads a selection that was saved before
//pos1 worldedit.selection.pos Set position 1
//pos2 worldedit.selection.pos Set position 2
//savesel worldedit.selection.saveselection Saves the current selection so it can be used later
//shift worldedit.selection.size Move the selection area
//shrink worldedit.selection.shrink Shrink the current selection to exclude air-only layers of the selection
//size worldedit.selection.size Get the size of the selection

Special

Commands that don't realy fit in another category.

Command Permission Description
//help worldedit.help Sends all the available commands to the player
//wand worldedit.wand Get the wand object
/toggleeditwand worldedit.wand.toggle Toggle functionality of the edit wand
/we WorldEdit command
/we cui Complete CUI handshake
/we help worldedit.help Sends all the available commands to the player
/we version Sends the plugin version to the player

Terraforming

Commands that help you Modifying the terrain.

Command Permission Description
//drain worldedit.drain Drains all water around you in the given radius
//extinguish worldedit.extinguish Removes all the fires around you in the given radius
//fill worldedit.fill Fill a hole
//fillr worldedit.fill.recursive Fill a hole recursively
//green worldedit.green Changes all the dirt to grass
//replacenear worldedit.replacenear Replace nearby blocks
//snow worldedit.snow Makes it look like it has snown
//thaw worldedit.thaw Removes all the snow around you in the given radius
/pumpkins worldedit.generation.pumpkins Generates pumpkins at the surface
/removeabove worldedit.removeabove Remove all the blocks above you
/removebelow worldedit.removebelow Remove all the blocks below you

Tool

Commands that activate a tool. If a tool is activated you can use it by right or left clicking with your mouse.

Command Permission Description
// worldedit.superpickaxe Toggle the super pickaxe pickaxe function
/farwand worldedit.tool.farwand Use the wand from a distance
/none Unbind a bound tool from your current item
/repl worldedit.tool.replacer Block replace tool
/tool Select a tool to bind
/tool cylinder worldedit.brush.cylinder Switch to the cylinder brush tool
/tool farwand worldedit.tool.farwand Use the wand from a distance
/tool none Unbind a bound tool from your current item
/tool repl worldedit.tool.replacer Block replace tool
/tool sphere worldedit.brush.sphere Switch to the sphere brush tool
/tool tree worldedit.tool.tree Tree generator tool
/tree worldedit.tool.tree Tree generator tool

Permissions

Permissions Description Commands Recommended groups
worldedit.biome.info /biomeinfo
worldedit.biome.set //setbiome
worldedit.biomelist /biomelist
worldedit.brush.cylinder /brush cylinder, /tool cylinder
worldedit.brush.options.mask /mask
worldedit.brush.sphere /brush sphere, /tool sphere
worldedit.butcher /butcher
worldedit.clipboard.copy //copy
worldedit.clipboard.cut //cut
worldedit.clipboard.paste //paste
worldedit.clipboard.rotate //rotate
worldedit.drain //drain
worldedit.extinguish //extinguish
worldedit.fill //fill
worldedit.fill.recursive //fillr
worldedit.generation.cylinder //cyl
worldedit.generation.hsphere //hsphere
worldedit.generation.pumpkins /pumpkins
worldedit.generation.pyramid //pyramid, //hpyramid
worldedit.generation.shape //generate
worldedit.generation.sphere //sphere
worldedit.green //green
worldedit.help /we help, //help
worldedit.history.redo //redo
worldedit.history.undo //undo
worldedit.navigation.ascend /ascend
worldedit.navigation.ceiling /ceil
worldedit.navigation.descend /descend
worldedit.navigation.jumpto.command /jumpto
worldedit.navigation.thru.command /thru
worldedit.navigation.up /up
worldedit.region.addleaves //addleaves
worldedit.region.ellipsoid //ellipsoid
worldedit.region.faces //faces
worldedit.region.leafdecay //leafdecay
worldedit.region.mirror //mirror
worldedit.region.replace //replace
worldedit.region.set //set
worldedit.region.stack //stack
worldedit.region.vmirror //vmirror
worldedit.region.walls //walls
worldedit.remove /remove
worldedit.removeabove /removeabove
worldedit.removebelow /removebelow
worldedit.replacenear //replacenear
worldedit.schematic.list //schematic list, //schematic formats
worldedit.schematic.load //schematic load
worldedit.schematic.save //schematic save
worldedit.scripting.execute /cs, /.s
worldedit.selection.chunk //chunk
worldedit.selection.contract //contract
worldedit.selection.count //count
worldedit.selection.cylinder //hcyl
worldedit.selection.deselect //deselect
worldedit.selection.distr //distr
worldedit.selection.expand //expand
worldedit.selection.loadselection //loadsel
worldedit.selection.pos //hpos2, //pos2, //pos1, //hpos1
worldedit.selection.saveselection //savesel
worldedit.selection.shrink //shrink
worldedit.selection.size //shift, //size
worldedit.snow //snow
worldedit.superpickaxe //
worldedit.thaw //thaw
worldedit.tool.farwand /farwand, /tool farwand
worldedit.tool.replacer /repl, /tool repl
worldedit.tool.tree /tree, /tool tree
worldedit.wand //wand
worldedit.wand.toggle /toggleeditwand

worldedit's People

Contributors

12xx12 avatar bearbin avatar evotopid avatar howaner avatar kentliau avatar leoschwarz avatar logicfan avatar madmaxoft avatar mathiascode avatar nilspace avatar seadragon91 avatar taugeshtu avatar tholo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

worldedit's Issues

Add a //simulate command

Add a new command that would wake up all simulators for all the blocks in the selection. This is useful for getting rid of leftover water blocks etc.

Paste command doesn't push proper Undo

The paste command doesn't push the proper area for undo, ever since it was changed to include the player-relative offset. It seems the paste always pushes the old-style area into Undo, rather than the changed area.

Add selection-manipulation API

Add a set of API functions to manipulate the player's selection, so that other plugins may use WE to select / display selection.

Don't allow schematics to be overwritten

As the title says, don't allow a schematic to be created if an identical name already exists. I'd love to see this feature added, as I run a server where all players get WorldEdit.

Add a //shrink command

This would "shrink" the current selection to exclude air-only "layers" of the selection. Layer in this sense being a single-block XY, XZ, or YZ slice of the selection.

2D example for illustration, . is air, x is any block except air, s is selection:
Before:

ssssssss
s......s
s.xx...s
s.x..x.s
s.xxxx.s
ssssssss

After:

ssssss
sxx..s
sx..xs
sxxxxs
ssssss

Add "/we cui" command handler

The 1.7.10 WECUI plugin sends this command on behalf of the player upon joining the server. Our WE plugin should at least provide an empty command handler so that an error message is not displayed to the user; possibly it could send the WE selection, if any, to the client.

Add an //ellipsoid <BlockType> command

This would take the current selection and fill an ellipsoid exactly inside it with BlockType. It's much easier to draw ellipsoids into confined spaces using this than by "from center"

Dropping the wand item causes a selection

When the player drops the item that is selected as the wand, it sets their selection's first point. This is probably due to the LeftClick network packet being used for dropping, too.

Add "/setbiome" command

The command should set the biome in the selection to the biome specified as the parameter. Use StringToBiome() to translate biome names.

License missing

The plugin doesn't contain a license file at the moment, which means it's automatically copyrighted. It would be a good idea to include an open source license or release the plugin into the public domain, since we accept code contributions.

Allow "long hands" when using the wand

When using the wand, make the player capable of reaching far by using a cLineBlockTracer to find the actual block that has been clicked (just like a //hpos command). This will allow the player to select blocks without having to move towards them.

Error messages missing

When entering an invalid block name/id with a WorldEdit command, it returns the generic "Something went wrong while executing..." error, instead of an invalid block error.

Add selection Undo-stack

Add an "undo" stack for the selection changes, so that the player can restore a previously used selection. Quite often making a selection is a long process and a single mis-click can destroy all that work, having an undo for that would come really handy.

This should include a command such as /undosel and /redosel.

Add //selpaste command

This should change the selection to show where the pasted contents would go if a //paste command was used.

Change API to match MCServer hooks with ING and ED

Currently WorldEdit has one callback for when a player tries to change an area. This should be changed. I propose creating a OnChangingArea and a OnChangedArea callback so that a plugin could for example see what has actualy changed.

Add proper world dependence for undo / redo

Undo and redo snapshots should remember which world they were taken in, so that they aren't applied in the wrong world (fix command sequences like //paste, portal to Nether, //undo)

Refactor globals into a PlayerState table

There are too many globals that keep track of the various aspect of player state:
OnePlayer, TwoPlayer, PersonalUndo, PersonalRedo, LastCoords, LastRedoCoords and possibly more.

These should all be refactored into a single player state table:

local State = GetPlayerState(a_Player:GetUniqueID())
State.Selection:SetFirstPoint(50, 50, 50)
State.Selection:SetSecondPoint(70, 70, 70)
State:PushUndo(SomeBlockArea)
-- etc.

Add a //mirror command

It should take one parameter, a string description of the plane to use for mirroring:
//mirror xy, //mirror xz, //mirror yx, //mirror yz, //mirror zx, //mirror zy.

Each would mirror the current selection around the specified plane.

This is an extension of the //vmirror command, implemented in #41.

Make //undo and //redo not paste the exact previous area

With the new msDifference strategy it should be rather easy to make //undo and //redo only change the changed blocks back to their original state not the complete area. (In fact I already finished it)

There is a problem though. If you change air blocks, or set blocks to air blocks the msDifference will also set those blocks to air which means an undo for //set air woudn't work.

Any thoughts on how to resolve this problem? We could set the meta data to 1 but then we can't use msImprint anymore to set the area to its previous state.

//pos1 and //pos2

Feature request:
Please implement //pos1 and //pos2, setting the selection edges to the coordinates the player currently is at.

Add //stack

Just a reminder. It is an essential command and should be prioritized.

//cut command erases smaller area than selection

When issuing a //cut command, the selection is properly copied to the clipboard, but then erasing is done to a smaller area than selection - the 1-block wide X+, Y+ and Z+ walls of the selection are left untouched.

Add //undo goto command

Add an //undo goto command that teleports the player to the place where the next //undo operation would change the world.

Placed chest with WorldEdit is not openable

Hello!

I have maked a schematic file with this plugin and placed it again. I am not able to open the chest and If I break it in survival mode no items appears, is this a known bug?

EDIT: After a server restart, I was able to open it - but it has no items

Reproduce:

  1. Create a chest place items in it
  2. Copy it with worldedit
  3. Paste it
  4. Try to open it

Prefixes on success/error/info messages or not?

Should we use prefixes on success/error/info messages, like Core and Essentials does, or should we make the plugin as similar to Bukkit's WorldEdit as possible, and use the current pink and red messages? What do you think?

Add "-a" parameter to //paste, with optional strategy

In original WE, the //paste command can be given the -a option to not write air. This corresponds with our cBlockArea.msImprint strategy. Implement that.

Additionally, we have more strategies available, they could be given as an extra parameter after -a, such as //paste -a FillAir

Add /fixwater

I will make a recommendation for this to be added to WorldEdit...

Better documentation

For many commands the help is not exactly clear on how they are used and what they even do. It'd be nice to provide more level of detail for them in the general description. Maybe even splitting the commands into a few categories, such as "terrain manipulation", "selection manipulation", "movement" etc. would be nice.

"Unable to locate sign"

When using //cut on signs, "Unable to locate sign" messages will appear in the chat. E.g. "Unable to locate sign at -117, 76, -46"

Add //undo list command

Add an //undo list command that lists the available levels in the undo, including their details - world name, position and size, operation name.

Add API to disable WE functions in areas

Plugins such as ProtectionAreas and Gallery are now vulnerable to players with WorldEdit rights, since WorldEdit can overwrite the areas protected by those plugins.

I'm asking for an API to set (rectangular) regions where WorldEdit cannot be used. The basic version would cover a static list of regions shared among all players. An advanced version would have a per-player list of regions.

Link item name with the block form of the item

Currently, whenever I try to set a block with both an inventory item ID and a block ID, a random block gets placed instead. Eg., when i do //set cake, a stone brick block gets placed instead of a cake block. I have to do //set cakeblock to actually get a cake placed.

Would it be possible to link the item name (in this case cake) with the block form of the item, instead of the inventory item (so that //set cake places a cake block, //set bed places a bed block etc.)? Or solve this in another way?

Add a "cBlockTypeSource" (interface) class

This interface would provide individual blocktypes for the various set, walls, replace and other such operations - they will ask the class to provide a blocktype for each block they set, and the class implementation will decide what blocktype to return.
Then, we can make multiple descendants that implement various behaviors:

  • cConstantBlockTypeSource returns the same blocktype for each query. Used for regular set operations.
  • cRandomBlockTypeSource returns a weighted-random blocktype for each query. Used for percent-based set operations.
  • cClipboardBlockTypeSource returns a blocktype based on the clipboard, in a repeating pattern. See http://wiki.sk89q.com/wiki/WorldEdit/Block_data_syntax#Clipboard for details

Add selection-naming

Add a command to save the current selection together with a name, and another command to later restore it using that name. This will allow people to save their favorite selections, for example "spawn", "home" etc.

Commands: /savesel <name> and /loadsel <name>.

The saved selection should be stored persistently so that they survive the player disconnecting and even server restart. SQLite would be the preferred storage medium.

Add API for pushing an Undo

If another plugin wants to do something rather destructive, it may want to register an undo with WE, so that the player can later undo the action of any plugin with a single command, centralized in WE.

--- Pushes an undo from the current contents of the area
-- a_World is the world where to read the area
-- a_Cuboid is the area's coords (both points are inclusive)
-- a_Description holds the user-visible description of the undo savepoint
-- Returns true on success, false on failure
function WEPushUndo(a_World, a_Cuboid, a_Description)

More //expand options

We should add more "directions" for the //expand command:

  • all / faces - expands all directions
  • walls - expands all four X and Z directions
  • height - expands the height to the full chunk height (used without the [NumBlocks] arg)

Check valid block types in block operations

Block operations that take a blocktype parameter from the user (such as //set) should check that the provided blocktype is really a block and not an item. Otherwise weird behavior will occur: //set gold sets the selection to gold blocks, but //set diamond sets the selection to water.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.