Coder Social home page Coder Social logo

mantle's People

Contributors

whimxiqal avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mantle's Issues

Show subcommands on help menu when help info is set

Currently, a help menu won't show up for a command unless the CommandInfo is set and the rule has a description. If the CommandInfo is set, a help menu should still appear with just the list of subcommands, and just with an empty description if the description isn't provided in the CommandInfo.

Add parameter to "addPermission" for uses with no children

Right now, permissions are handled by seeing which items in the parser tree show up as the command is parsed and connecting them to saved permissions. There should be an extra flag for addPermission in the command connector that specifies whether the permission is only meant for the command if there are no children on the command.

For example, /foo bar may have permission foo.bar, but also have a permission foo for if you want to run just /foo. Currently, if you want to specify that your rule RULE_foo has permission foo and your rule RULE_foobar has permission foo.bar, you will not be able to run /foo bar if permission foo is false.

A current work around is to just to extra permission checks within the executor and not include the root-command permission in the connector.

Supply more context of the command in parameter registration

Currently, registering a parameter just provides the command source, such as the player. The registration should include information about the rest of the command.

One way to do this is allow the dev to register one or more "preprocessing" phases. This can get all the identifiers and also any other custom types of content like flags. This can be supplied to the dev for command completion and can also be supplied in the command executor so the dev doesn't have to manage the collection of identifiers themselves.

Remove help command support

In the spirit of using Antlr4 to its fullest potential, I've decided supporting help commands altogether is too difficult and would require duplicating info in the connector.

The main reason why it's difficult is because "command" following the next one can be any number of things, which is either the next token after the current rule or any of the possible completion values for the next rule, which are all provided by the identifier info. Deciding what to send as a "subcommand" and applying the right description is not trivial and may not even conform any nonconventional approaches to command structures anyway.

There are ways to salvage some help command support, like providing a list of completions rather than "subcommands" and their descriptions, which is conducive to more eclectic grammars. But I'll only implement this if there's a push for it

Add better command error support

Currently, if there's an ANTLR parsing error, which is just that someone types a command wrong, a very difficult-to-read error message appears that's very accurate, but not very Minecraft-y. This error should be made better

Add multi-language support

Add a configurable parameter on initialization that determines which language to use for logging, messaging, and errors

Implementing languages other than English will be tracked in other issues

Add "Identifier" accessor

Currently, devs must parse children rules to find all the identifiers before running the command logic and any specific rule. Instead, during a preliminary parsing stage, all the relevant identifiers should be found and collected to be passed into the provide method of the CommandExecutor so during primary command parsing, all identifiers are available.

This change would include a registration of the dev's custom identifier rule in the CommandConnector, since we should make no assumptions about how the dev will manage identifiers.

Add validation to parameters

In addition to the various options for command completion, parameters should include validation so it doesn't have to happen in the executor.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.