hematite_server icon indicating copy to clipboard operation
hematite_server copied to clipboard

1.9 changes to EntitySelector's gamemode field

Open fenhl opened this issue 9 years ago • 0 comments

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 gamemode field on types::selector::EntitySelector an Attr<u8> instead of Option<u8>
  • [ ] change the FromStr impl to parse the field correctly
  • [ ] change the From<&EntitySelector> for String impl to write gamemode using push_attrs! instead of push_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.

fenhl avatar Jan 22 '16 09:01 fenhl