Board Styles
Board Styles
Overview
Board styles control how a board 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/Checkers/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. /checkers create board board1 -style mystyle
.
See Stock Styles for a list of stock board styles.
Material specifications
Some configuration items define the materials used in creating boards (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...
(Checkers actually uses some of the WorldEdit block manipulation classes, so in general any valid material specification in WorldEdit will also work fine in Checkers).
Example
This is the default style, greenwood.yml:
# Checkers board style definition # # See http://dev.bukkit.org/server-mods/checkers/board-styles for more information # # 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: 4 # 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: 8 # material/data for the white squares white_square: 'WOOD:2' # material/data for the black squares black_square: 'WOOL:GREEN' # material/data for the frame frame: 'WOOD:1' # material/data for the enclosure enclosure: 'AIR:0' # material/data for the enclosure struts (default: 'enclosure' setting) struts: 'WOOD:1' # board lighting level (0-15) light_level: 15 # material/data for the white pieces white_piece: 'WOOL:WHITE' # material/data for the black pieces black_piece: 'WOOL:RED' # material/data for the control panel (default: 'frame' setting) panel: 'WOOD:1' # highlighting material for selected piece highlight_selected: 'WOOL:YELLOW' # highlighting material for the last move made highlight_lastmove: 'WOOL:CYAN'
Board Style Attributes
The configurable attributes are as follows:
Attribute | Type | Description |
---|---|---|
square_size | integer | The 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_width | integer | The width of the frame that surrounds the board. Must be between 2 and 10 inclusive. |
height | integer | The 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. |
frame | Material spec. | The material used for the board frame. |
panel | Material spec. | The material used for the control panel body (default if omitted is the whatever is used for the frame). |
enclosure | Material spec. | The material used for the board enclosure (walls & roof) |
struts | Material 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_level | integer | Defines 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. |
highlight_lastmove | Material spec. | The material used to draw last-move highlights. |
highlight_selected | Material spec. | The material used to highlight the selected piece, if any. |
Editing Board Styles In-Game
It is possible to change most style parameters of a board from within the game, with the use of the /checkers board set...
command. You will need the checkers.commands.board.set permission node to do this. You must be standing on the board you intend to change.
Example command usage is:
/checkers 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
/checkers 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.
/checkers board set whitesquare wool:white
is equivalent to/checkers 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).
Using Skulls
As of v1.2.0, Checkers allows skull blocks to be used with custom player or monster skins. The block will face the right way for its colour. Since skull blocks occupy less space than one full block, they are very useful for small boards (1x1 square size). As an example (from the included micro board style):
white_piece: 'SKULL=MHF_Herobrine' black_piece: 'SKULL=MHF_Enderman'
Or to change a style in game:
/chc board set white_piece skull=mhf_pig
The syntax is SKULL=<player-name>
(not case sensitive). Note that players can change their skin at any time, so you can't in general rely on a skin remaining the same. However, the names starting with MHF_ should remain stable; see http://www.reddit.com/r/Minecraft/comments/1m0itx/twitter_marc_irl_mapmakers_would_it_be_useful/ and http://imgur.com/a/yM0wr for a discussion on this and for some more MHF skins.
You can also specify monster skulls (zombie, creeper, skeleton, wither) by putting a "*" in front of the monster type, e.g. SKULL=*zombie
.
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 /checkers board set ...
in the same way.
Attribute | Type | Description |
---|---|---|
board_style | String | The 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. |
default_stake | double | The 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_stake | boolean | If set to true, then players will be unable to change the stake for this board. Default is false. |
default_tc | String | The default time control for this board. If left blank, the global time_control.default setting will be used. Default is blank (empty string). |
lock_tc | boolean | If 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:
/checkers 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 /checkers redraw
command).
The style will be saved to the plugins/Checkers/board_styles/custom/
folder as a new .yml file converted to all lowercase. E.g. /checkers board save MyNewStyle
will cause the style to be saved to plugins/Checkers/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. /checkers create board -style mynewstyle
.
Notes
- You can have an open board 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 (you will see the wobbling client animation, but nothing else will happen).
Comments