Commands by Iaiao · Pull Request #487 · feather-rs/feather · GitHub
Skip to content

Commands - #487

Draft
Iaiao wants to merge 61 commits into
feather-rs:mainfrom
Iaiao:commands
Draft

Commands#487
Iaiao wants to merge 61 commits into
feather-rs:mainfrom
Iaiao:commands

Conversation

@Iaiao

@Iaiao Iaiao commented Sep 26, 2021

Copy link
Copy Markdown
Contributor

Commands

Status

  • Ready
  • Development
  • Hold

Description

This PR adds commands. I've started working on this with lieutenant, but I did't like regex because it's hard to write regexps for something like @e[advancements={"adv":{criteria:"true"}}], it required some refactoring to make compatible structure for Declare Commands packet, CommandCtx: Send + Sync wouldn't allow LifetimelessMut<Game> and has no concept of tab completion, so I decided to make my own dispatcher instead of rewriting 95% of the existing code.

Things to do:

  • Vanilla commands
    • /help (/?)
    • /advancement
    • /attribute
    • /ban
    • /ban-ip
    • /banlist
    • /bossbar
    • /clear
    • /clone
    • /data
    • /datapack
    • /debug
    • /defaultgamemode
    • /deop
    • /difficulty
    • /effect
    • /enchant
    • /execute
    • /experience (/xp)
    • /fill
    • /forceload
    • /function
    • /gamemode
    • /gamerule
    • /give
    • /item
    • /kick
    • /kill
    • /list
    • /locate
    • /locatebiome
    • /loot
    • /me
    • /op
    • /pardon
    • /pardon-ip
    • /particle
    • /perf
    • /playsound
    • /recipe
    • /reload
    • /save-all
    • /save-off
    • /save-on
    • /say
    • /schedule
    • /scoreboard
    • /seed
    • /setblock
    • /setidletimeout
    • /setworldspawn
    • /spawnpoint
    • /spectate
    • /spreadplayers
    • /stop
    • /stopsound
    • /summon
    • /tag
    • /team
    • /teammsg (/tm)
    • /teleport (/tp)
    • /tell (/msg, /w)
    • /tellraw
    • /time
    • /title
    • /trigger
    • /weather
    • /whitelist
    • /worldborder
  • Tab completions
    • Tooltips
    • Replace position (start and end of replacement)
  • Arguments
    • Integer (i32, i64)
    • Float (f32, f64)
    • Ranges
    • String
    • Entity selectors
      • Selector parsing (serde)
      • Finding matching entities
      • "tag" selector (serde)
      • Selection by name and uuid
    • Custom enum argument macro
    • Boolean
    • Block position
    • Vec3
    • Vec2
    • Block State
    • Block Predicate
    • Itemstack
    • Item Predicate
    • Chat color
    • Text Component
    • Message (string with selectors)
    • Nbt
    • Nbt path
    • Objective
    • Objective criteria
    • Operation
    • Particle
    • Rotation
    • Angle
    • Scoreboard slot
    • Swizzle
    • Team
    • Item Slot (name)
    • Resource Location (identifier)
    • Mob effect
    • Function
    • Entity anchor
    • Item enchantment
    • Entity summon
    • Dimension
    • Uuid
    • Nbt tag (partial, used in data modify command)
    • Nbt compound tag (full)
    • Time
  • Console
  • Plugin support (I've done the rust native API and it works, and tried to make it work with wasm32-wasi, but I'm new to FFI and wasm, so I'll definitely need some help with this)
    • A fully functional example plugin (bungeecord-servers)
  • Permissions support
  • Declare Commands packet (maybe do something better than LengthInferredVecU8?)

Things to discuss

  • The new command crate's name
  • Command macro design
  • Should the /help command be auto-generated?
  • How can we organize vanilla command implementations? All in one file, one file per command or group them somehow

Related issues

Checklist

  • Ran cargo fmt, cargo clippy --all-targets, cargo build --release and cargo test and fixed any generated errors!
  • Removed unnecessary commented out code
  • Used specific traces (if you trace actions please specify the cause i.e. the player)

Note: if you locally don't get any errors, but GitHub Actions fails (especially at clippy) you might want to check your rust toolchain version. You can then feel free to fix these warnings/errors in your PR.

@ambeeeeee ambeeeeee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not going to solve borrow checking issues with an unsafe magic pointer.

I would recommend cherry picking all your commits and reapplying over the current main, as this pr includes code that was unmerged.

Comment thread feather/commands/src/impls.rs Outdated
Comment on lines +31 to +868

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to look into a different way to organize commands instead of a monolithic implementation file.

Comment thread feather/commands/src/lib.rs Outdated
Comment on lines +15 to +44

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q_Q Can we talk about this please

@ambeeeeee ambeeeeee Sep 26, 2021

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's basically 0 chance this will ever be merged as-is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants