Board Styles

Board Styles

Overview

Board styles control how a chessboard is drawn; its size, the materials used to draw the board, plus a few other attributes specific to individual boards.

Board styles are stored as files in plugins/ChessCraft/board_styles/ under your Bukkit folder. There is one file per style. It is a YAML file and must have a .yml extension. There is also a further custom/ folder under here, where any styles you create yourself should be placed, to avoid the possibility of being overwritten by predefined styles.

To use a style when creating a board, pass the '-style' option, e.g. /chess create board board1 -style mystyle.

See Stock Styles for a list of stock board and piece styles.

Material specifications

Some configuration items define the materials used in creating chessboards (and pieces). There are a couple of ways to specify these:

  • As simple integers, e.g. '5' is wood, '24' is sandstone, '49' is obsidian... plain integers must be quoted, or the style will not load!
  • As Bukkit or WorldEdit material names, e.g. wood, sandstone...
  • As item id plus data byte, e.g. 35:0, wool:white, wool:red...

(ChessCraft actually uses some of the WorldEdit block manipulation classes, so in general any valid material specification in WorldEdit will also work fine in ChessCraft).

Example

This is the default style, standard.yml:

# Chess board style definition

# Materials can be specified as plain integer (e.g. '0' - air), material name
#  (e.g. 'sandstone'), or material plus data (e.g. '35:0' or 'wool:white')
# If you use plain integers, they must be quoted, or the style will not load!
# If you use material names, they must match the org.bukkit.Material definitions exactly
#  - see http://jd.bukkit.org/apidocs/org/bukkit/Material.html

# Overall height of the board bounding box will be <height> + 2
# Overall width/length of the board bounding box will be <square_size> * 8 + <frame_width> * 2

# width/length of the board squares, in blocks
square_size: 5
# width in blocks of the frame surrounding the board
frame_width: 3
# height of the board - number of squares of clear air between board and enclosure roof
height: 6
# material/data for the white squares
white_square: sandstone
# material/data for the black squares
black_square: obsidian
# material/data for the frame
frame: wood
# material/data for the enclosure
enclosure: glass
# material/data for the enclosure struts
struts: iron_block
# the board's light level
light_level: 15
# style of chess set to use (see ../pieces/*.yml)
# the style chosen must fit within the square_size specified above
piece_style: Standard
# square highlighting style: use one of None, Line, Edges, Corners, Checkered/Chequered
highlight_style: Corners

Board Style Attributes

The configurable attributes are as follows:

AttributeTypeDescription
square_sizeintegerThe number of blocks on a side of one board square, e.g. 5 will give you 5x5 squares for an overall board dimension of 40x40 blocks. Must be between 1 and 30 inclusive.
frame_widthintegerThe width of the frame that surrounds the board. Must be between 2 and 10 inclusive.
heightintegerThe amount of clear air above the board, and also determines the height of the enclosure walls and ceiling. Must be between 3 and 128.
white_square,
black_square
Material spec.The materials for the white and black squares on the board, respectively.
frameMaterial spec.The material used for the board frame.
panelMaterial spec.The material used for the control panel body (default if omitted is the whatever is used for the frame).
enclosureMaterial spec.The material used for the board enclosure (walls & roof)
strutsMaterial spec.The material used to build the enclosure struts (vertical columns at the board corners, and horizontal bars around the edge of the enclosure roof). Defaults to the enclosure material if not specified.
light_levelintegerDefines the light level over the board. This obsoletes the old boolean lit setting. Note that any ambient lighting (e.g. from the sky or external light sources) will override lower light levels that you use, so for best results ensure that low-light boards are fully-enclosed. Note that lower light levels behave in a somewhat "glitchy" manner with occasional bright spots appearing - this seems to be an artifact of Minecraft's client-side lighting and difficult or imposible to work around.
piece_styleStringThe name of the default chess piece style that will be used on boards using this board style - see Piece Styles. You can override this on board creation with the '-pstyle' option, e.g. /chess create board b1 -pstyle <some-other-style>.
highlight_selectedStringThe material with which to paint the currently selected piece's square. Default: yellow wool.
highlight_styleStringThe last-move highlighting style used on this board. May be one of None, Corners, Edges, Checkered/Chequered or Line (default if omitted is Corners).
highlightMaterial spec.This is the material used to draw last-move highlights if highlight_style is not None. Defaults to glowstone.
highlight_white_square,
highlight_black_square
Material spec.These are the materials used for last-move highlighting of white squares and black squares, respectively. Default to whatever highlight is if omitted.

Editing Board Styles In-Game

It is possible to change most style parameters of a chess board from within the game, with the use of the /chess board set... command. You will need the chesscraft.commands.board.set permission node to do this. You must be standing on the board you intend to change.

Example command usage is:

/chess board set white_square wool:white black_square wool:black frame stone

Pass one or more pairs of style attributes (see the previous section for a list of valid attribute names) and style values. Some notes:

  • If you want to change multiple attributes at once, passing them all on the same /chess board set command is recommended for efficiency, since a full board redraw is done when the command is run.
  • You can leave out underscores '_' if you want, e.g. /chess board set whitesquare wool:white is equivalent to /chess board set white_square wool:white.
  • You can change any attribute which affects the board's appearance (i.e. the board materials, light level, highlight style...), but not any attribute which affects the board's size (square_size, height, frame_width).

Board Attributes

There are a few other attributes which are not part of a board style, but apply to the boards themselves. You can pass them to /chess board set ... in the same way.

AttributeTypeDescription
board_styleStringThe board style being used by this board. If you change this attribute, the new board style must have the same dimensions (square_size, frame_width, height) as the old style.
override_piece_styleStringThe piece style being used by this board. This is separate from the piece_style setting in that changing override_piece_style does not affect the board style that this board uses - it only allows this particular board to use an alternative piece style. Any new piece style must be able to fit onto the board's current style.
default_stakedoubleThe default stake for this board (Economy support needed). Any negative value means to use the global stake.default Configuration item. Default is -1.0.
lock_stakebooleanIf set to true, then players will be unable to change the stake for this board. Default is false.
default_tcStringThe default time control for this board. If left blank, the global time_control.default setting will be used. Default is blank (empty string).
lock_tcbooleanIf set to true, then players will be unable to change the time control for this board. Default is false.

Saving Your Changes

When done changing style settings, you should save your new board style with:

/chess board save [<new-style-name>]

If you omit the new style name, the name of the current style will be used. Note that until you save your changes, they will not survive a server restart or board redraw (with the /chess redraw command).

The style will be saved to the plugins/ChessCraft/board_styles/custom/ folder as a new .yml file converted to all lowercase. E.g. /chess board save MyNewStyle will cause the style to be saved to plugins/ChessCraft/board_styles/custom/mynewstyle.yml. The current board's data will also be updated to use the new style.

New styles can be used when creating boards as normal; e.g. /chess create board -style mynewstyle.

Notes

  • You can have an open chessboard by using 'air' for your enclosure. But be aware that although creatures do not spawn on the board by default, there is nothing to stop them wandering onto the board!
  • It is also possible to use 'water', 'lava' or 'portal' for passable enclosures. You will not be injured by the lava! Portal enclosures will not port you to the nether as of v0.5.1 (you will see the wobbling client animation, but nothing else will happen).

Comments

Posts Quoted:
Reply
Clear All Quotes