Plugin channels/WorldEditCUI

From wiki.vg
< Plugin channels
Revision as of 22:27, 1 March 2016 by Pokechu22 (talk | contribs) (Rough draft of WECUI documentation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

WorldEdit uses plugin channels to communicate with the clientside WorldEditCUI mod to display selections.

This is a (very) rough documentation of those channels that I'll improve.

Structure

All communication is performed over the WECUI plugin channel, and is made up of a single UTF8 string with each value separated by |. The client, aside from REGISTERing the channel, must also send an initialization packet. All other data is sent from the server (on the same channel).

Version

Parsed in LocalSession.java

The v packet is sent from the client to the server to tell it that WorldEditCUI is installed. It has one parameter, the version of WorldEditCUI's protocol (an integer). This value is used to decide which types of selections can be sent - if a type of selection is not supported it will be sent as a different structure that is known to be supported.

v|(version)

Shape

The s packet does something with shapes. It has one field, the shape of the selection (?).

s|(shape)

Point

The p packet sets the location of one of the points in the current selection. It has 5 fields: the id, the block x, y, and z, and the total area.

p|(id)|(x)|(y)|(z)|(area)

Point 2D

The p2 packet sets the location of one of the points in the current selection, two-dimensionally. It has 4 fields: the id, the block x and z, and the total area.

p2|(id)|(x)|(z)|(area)

Cylinder

The cyl packet sets info about a cylindrical selection (?). It has 5 fields: the x, y, and z of the center and then the radius x and z.

cyl|(x)|(y)|(z)|(radX)|(radZ)

Ellipsoid Point

The e packet does... I don't know. It has 4 fields: the id, and x, y, and z coordinates.

e|(id)|(x)|(y)|(z)

Min/Max

The mm packet does something else. It has two fields, the minimum and the maximum. What these are the minimum and maximum of, I know not.

mm|(min)|(max)

Polygon

The poly packet sets verticies of a polygonal selection. It has an array of 3 (although it may be possible to add more) values, which seem to be indexes in the points list?

poly|(vertex1)|(vertex2)|(vertex3)