hematite_server
hematite_server copied to clipboard
1.9 changes to EntitySelector's gamemode field
In 1.9 (implemented in Notchian as of 16w02a), entity selectors will support negation of the gamemode argument, e.g. @a[m=!3] to select everyone except spectators. The syntax will also change to allow things like @p[m=c] or @p[m=creative] to select the nearest player in Creative mode, where previously only @p[m=1] was allowed. To implement this we need to:
- [ ] make the
gamemodefield ontypes::selector::EntitySelectoranAttr<u8>instead ofOption<u8> - [ ] change the
FromStrimpl to parse the field correctly - [ ] change the
From<&EntitySelector> for Stringimpl to write gamemode usingpush_attrs!instead ofpush_args!
This would also be a great opportunity to introduce a gamemode enum and use it everywhere, including selectors, the clientbound packets JoinGame and Respawn, and the server.properties parser.