Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command api v2 #5036

Draft
wants to merge 25 commits into
base: master
Choose a base branch
from
Draft

Conversation

RacoonDog
Copy link
Contributor

Overview

This pull request contains new API functions for addon developers, bug fixes, performance fixes, QOL fixes, 4 new commands, and rewrites of existing commands to add new functionality.

Command Changes

.nbt

  • Removed all subcommands dealing with itemstacks, they have been moved to the new .components command.
  • Added selectors for getting NBT data from other entities and block entities.

.components

  • Rewrote all subcommands that used now-deprecated NBT data into using item data components directly.
  • Added the full flag to switch between get/copying the full ComponentMap or just the ComponentChanges of an itemstack.
  • Readded the paste subcommand.
  • Added the rename subcommand.

.macro

You can now create new macros through commands with .macro create, delete them with .macro delete, rebind them with .macro bind, and modify their contents with .macro edit

.enderchest

.enderchest will now display an error if the ender chest contents are unknown instead of opening an empty inventory.

New Commands

.components

Contains the subcommands that deal with itemstacks that were removed from .nbt

.config

Edit your Meteor Client configurations through commands much like how .setting works with modules configurations.

.transmogrify

Lets you change the appearance of an item in your inventory to any other item in the game through item data components. Requires creative mode.

API Changes

  • The command registry access (Command.REGISTRY_ACCESS) and command dispatcher (Commands.DISPATCHER) are now dynamically rebuilt on every world join to properly support command argument types which make use of dynamic registries.

  • NotebotSongArgumentType will now throw a command syntax exception when the input does not match an existing file in the notebot folder, meaning manual checking is no longer necessary.

  • FakePlayerArgumentType, FriendArgumentType, ProfileArgumentType, and WaypointArgumentType are now properly typed instead of using String and external parsing.

  • WaypointArgumentType no longer has an option for using a greedy string, it now uses StringReader#readString which either takes in a single word or a quoted string.

  • Two new argument types imported from clientarguments under the MIT license: BlockPosArgumentType and EntityArgumentType.

  • Utility classes for dealing with creative inventory packets in commands, ItemSlotArgumentType and CreativeCommandHelper.

  • Utility classes for encoding & decoding itemstack ComponentMaps and ComponentChanges to and from string, ComponentMapWriter and ComponentMapReader.

  • Utility class for decoding a Path in a command, PathReader.

Performance Optimizations

  • Switched command aliases from full-blown duplicate command trees to single redirect nodes.

  • Replaced usages of Text within command exception types to LiteralMessage, removing an unused allocation of a Style object.

  • Removed redundant sanity checking in CompoundNbtTagArgumentType that was already covered in StringNbtReader#parse

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.

1 participant