Add support for join, leave, and info signs.

The ability to execute commands by hitting signs is already implemented by other plugins, but by creating built-in support for such signs, it's possible to leverage information about the plugin and its current state. This implementation allows for displaying live information about player counts, waves, etc. on the signs in addition to tying actions to them.

Customizable templates defined in the new signs.yml config-file can be bound to signs during the in-game sign creation, and users can define state-specific templates that change based on whether an arena is completely idle, has players in the lobby, or is running and in full swing.

Sign data is stored in data/signs.data as a YAML-formatted file that shouldn't be modified directly, effectively separating configuration (templates in signs.yml) and data (coordinates and parameters in signs.data).

Closes #385
This commit is contained in:
Andreas Troelsen
2018-06-14 00:29:11 +02:00
parent 42416cab2f
commit 84249640d1
32 changed files with 2102 additions and 0 deletions
+55
View File
@@ -0,0 +1,55 @@
# MobArena Sign Templates
#
# Use this file to set up sign templates for use in MobArena. All of
# the templates in this file can be used for any of the three sign
# types (info, join, leave).
#
# Here is an example of a template:
#
# potato:
# - '<arena-name>'
# - '---------------'
# - 'Hit the sign to'
# - 'join the arena!'
#
# The template ID is 'potato', and the template uses the <arena-name>
# variable, which is translated into the name of the arena. To use the
# template in a join sign for an arena called 'castle', just place a
# sign in-game with the following lines:
#
# [MA] <-- needed by MobArena
# castle <-- arena name
# join <-- sign type
# potato <-- template (optional)
#
# For detailed information about the available variables and the state
# suffixes (-idle, -joining, -running), please visit the documentation.
info-idle:
- '&a<arena-name>'
- '---------------'
- 'Waiting for'
- 'players to join'
info-joining:
- '&a<arena-name>'
- '---------------'
- 'Ready: <ready-players>/<lobby-players>'
info-running:
- '&a<arena-name>'
- '---------------'
- 'Wave: <current-wave>'
- 'Alive: <live-players>/<initial-players>'
join:
- '&a<arena-name>'
- '---------------'
- 'Hit to join'
join-running:
- '&a<arena-name>'
- '---------------'
- 'In progress'
leave:
- '&a<arena-name>'
- '---------------'
- 'Hit to leave'