Open source
Bringing features back to PGM, the open-source PvP Game Manager
My merged contributions to PGM, the open-source Minecraft PvP match plugin, including filtered respawns, score filters, flag drop filters and silent scoreboxes.
- 18merged pull requests
- 200+GitHub stars on the project
The problem
PGM runs PvP matches from XML map files, and a lot of maps were written for features that got dropped when it was open-sourced and refactored. Those maps either broke or played differently.
What I built
In late 2020 I brought a set of them back, all merged:
- Filtered respawns: a map can list several
<respawn>options, each with its own filter, and a player gets the first one they pass. The old single<respawn>still works as the fallback - A
scorefilter that passes for teams whose score is in a range, with ranges likescore="5"now parsing as a single value - A
drop-filteron flags, so a map can say where a flag is allowed to be dropped. Player queries gained an optional location so the filter can test the spot the flag would land - Silent scoreboxes, which score without the chat message and sound
- Fixes like catching bad team names early, clamping kill-streak ranges and making blitz lives at least one
Earlier in 2020 I added a setting so the map vote book only opens for players who want it, and made a left click on the team picker join you.
- Map XMLfilter, drop-filter, score
- FilterParserbuilds a Filter
- Modulestores it on the definition
- Queryplayer or party
- Resultallow, deny or abstain
How a filtered respawn is picked
# parse
for el in map.children("respawns/respawn") + legacy_respawn_or_empty:
options.add(RespawnOptions(delay, auto, blackout, spectate,
filter = parse_filter_property(el, "filter", default = ALLOW)))
# at runtime
fn respawn_options(player):
for o in options:
if o.filter.query(player.query()).is_allowed():
return o
throw IllegalState("no respawn option matched")
# score filter
fn query(party):
module = match.module(Score) or return ABSTAIN
return party is Competitor and range.contains(module.score(party))
Why it matters
Old maps that people still loved could run again without being rewritten, and map makers got a few more tools for new ones.